[Scikit-learn-general] Searchlight algorithm with scikit-learn?

2011-09-29 Thread Michael Waskom
Hi all, I know that there are some other people out there using scikit-learn for MVPA with neuroimaging data. Does anyone have an implementation of the searchlight method (i.e. http://www.ncbi.nlm.nih.gov/pubmed/16537458) using scikit-learn that they would be willing to share? Michael --

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Mathieu Blondel
Good to see that we reached a consensus. So, predict_scores will be a wrapper around existing score-prediction methods and we'll be able to use it in other places such KMeans. I won't have time to implement this proposal any time soon. If anyone feels like doing it, feel free to jump in. Mathieu

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Gael Varoquaux
On Thu, Sep 29, 2011 at 05:59:49PM +0200, Olivier Grisel wrote: > Ok for predict_score then. predict_scores, with an 's' at the end. G -- All the data continuously generated in your IT infrastructure contains a definitiv

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Olivier Grisel
Ok for predict_score then. -- Olivier http://twitter.com/ogrisel - http://github.com/ogrisel -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application perform

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread bdholt1
+1 -Original Message- From: Paolo Losi Date: Thu, 29 Sep 2011 17:57:17 To: Reply-To: scikit-learn-general@lists.sourceforge.net Subject: Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function --

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Paolo Losi
On Thu, Sep 29, 2011 at 5:54 PM, Gael Varoquaux < gael.varoqu...@normalesup.org> wrote: > On Thu, Sep 29, 2011 at 11:53:20AM -0400, Alexandre Gramfort wrote: > > predict_scores? > > ^ my favorite +1 -- All the data conti

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Gael Varoquaux
On Thu, Sep 29, 2011 at 11:53:20AM -0400, Alexandre Gramfort wrote: > predict_scores? ^ my favorite. G -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, applicati

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Alexandre Gramfort
predict_scores? predict_sample_scores? predict_values? Alex On Thu, Sep 29, 2011 at 11:47 AM, Mathieu Blondel wrote: > On Fri, Sep 30, 2011 at 12:38 AM, Olivier Grisel > wrote: > >> "score" seems a bit too generic to me and I think it would conflict >> with our existing use of the word "score"

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Paolo Losi
Hi Olivier, I would favour score with respect to confidence. Score is frequently used in probability calibration papers. See for example: "Transforming classifier scores into accurate multiclass probability estimates" by Zadrozny Paolo On Thu, Sep 29, 2011 at 5:38 PM, Olivier Grisel wrote: >

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Mathieu Blondel
On Fri, Sep 30, 2011 at 12:38 AM, Olivier Grisel wrote: > "score" seems a bit too generic to me and I think it would conflict > with our existing use of the word "score" in the metrics module which > is more about the general goodness of fit of an estimated model w.r.t. > a complete datasets (e.g

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Alexandre Gramfort
> +1 for the general idea, but what about using "predict_confidence" > instead of "predict_score"? -1 as I feel predict_confidence has a specific meaning in stats and score makes things clear (the bigger the better) My concern is the same naming for estimator.score(X) and estimator.predict_score(

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Gael Varoquaux
On Thu, Sep 29, 2011 at 11:38:09AM -0400, Alexandre Gramfort wrote: > > I hadn't thought about it but it's a good idea. We could drop the > > leading underscore (_predict_margin -> predict_margin), this way we > > can keep using hasattr(clf, "predict_margin") to check the > > capabilities of an obj

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Olivier Grisel
+1 for the general idea, but what about using "predict_confidence" instead of "predict_score"? As far as I can tell "confidence" is often the case that confidence can be some sort of loosely defined unormalized probability. But maybe it conflicts with the meaning of "confidence" as in "confidence

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Alexandre Gramfort
> I hadn't thought about it but it's a good idea. We could drop the > leading underscore (_predict_margin -> predict_margin), this way we > can keep using hasattr(clf, "predict_margin") to check the > capabilities of an object (Gael really likes this and it's true that > it's nice!). That would als

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Gael Varoquaux
On Fri, Sep 30, 2011 at 12:32:42AM +0900, Mathieu Blondel wrote: > On Fri, Sep 30, 2011 at 12:16 AM, Lars Buitinck wrote: > > def predict_score(self, X, score): > >    if score == 'margin': > >        return self._predict_margin(X) > > etc.? > I hadn't thought about it but it's a good idea. We

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Gael Varoquaux
On Thu, Sep 29, 2011 at 03:48:22PM +0200, Olivier Grisel wrote: > 2011/9/29 Lars Buitinck : > > 2011/9/29 Peter Prettenhofer : > >> +1, we should change the behavior of SGDClassifier to match SVC > > I see now that SVC(probability=True) indeed returns (n_samples, > > n_classes) output... any othe

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Gael Varoquaux
On Thu, Sep 29, 2011 at 03:47:09PM +0200, Olivier Grisel wrote: > > LinearSVC.predict_proba raises a NotImplementedError ... > Yes and I think this is a bad pattern. We should remove the > predict_proba method from LinearSVC. We should remove it from the > liblinear base class and just define it f

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Mathieu Blondel
On Fri, Sep 30, 2011 at 12:16 AM, Lars Buitinck wrote: > def predict_score(self, X, score): >    if score == 'margin': >        return self._predict_margin(X) > > etc.? I hadn't thought about it but it's a good idea. We could drop the leading underscore (_predict_margin -> predict_margin), this

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Lars Buitinck
2011/9/29 Mathieu Blondel : > LogisticRegression supports all three kinds of score (proba, log proba > and margin), therefore we could have clf.predict_score(X, > score="margin|proba|log_proba"). I like the idea in principle. I assume we would implement this in a base class or mixin as something l

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Paolo Losi
+10 1) this solution standardizes the handling of the score concept as Mathieu suggested. 2) makes implementing score calibration to get probability estimates indipendent from the classifier. Paolo On Thu, Sep 29, 2011 at 4:54 PM, Mathieu Blondel wrote: > Ok, I'm starting a new thread t

Re: [Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Alexandre Gramfort
sounds good but I'd rather have shape [n_samples, n_classes] so the indexing axis is the same as for X. Alex On Thu, Sep 29, 2011 at 10:54 AM, Mathieu Blondel wrote: > Ok, I'm starting a new thread to throw a new idea. > > Several times I needed to implement a method that could generalize to >

[Scikit-learn-general] Unifying predict_proba, predict_log_proba and decision_function

2011-09-29 Thread Mathieu Blondel
Ok, I'm starting a new thread to throw a new idea. Several times I needed to implement a method that could generalize to new inputs and predict a score, which is however not a probability. decision_function is an example of such a method but the name is not really good and too much tight to linear

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Alexandre Gramfort
>> does decision_function make sense in the multiclass case? > > It does make sense with one-vs-all (LinearSVC). One-vs-one (SVC) is > more problematic... ok it suggests that decision_function is an ill-posed concept and that's it's estimator dependent. >> maybe with an np.argmax(df, axis=1) ? >

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Alexandre Gramfort
does decision_function make sense in the multiclass case? maybe with an np.argmax(df, axis=1) ? in that case I think the output should be (n_samples, 1) if not (n_samples,) Alex On Thu, Sep 29, 2011 at 9:53 AM, Mathieu Blondel wrote: > On Thu, Sep 29, 2011 at 10:48 PM, Olivier Grisel > wrote:

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Lars Buitinck
2011/9/29 Mathieu Blondel : > On Thu, Sep 29, 2011 at 10:48 PM, Olivier Grisel > wrote: > >> +1 for the (n_samples, n_classes) shape with probabilities that sum to >> 1.0 for all predict_proba implementations (binary or multiclass). > > In that case,  what about decision_function? Currently, in th

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Mathieu Blondel
On Thu, Sep 29, 2011 at 10:48 PM, Olivier Grisel wrote: > +1 for the (n_samples, n_classes) shape with probabilities that sum to > 1.0 for all predict_proba implementations (binary or multiclass). In that case, what about decision_function? Currently, in the binary case, it returns (1, n_sample

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Olivier Grisel
2011/9/29 Olivier Grisel : > 2011/9/29 Lars Buitinck : >> 2011/9/29 Peter Prettenhofer : >>> >>> +1, we should change the behavior of SGDClassifier to match SVC >> >> I see now that SVC(probability=True) indeed returns (n_samples, >> n_classes) output... any other opinions on this? > > +1 for the (

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Alexandre Gramfort
could you be more explicit about the change of behavior? does it match with the LibLinear predict_proba? >>> >>> LinearSVC doesn't have predict_proba, >> >> it does for the logistic regression. > > LinearSVC.predict_proba raises a NotImplementedError ... LibLinear if also used for t

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Olivier Grisel
2011/9/29 Lars Buitinck : > 2011/9/29 Peter Prettenhofer : >> >> +1, we should change the behavior of SGDClassifier to match SVC > > I see now that SVC(probability=True) indeed returns (n_samples, > n_classes) output... any other opinions on this? +1 for the (n_samples, n_classes) shape with proba

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Olivier Grisel
2011/9/29 Peter Prettenhofer : > 2011/9/29 Alexandre Gramfort : could you be more explicit about the change of behavior? does it match with the LibLinear predict_proba? >>> >>> LinearSVC doesn't have predict_proba, >> >> it does for the logistic regression. > > LinearSVC.predict_prob

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Lars Buitinck
2011/9/29 Peter Prettenhofer : > > +1, we should change the behavior of SGDClassifier to match SVC I see now that SVC(probability=True) indeed returns (n_samples, n_classes) output... any other opinions on this? -- Lars Buitinck Scientific programmer, ILPS University of Amsterdam --

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Peter Prettenhofer
2011/9/29 Alexandre Gramfort : >>> could you be more explicit about the change of behavior? >>> >>> does it match with the LibLinear predict_proba? >> >> LinearSVC doesn't have predict_proba, > > it does for the logistic regression. LinearSVC.predict_proba raises a NotImplementedError ... > >> bu

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Alexandre Gramfort
>> could you be more explicit about the change of behavior? >> >> does it match with the LibLinear predict_proba? > > LinearSVC doesn't have predict_proba, it does for the logistic regression. > but it matches the > SGDClassifier's: 1-d output containing the probabilities of the > positive class

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Lars Buitinck
2011/9/29 Alexandre Gramfort : > could you be more explicit about the change of behavior? > > does it match with the LibLinear predict_proba? LinearSVC doesn't have predict_proba, but it matches the SGDClassifier's: 1-d output containing the probabilities of the positive class in the binary case.

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Alexandre Gramfort
could you be more explicit about the change of behavior? does it match with the LibLinear predict_proba? Alex On Thu, Sep 29, 2011 at 9:21 AM, Mathieu Blondel wrote: > On Thu, Sep 29, 2011 at 10:16 PM, Lars Buitinck wrote: > >> Mathieu's multiclass.predict_binary relied on the old >> Multinomi

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Mathieu Blondel
On Thu, Sep 29, 2011 at 10:16 PM, Lars Buitinck wrote: > Mathieu's multiclass.predict_binary relied on the old > MultinomialNB.predict_proba behavior. Fixed it. Thanks. Do all classifiers with a predict_proba method comply to the new behavior? Mathieu --

Re: [Scikit-learn-general] Broken tests in master

2011-09-29 Thread Lars Buitinck
2011/9/29 Olivier Grisel : > Hi all, > > builbot keeps sending me emails about broken tests in master: > > http://buildbot.afpy.org/scikit-learn/builders/ubuntu-64bit/builds/8340/steps/test/logs/stdio Mathieu's multiclass.predict_binary relied on the old MultinomialNB.predict_proba behavior. Fixed

[Scikit-learn-general] Broken tests in master

2011-09-29 Thread Olivier Grisel
Hi all, builbot keeps sending me emails about broken tests in master: http://buildbot.afpy.org/scikit-learn/builders/ubuntu-64bit/builds/8340/steps/test/logs/stdio == ERROR: sklearn.tests.test_multiclass.test_ovr_fit_predict ---