Hello,

I am new too, but I think you can do a OvA for these type of problems,


1. Loop across all labels.
2. For each label, convert y into data containing 1 and -1, i.e all the
labels other then the current class should be -1 (Hence the name)
3. And then predict, using clf.predict(X)

For each sample, whichever label has the maximum value, that is value
closest to 1., that will be your predicted label.



On Tue, Jul 22, 2014 at 4:17 PM, Sheila the angel <from.d.pu...@gmail.com>
wrote:

> Hello All,
>
> Is it possible to perform classification using linear models such
> as ElasticNet?
>
> I tried the following -
>
>
>
> from sklearn.linear_model import ElasticNet
>
> iris = datasets.load_iris()
>
> X= iris.data
>
> y= iris.target
>
>
> clf= ElasticNet()
>
> clf.fit(X,y).predict(X[0])
>
>
> Which gives output value in decimal points.
>
> Any suggestion or link to an example will be very helpful.
>
>
>
> Thanks
>
> --
>
> Sheila
>
>
>
>
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> Scikit-learn-general mailing list
> Scikit-learn-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
>


-- 
Regards,
Manoj Kumar,
GSoC 2014, Scikit-learn
Mech Undergrad
http://manojbits.wordpress.com
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to