ohjeah / sparsereg Goto Github PK
View Code? Open in Web Editor NEWa collection of modern sparse (regularized) linear regression algorithms.
License: MIT License
a collection of modern sparse (regularized) linear regression algorithms.
License: MIT License
Make sure that all score
methods of all models satisfy the sklearn convention for scores of "bigger is better".
Hi, I downloaded and try to run the sindy file from Example folder.
I have the most updated python and sklearn.
But I got this error message showing up:
ModuleNotFoundError: No module named 'sklearn.linear_model.base'
Does anyone have the same issues? Or are there any ways to solve this?
for SimpleBase with same input feature ProductBase should never be built.
make sindy model a full sklearn pipeline:
Proposal of features for sindy class:
I am training a group lasso model with time series data, which means rho=0 in my model. In every month, I train the model with the data in the past 24 months. The parameter alpha is very stable, around 0.0005. However, in several months, when I move ahead by one month, which means that I replace the data of month t-24 with the data of the latest month, the model do not converge. In this case, I need a far more larger parameters, which is aroung 0.002 to make the model converge. I am wondering why this happens. Because I only replace a small portion(less than 5%) of the training data, but the parameters change sharply. This may cause instability of the model, as in the previous month, I may choose 30 features, however in the current month, I can only choose 16 features.
Traceback (most recent call last):
File "D:\Program Files\Python\Python36\lib\site-packages\IPython\core\interactiveshell.py", line 2963, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 4, in
model = model.fit(p, y)
File "D:\Program Files\Python\Python36\lib\site-packages\sparsereg\model\group_lasso.py", line 33, in fit
max_iter=self.max_iter, rtol=self.tol)
File "D:\Program Files\Python\Python36\lib\site-packages\sparsereg\vendor\group_lasso\group_lasso.py", line 92, in sparse_group_lasso
delta = linalg.norm(tmp - w_new[group])
File "D:\Program Files\Python\Python36\lib\site-packages\scipy\linalg\misc.py", line 137, in norm
a = np.asarray_chkfinite(a)
File "D:\Program Files\Python\Python36\lib\site-packages\numpy\lib\function_base.py", line 1233, in asarray_chkfinite
"array must not contain infs or NaNs")
ValueError: array must not contain infs or NaNs
>>> import sparsereg
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\sparsereg\__init__.py", line 1, in <module>
from sparsereg.model import *
ImportError: No module named model
>>>
This error occurs in Python 2.7.11 and Anaconda Python 3.6, both on Windows 10 64-bit. Any help resolving this one?
example\sindy.py to print score and equations.
TypeError: 'tuple' object does not support item assignment
Some small functionality edits for wrapper class:
Following conventions for the objective functions in the ElasticNet are used:
sklearn: of = 1/2N C + \alpha \mu P_1 + 0.5 \alpha (1-\mu) P_2
McConaughy: of = C + \lambda \rho P_1 + \lambda(1-\rho) P_2
here, C is the (squared) two norm of the residuals and P_1 and P_2 are the regularization term.
McConaughy probably also means a factor of 1/N in front of the C, otherwise the amount of regularization would scale with the number of features which doesn't make any sense.
Assuming this factor, the following formulae should be applied when mapping the regularization parameters from sparseregs interface to that of sklearn.
\alpha = \lambda ( 1-\rho/2)
\mu = \rho/(2-\rho)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.