Hi Paul,

On Fri, Aug 24, 2012 at 1:57 PM,  <[email protected]> wrote:
>
>
> please find below a code snippet for a 2class model.
> The confusion matrix looks fine.
>
> But when re-applying the model (for test purposes), I end up with
> predictions that ony give consistently ONE class.
>
>
>
> # descriptor calculation etc...
> cmp.Grow(cpds_w_descr,attrs=attrs,nPossibleVals=nPossible,nTries=10,\
>          buildDriver=CrossValidate.CrossValidationDriver,\
>          treeBuilder=QuantTreeBoot,
> needsQuantization=False,nQuantBounds=boundsPerVar, maxDepth=3)
>

<snip>

>
> # actual predicion
>
> prediction_dictionary = {}
> for x in cpds_w_descr:
>     pred,conf=cmp.ClassifyExample(x[1:])
>     NAME=x[0]
>     prediction_dictionary[NAME]=pred,conf
>     i+=1
> for mol in cpds:
>     mol_name = mol.GetProp('_Name')
>     mol.SetProp('prediction',str(prediction_dictionary[mol_name][0]))
>     mol.SetProp('prediction_confidence',str(prediction_dictionary
> [mol_name][1]))
>     testset_pred.write(mol)

This is just a guess, but it looks like you're passing ClassifyExample
a shorter vector for each point than what you passed to Grow.
Does it work if you do: pred,conf=cmp.ClassifyExample(x)?

-greg

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to