Git Product home page Git Product logo

sparsereg's People

Contributors

ohjeah avatar tarengorman avatar thomasillo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sparsereg's Issues

Revisit all `score` methods

Make sure that all score methods of all models satisfy the sklearn convention for scores of "bigger is better".

ModuleNotFoundError: No module named 'sklearn.linear_model.base'

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?

docstrings

  • model
    • base
    • efs
    • ffx
    • sindy
  • utils
  • preprocessing

sindy model refactor

make sindy model a full sklearn pipeline:

  • transformer to get derivatives from data
  • variable sparse regression class
  • multioutput wrapper

ffx refactor

  • rational model wrapper
  • intercept_
  • strategy pruning
  • path_wise learning
  • timeout just use max_iter

sindy model features

Proposal of features for sindy class:

  • Symbolic features as default w/ params
  • Time-series data input option
  • Provide xdot for fit option

under what condition will the algorithm not converge?

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

tests

  • model
    • base
    • efs
    • ffx
    • sindy
  • utils
  • preprocessing

Fails on import

>>> 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?

sindy.py - example bug/User error

Expected Behavior

example\sindy.py to print score and equations.

Actual Behavior

TypeError: 'tuple' object does not support item assignment

Screenshot of traceback

http://imgur.com/a/s2Ph3

Steps to Reproduce the Problem

In ipython console

  1. runfile('../sparsereg-master/example/sindy.py', wdir='../sparsereg-master/example')

In powershell

  1. cd to '../sparsereg-master/example/
  2. python sindy.py

In cmd

  1. cd to '../sparsereg-master/example/
  2. python sindy.py

Specifications

  • Version: 0.6.3
  • Platform: Windows 10
  • Subsystem: ipython, powershell, and cmd

sindy modifications

Some small functionality edits for wrapper class:

  • score with param y
  • n_features in model
  • tests

Parameter mapping

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.