Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

Commit 39fbea4

Browse files
committed
fix submodule imports & examples
1 parent 79d0644 commit 39fbea4

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed
File renamed without changes.
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
from sklearn.model_selection import train_test_split
21
import numpy as np
32

4-
from sparsereg.model.ffx import run_ffx, FFX
5-
3+
from sparsereg.model.ffx import FFX
64

75
np.random.seed(42)
86
x = np.random.normal(size=(1000, 2))
@@ -11,4 +9,3 @@
119
model = FFX(n_jobs=-1)
1210
model.fit(x, y)
1311
print(model.print_model())
14-
print(model.predict(x).shape)

example/net.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
from sklearn.linear_model import Lasso
33
import matplotlib.pyplot as plt
44
import numpy as np
5-
import symfeat as sf
6-
from sparsereg.sindy import SINDy
5+
import sparsereg.preprocessing.symfeat as sf
6+
7+
from sparsereg.model import STRidge
8+
from sparsereg.util.net import net
79

8-
from sparsereg.net import net
910
data = load_boston()
1011
x, y = data.data, data.target
1112

@@ -16,9 +17,9 @@
1617
sym = sf.SymbolicFeatures(exponents=exponents, operators=operators)
1718
features = sym.fit_transform(x)
1819

19-
ests = [Lasso, SINDy]
20-
attrs = ["alpha", "knob"]
21-
names = ["Lasso", "SINDy"]
20+
ests = [Lasso, STRidge]
21+
attrs = ["alpha", "threshold"]
22+
names = ["Lasso", "STRidge"]
2223

2324

2425
for est, attr, name in zip(ests, attrs, names):
@@ -33,4 +34,4 @@
3334
plt.xlabel("# coefficient")
3435
plt.ylabel(r"$R^2$")
3536
plt.gca().invert_xaxis()
36-
plt.show()
37+
plt.show()

sparsereg/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from .model import *
2-
from .preprocessing import *
3-
from .util import *
1+
from sparsereg.model import *
2+
from sparsereg.preprocessing import *
3+
from sparsereg.util import *

sparsereg/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.6.1'
1+
__version__ = '0.6.2'

0 commit comments

Comments
 (0)