Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sklearn: Regression models on sparse data?

Does python's scikit-learn have any regression models that work well with sparse data?

I was poking around and found this "sparse linear regression" module, but it seems outdated. (It's so old that scikit-learn was called 'scikits-learn' at the time, I think.)

like image 644
hlin117 Avatar asked Apr 06 '15 06:04

hlin117


1 Answers

Most scikit-learn regression models (linear such as Ridge, Lasso, ElasticNet or non-linear, e.g. with RandomForestRegressor) support both dense and sparse input data recent versions of scikit-learn (0.16.0 is the latest stable version at the time of writing).

Edit: if you are unsure, check the docstring of the fit method of the class of interest.

like image 180
ogrisel Avatar answered Sep 28 '22 07:09

ogrisel