HI Paul,
On Thu, Jun 9, 2011 at 12:56 PM, <[email protected]> wrote:
>
>
> I'm trying to apply a Composite model on a test set.
> However, no output is generated. At least, no error/warning, but I cannot
> jugde if the model gives any predictions.
indeed it does.
> Now I would like to use the model to do predictions for the test set:
>
> cmp.ClassifyExample(pts_test1[0])
You've got it at this point. You just need to capture the result of that call:
>>> pred,conf=cmp.ClassifyExample(pts_test1[0])
>>> print pred,conf
--> print(pred,conf)
(2, 1.0)
And, since this is a validation data set and you have experimental
values, you can use ScreenComposite.ShowVoteResults just like you did
when training the model:
>>> res = ScreenComposite.ShowVoteResults(range(len(pts_test1)), pts_test1,
>>> cmp, 3, 0,errorEstimate=False)
*** Vote Results ***
misclassified: 43/257 (%16.73) 43/257 (%16.73)
average correct confidence: 0.9047
average incorrect confidence: 0.7605
Results Table:
30 6 0 | 73.17
10 97 15 | 83.62
0 12 87 | 84.47
------- ------- -------
75.00 84.35 85.29
Note that I used "errorEstimate=False" here since this is a test set
and I can use the full model instead of doing out-of-bag validation.
The performance of this model is already pretty good, but I can use
the information about confidence again to set a threshold on the
predictions and improve accuracy at the expense of rejecting some data
points:
>>> res = ScreenComposite.ShowVoteResults(range(len(pts_test1)), pts_test1,
>>> cmp, 3, 0.7,errorEstimate=False)
*** Vote Results ***
misclassified: 22/257 (%8.56) 22/203 (%10.84)
skipped: 54/257 (% 21.01)
average correct confidence: 0.9613
average incorrect confidence: 0.9182
Results Table:
19 0 0 | 76.00
5 83 10 | 91.21
0 7 79 | 87.78
------- ------- -------
79.17 92.22 88.76
Paul: one thing you should look into: if I copy the code from the wiki
and paste it into a python session, it doesn't work. There are some
imports missing.
-greg
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss