Jacob, which file are you referring to? I cannot find the line you mentioned in the plot_sgd_ols file... It seems like an learning rate issue - I strongly recommend to standardizing your inputs first.
best, Peter 2012/5/22 Jacob VanderPlas <[email protected]>: > Hi, > I've been playing with the SGD classifier (using the current master > branch), and found that when there is a large range in x, the classifier > fails. For example, when running the example script found here: > http://scikit-learn.org/0.10/auto_examples/linear_model/plot_sgd_ols.html > If I replace the line: > xmin, xmax = -5, 5 > with: > xmin, xmax = 0, 100 > then the regression fails (full traceback copied below). If the range > is set to (0, 50), the call does not produce an error, but leads to a > line which clearly does not fit the data (intercept on order -2E30). > Any ideas about what is going on here? > Jake > > "/usr/local/lib/python2.6/dist-packages/scikit_learn-0.12_git-py2.6-linux-i686.egg/sklearn/linear_model/stochastic_gradient.py", > line 737, in fit > coef_init, intercept_init) > File > "/usr/local/lib/python2.6/dist-packages/scikit_learn-0.12_git-py2.6-linux-i686.egg/sklearn/linear_model/stochastic_gradient.py", > line 672, in _partial_fit > self._fit_regressor(X, y, sample_weight, n_iter) > File > "/usr/local/lib/python2.6/dist-packages/scikit_learn-0.12_git-py2.6-linux-i686.egg/sklearn/linear_model/stochastic_gradient.py", > line 786, in _fit_regressor > intercept_decay) > File "sgd_fast.pyx", line 423, in > sklearn.linear_model.sgd_fast.plain_sgd > (sklearn/linear_model/sgd_fast.c:6713) > ValueError: floating-point under-/overflow occured. > > > ------------------------------------------------------------------------------ > 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 -- Peter Prettenhofer ------------------------------------------------------------------------------ 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
