Skip to content

Commit

Permalink
Invert class prob if RHO negative + minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
olas committed May 22, 2012
1 parent efa9780 commit ec938bc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Expand Up @@ -137,7 +137,6 @@ protected List<? extends ITestResult> doRunTest(ICDKMolecule cdkmol,
//Parse result and create testresults
double posProb = Double.parseDouble(ret.substring(4));
System.out.println("Parsed prediction prob: " + posProb);


int overallPrediction;
if (posProb>=0.5)
Expand Down
Expand Up @@ -100,6 +100,15 @@ protected List<? extends ITestResult> doRunTest(ICDKMolecule cdkmol,
//Parse result and create testresults
double posProb = Double.parseDouble(output.substring(4));

//Check what rho is, if negative then invert predictions
//FIXME
output = R.eval("cas.svm$rho");
if (output.substring(4).startsWith("-")){
System.out.println("RHO IS NEG - INVERT!");
posProb=1-posProb;
}


int overallPrediction;
if (posProb>=0.5)
overallPrediction = ITestResult.POSITIVE;
Expand Down
Expand Up @@ -134,7 +134,7 @@ public Map<IMolecule, AtomSignatures> generate(List<? extends IMolecule> mols,

AtomSignatures as = generate( mol , height);

logger.debug("Mol=" + mol + ", height=" + height + ", SIGNS=" + as.getSignatures());
// logger.debug("Mol=" + mol + ", height=" + height + ", SIGNS=" + as.getSignatures());

if (as.getSignatures() == null || as.getSignatures().size()<=0)
logger.error( "No signatures generated for for molecule: "
Expand Down Expand Up @@ -367,7 +367,7 @@ public SparseDataset generateSparseDataset(List<? extends IMolecule> mols, List<

}

logger.debug("SIGNS: " + allSignaturesList);
// logger.debug("SIGNS: " + allSignaturesList);

//Set up the dataset
LinkedHashMap<Point, Integer> values = new LinkedHashMap<Point, Integer>();
Expand Down

0 comments on commit ec938bc

Please sign in to comment.