Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sspt #13

Open
wants to merge 57 commits into
base: main
Choose a base branch
from
Open

Sspt #13

Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
0c0f382
SSPT stub
Jul 5, 2022
822beda
Finish stub
Jul 6, 2022
d78c66b
checkpoint
Jul 6, 2022
0918524
add SSPTClassifier
Jul 6, 2022
110274f
checkpoint
Jul 7, 2022
1022b4a
sounds promising
Jul 7, 2022
4a151c3
add reference
Jul 7, 2022
1045042
1commit
BrunoMVeloso Jul 28, 2022
9ed652a
V0.1
BrunoMVeloso Aug 26, 2022
23c5c3c
V0.2
BrunoMVeloso Aug 30, 2022
9feded9
V0.2
BrunoMVeloso Aug 30, 2022
33b08ad
V0.3
BrunoMVeloso Aug 30, 2022
02b6684
v0.4
BrunoMVeloso Aug 30, 2022
0ccd382
V0.5
BrunoMVeloso Sep 6, 2022
a22a37d
Merge pull request #8 from BrunoMVeloso/sspt
Sep 6, 2022
d4b7d1f
simplify simplex init
Sep 6, 2022
ba2fdcc
misc improvements
Sep 6, 2022
81c6861
create one frankstein method
Sep 7, 2022
89ae606
fix bug in scaling
Sep 8, 2022
ec22181
Update README.md
MaxHalford Aug 24, 2022
ccfc25e
Update pyproject.toml
MaxHalford Aug 24, 2022
6c55a14
Update pyproject.toml
MaxHalford Aug 24, 2022
a7e63d5
Update pyproject.toml
MaxHalford Aug 24, 2022
aea5fc3
Update pyproject.toml
MaxHalford Aug 24, 2022
02f5cb2
fix river imports
MaxHalford Aug 24, 2022
dc65a4b
fix clustering imports
MaxHalford Aug 24, 2022
50cde88
Update pyproject.toml
MaxHalford Sep 2, 2022
76eb294
0.13.0
MaxHalford Sep 17, 2022
e93e840
add OXT
Sep 30, 2022
9721937
add reference
Nov 6, 2022
348d03e
add reference
Nov 6, 2022
ab6aa9f
bump version
Nov 6, 2022
723fd16
now for real
Nov 6, 2022
2232b2c
Housekeeping, simplify logic, and improve docs
Dec 22, 2022
daf6e06
v0.2
BrunoMVeloso Dec 30, 2022
0ed4481
v1.0
BrunoMVeloso Feb 24, 2023
1198876
v1.01
BrunoMVeloso Feb 24, 2023
42bda78
v1.02
BrunoMVeloso Feb 24, 2023
0efde7d
v1.02
BrunoMVeloso Feb 24, 2023
367dbe7
v1.03
BrunoMVeloso Feb 24, 2023
b5583e9
Merge branch 'sspt' of https://github.com/BrunoMVeloso/river-extra in…
BrunoMVeloso Feb 24, 2023
dc00f50
Merge branch 'sspt' of https://github.com/BrunoMVeloso/river-extra in…
BrunoMVeloso Feb 24, 2023
0e92da1
v1.04
BrunoMVeloso Feb 24, 2023
e8f8c49
Merge branch 'sspt' of https://github.com/BrunoMVeloso/river-extra in…
BrunoMVeloso Feb 24, 2023
a108035
v1.1
BrunoMVeloso Feb 24, 2023
0ffa161
Update .gitignore
BrunoMVeloso Feb 24, 2023
408336f
Merge branch 'sspt' of https://github.com/BrunoMVeloso/river-extra in…
BrunoMVeloso Feb 24, 2023
aebc8e9
V1.2
BrunoMVeloso May 11, 2023
4d210f5
V1.2.1
BrunoMVeloso May 11, 2023
f39fc59
Merge remote-tracking branch 'origin/sspt' into sspt
BrunoMVeloso May 12, 2023
427005c
V1.2.2
BrunoMVeloso Nov 8, 2023
bc5cb4b
V1.2.2
BrunoMVeloso Nov 8, 2023
031fc09
V1.2.2
BrunoMVeloso Nov 8, 2023
e3459ac
V1.2.2
BrunoMVeloso Nov 8, 2023
6e34381
Merge remote-tracking branch 'origin/sspt' into sspt
BrunoMVeloso Nov 8, 2023
d8cdf73
V1.2.3
BrunoMVeloso Nov 8, 2023
53e2b52
V2
BrunoMVeloso Apr 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
v0.2
testing
BrunoMVeloso committed Dec 30, 2022
commit daf6e06f1f7a15a9e9f5d197282e36158baf2b70
Binary file added .DS_Store
Binary file not shown.
Binary file added river_extra/.DS_Store
Binary file not shown.
7 changes: 5 additions & 2 deletions river_extra/model_selection/classification_test.py
Original file line number Diff line number Diff line change
@@ -31,8 +31,11 @@
metric=sspt_rolling_metric,
grace_period=100,
params_range={
"delta": (float, (0.00001, 0.0001)),
"grace_period": (int, (100, 500)),
"AdaptiveStandardScaler": {"alpha": (float, (0.25, 0.35))},
"HoeffdingTreeClassifier": {
"delta": (float, (0.00001, 0.0001)),
"grace_period": (int, (100, 500)),
},
},
drift_input=lambda yt, yp: 0 if yt == yp else 1,
convergence_sphere=0.000001,
13 changes: 6 additions & 7 deletions river_extra/model_selection/regression_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import matplotlib.pyplot as plt
from river import datasets, drift, linear_model, metrics, preprocessing, utils
from river import datasets, drift, linear_model, metrics, preprocessing, utils, rules

from river_extra import model_selection

@@ -14,23 +14,22 @@
baseline_rolling_metric = utils.Rolling(metrics.RMSE(), window_size=100)
baseline_metric_plt = []
baseline_rolling_metric_plt = []
baseline = preprocessing.AdaptiveStandardScaler() | linear_model.LinearRegression()
baseline = preprocessing.AdaptiveStandardScaler() | rules.AMRules()

# SSPT - model and metric
sspt_metric = metrics.RMSE()
sspt_rolling_metric = utils.Rolling(metrics.RMSE(), window_size=100)
sspt_metric_plt = []
sspt_rolling_metric_plt = []
sspt = model_selection.SSPT(
estimator=preprocessing.AdaptiveStandardScaler() | linear_model.LinearRegression(),
estimator=preprocessing.AdaptiveStandardScaler() | rules.AMRules(),
metric=metrics.RMSE(),
grace_period=100,
params_range={
"AdaptiveStandardScaler": {"alpha": (float, (0.25, 0.35))},
"LinearRegression": {
"l2": (float, (0.0, 0.0001)),
"optimizer": {"lr": {"learning_rate": (float, (0.009, 0.011))}},
"intercept_lr": {"learning_rate": (float, (0.009, 0.011))},
"AMRules": {
"delta": (float, (0.005, 0.02)),
"n_min": (int, (50, 500))
},
},
drift_input=lambda yt, yp: abs(yt - yp),
35 changes: 35 additions & 0 deletions river_extra/model_selection/teste.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from scipy.stats import qmc

sampler = qmc.LatinHypercube(d=4)

sample = sampler.random(n=5)

print(sample)

import numpy as np
import matplotlib.pyplot as plt

from smt.sampling_methods import LHS

xlimits = np.array([[0.0, 100.0], [0.0, 1.0], [20.0, 30.0]])
sampling = LHS(xlimits=xlimits)

num = 50
x = sampling(num)

print(x.shape)
plt.plot(x[:, 0], x[:, 1], "o")
plt.xlabel("x")
plt.ylabel("y")
plt.show()
fig = plt.figure()
ax = fig.add_subplot(projection='3d')
for val in x:
print(val)
ax.scatter(val[0], val[1], val[2], marker='o')

ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')

plt.show()