2013/9/25 Luca Cerone <luca.cer...@gmail.com>:
> This morning I checked the source for LogisticRegression in
> sklearn/linear_model/logistic.py and realized that by default it performs
> multiclass classification
> (this is not explained in the user guide
> http://scikit-learn.org/stable/modules/linear_model.html#logistic-regression,
> though).

All our classifiers support multiclass classification and this is
documented in various places.

> There are still a few things that are not clear to me from the
> documentation. Can you customize the classifier to perform a different
> decision function?

You can subclass it and override the decision_function method.

> Or can I "hook" a preprocessing step to be applied to the data (I am
> thinking for example for polynomial logistic regression, where from the
> original dataset

You can implement a polynomial expansion as a transformer object, then
tie it to logistic regression using a sklearn.pipeline.Pipeline. See
the developer's docs, esp. the "Rolling your own estimator" guide [1],
or our recent paper [2] for the conventions.

> 1. can I use a norm different from l1 or l2?

For what?

> 2. similarly, can I define my own cost function?

No, unless you hack the source code.

> 3. can I try alternative optimization algorithms?

You can try SGDClassifier(loss="log") which also implements
one-vs.-all logistic regression, but trained with stochastic gradient
descent.


[1] 
http://scikit-learn.org/stable/developers/index.html#rolling-your-own-estimator
[2] http://staff.science.uva.nl/~buitinck/papers/scikit-learn-api.pdf

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to