To make it clearer, here's the current implementation's take on the example
from the other day:

>>> from sklearn import grid_search, linear_model, datasets
>>> iris = datasets.load_iris()
>>> clf = grid_search.GridSearchCV(linear_model.LogisticRegression(),
{'C': [1, 10]}, scoring='prf1')
>>> clf.fit(iris.data, iris.target == 1)  # binary classification
...
>>> clf.cv_folds_
{'n_test_samples': array([[50, 50, 50],
       [50, 50, 50]]),
 'precision': array([[ 0.66666667,  0.54545455,  0.        ],
       [ 0.69230769,  0.53333333,  0.5       ]]),
 'recall': array([[ 0.375     ,  0.35294118,  0.        ],
       [ 0.5625    ,  0.47058824,  0.23529412]]),
 'score': array([[ 0.48      ,  0.42857143,  0.        ],
       [ 0.62068966,  0.5       ,  0.32      ]])}
>>> clf.cv_scores_
array([ 0.30285714,  0.48022989])

Actually, we might as well replace 'f1' scorer with 'prf1'...

The other thing I note is missing from the implementation is the index of
the best params within these arrays.

- Joel

On Tue, Mar 12, 2013 at 5:05 PM, Joel Nothman
<[email protected]>wrote:

> An implementation, without backwards compatibility or new tests (but with
> tests.test_grid_search modified to pass) at
> https://github.com/jnothman/scikit-learn/tree/cv-enhanced-results (
> c9d45a3444<https://github.com/jnothman/scikit-learn/commit/c9d45a3444e6474901dca13eaeaef83b708bd969>).
> I hope you like the general idea; I'm not sure you'll like the current
> attribute names...
>
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to