When running linear_model.Lars I get the following error. C:\Python27\lib\site-packages\sklearn\linear_model\least_angle.py:237: RuntimeWa rning: invalid value encountered in divide z = -coefs[n_iter, active] / least_squares
The script still runs, and I get coefficents and an intercept. Also, asking it to normalise the coefficents doesn't seem to work. The following: clf = linear_model.Lars(normalize=True) Returns an intercept which is NOT 0. It's my understanding that if the independent variables/x-values are normalised, the intercept should be 0. Right? Zach On 29/07/2012 04:09, Alexandre Gramfort wrote: > you can also look at > > http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Lars.html#sklearn.linear_model.Lars > > which, as stepwise regression, cannot discard features as soon as they > are selected. > > Alex > > On Sun, Jul 29, 2012 at 12:32 AM, Olivier Grisel > <[email protected]> wrote: >> 2012/7/28 Zach Bastick <[email protected]>: >>> The docs do not indicate whether there is anyway to do a stepwise >>> regression in scikit-learn or in Python. >>> All there seems to be is linear_model.LinearRegression(). >>> >>> This function outputs resulting x-values/beta-values/coefficents that >>> are not significant. In statistical data packages, like SPSS, >>> non-significant beta-values are automatically eliminated from the >>> regression equation... not here. >>> >>> Am I missing something? How does one do a step-wise regression, so that >>> insignificant coefficents are not added to the equation? >> LinearRegression does not do any feature selection by default but you >> can do univariate feature selection upstream and then do >> LinearRegression only on the informative features or alternatively use >> a L1 penalized regression (e.g. Lasso or LassoLARS). >> >> http://scikit-learn.org/dev/modules/feature_selection.html >> >> -- >> Olivier >> http://twitter.com/ogrisel - http://github.com/ogrisel >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Scikit-learn-general mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Scikit-learn-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/scikit-learn-general ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Scikit-learn-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
