Python sckitlearn linear regression crashes on random iteration -


i random error (not @ same iteration) when running adapted version of sckitlearn plot_robust_fit.py. files needed reproduce can downloaded here.

just run reg.py , error.

traceback is:

traceback (most recent call last): file "/users/geoffroy/git/sfinder_2/reg/reg.py", line 118, in <module>   model.fit(x, acluster_y) file "/library/python/2.6/site-packages/sklearn/pipeline.py", line 141, in fit   self.steps[-1][-1].fit(xt, y, **fit_params) file "/library/python/2.6/site-packages/sklearn/linear_model/ransac.py", line 301, in fit   y_inlier_subset) file "/library/python/2.6/site-packages/sklearn/base.py", line 328, in score   return r2_score(y, self.predict(x), sample_weight=sample_weight) file "/library/python/2.6/site-packages/sklearn/linear_model/base.py", line 155, in predict   return self.decision_function(x) file "/library/python/2.6/site-packages/sklearn/linear_model/base.py", line 138, in decision_function   x = check_array(x, accept_sparse=['csr', 'csc', 'coo']) file "/library/python/2.6/site-packages/sklearn/utils/validation.py", line 360, in check_array   % (n_samples, shape_repr, ensure_min_samples)) valueerror: found array 0 sample(s) (shape=(0, 2)) while minimum of 1 required. 

note crashed samples work fine when ran separately. trying crashed samples works fine.

thanks lot :)

this problem comes theil-sen , ranscac estimators no inliers found. more user friendly error has been introduced in recent version of sckitlearn. see official github issue started.


Comments

Popular posts from this blog

How to show in django cms breadcrumbs full path? -

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -