Ohjeah / sparsereg

a collection of modern sparse (regularized) linear regression algorithms.
MIT License
61 stars 21 forks source link

sindy modifications #15

Closed TarenGorman closed 6 years ago

TarenGorman commented 6 years ago

Some small functionality edits for wrapper class:

Ohjeah commented 6 years ago

Not a huge fan of n_features. Maybe we should streamline SymbolicFeatures with PolynomialFeatures and provide n_output_features_ instead of n_features and than use this in the SINDy class.

TarenGorman commented 6 years ago

Okay yeah I think that's a good idea. So, replacing in symfeat.py:

121 # 1) Get all simple features
122 simple = (SimpleFeature(e, index=i) for e, i in product(self.exponents, range(self.n_features)))

With a PolynomialFeatures call and removing all the SimpleFeature implementation essentially?

Ohjeah commented 6 years ago

I was looking at https://github.com/Ohjeah/sparsereg/blob/master/sparsereg/preprocessing/symfeat.py#L120

which should be n_inputfeatures similar to https://github.com/scikit-learn/scikit-learn/blob/a24c8b46/sklearn/preprocessing/data.py#L1313-L1314

TarenGorman commented 6 years ago

Okay got it, I updated the pull request with PolynomialFeatures styling for the SymbolicFeatures and SINDy classes.

Ohjeah commented 6 years ago

Perfect, thanks!