hi ariel, have you standardized your data?
did you try with Ridge? Alex On Fri, May 25, 2012 at 7:26 PM, Ariel Rokem <[email protected]> wrote: > Hi everyone, > > I am trying to use the SGDRegressor to solve for a sparse set of > linear equations. I am getting an under/over-flow error (see below). > > Running master from github from this morning on Fedora 14. > > Any ideas? > > Thanks! > > Ariel > > In [30]: X > Out[30]: > <533100x18788 sparse matrix of type '<type 'numpy.float64'>' > with 52124700 stored elements in Compressed Sparse Column format> > > In [31]: y > Out[31]: array([ 4.1 , 42.1 , 14.1 , ..., 11.82, -11.18, 25.82]) > > In [32]: y.shape > Out[32]: (533100,) > > In [33]: from sklearn.linear_model import SGDRegressor as SGD > > In [34]: S1 = SGD() > > In [35]: S1.fit(X,y) > --------------------------------------------------------------------------- > ValueError Traceback (most recent call last) > /white/u6/arokem/<ipython-input-35-1ebf5d8bf9f4> in <module>() > ----> 1 S1.fit(X,y) > > /home/arokem/usr/local/lib64/python2.7/site-packages/scikit_learn-0.11_git-py2.7-linux-x86_64.egg/sklearn/linear_model/stochastic_gradient.pyc > in fit(self, X, y, coef_init, intercept_init, sample_weight) > 705 > 706 return self._partial_fit(X, y, self.n_iter, sample_weight, > --> 707 coef_init, intercept_init) > 708 > 709 def decision_function(self, X): > > /home/arokem/usr/local/lib64/python2.7/site-packages/scikit_learn-0.11_git-py2.7-linux-x86_64.egg/sklearn/linear_model/stochastic_gradient.pyc > in _partial_fit(self, X, y, n_iter, sample_weight, coef_init, > intercept_init) > 640 coef_init, intercept_init) > 641 > --> 642 self._fit_regressor(X, y, sample_weight, n_iter) > 643 > 644 self.t_ += n_iter * n_samples > > /home/arokem/usr/local/lib64/python2.7/site-packages/scikit_learn-0.11_git-py2.7-linux-x86_64.egg/sklearn/linear_model/stochastic_gradient.pyc > in _fit_regressor(self, X, y, sample_weight, n_iter) > 754 self.learning_rate_code, > 755 self.eta0, > self.power_t, self.t_, > --> 756 intercept_decay) > 757 > 758 self.intercept_ = np.atleast_1d(intercept) > > /home/arokem/usr/local/lib64/python2.7/site-packages/scikit_learn-0.11_git-py2.7-linux-x86_64.egg/sklearn/linear_model/sgd_fast.so > in sklearn.linear_model.sgd_fast.plain_sgd > (sklearn/linear_model/sgd_fast.c:6164)() > > 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 ------------------------------------------------------------------------------ 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
