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

Adding Local Adaptive Streaming Tree #1610

Merged
merged 20 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
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
7 changes: 5 additions & 2 deletions river/stream/iter_arff.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def iter_arff(
x = {
name: cast(val) if cast else val
for name, cast, val in zip(names, casts, r.rstrip().split(","))
if val != "?"
if val != "?" and val != ""
smastelini marked this conversation as resolved.
Show resolved Hide resolved
}

# Handle target
Expand All @@ -185,7 +185,10 @@ def iter_arff(
if isinstance(target, list):
y = {name: x.pop(name, 0) for name in target}
else:
y = x.pop(target) if target else None
try:
y = x.pop(target) if target else None
except KeyError:
y = None

yield x, y

Expand Down
2 changes: 2 additions & 0 deletions river/tree/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
from .hoeffding_tree_classifier import HoeffdingTreeClassifier
from .hoeffding_tree_regressor import HoeffdingTreeRegressor
from .isoup_tree_regressor import iSOUPTreeRegressor
from .last_classifier import LASTClassifier
from .stochastic_gradient_tree import SGTClassifier, SGTRegressor

__all__ = [
Expand All @@ -70,6 +71,7 @@
"HoeffdingTreeRegressor",
"HoeffdingAdaptiveTreeRegressor",
"iSOUPTreeRegressor",
"LASTClassifier",
"SGTClassifier",
"SGTRegressor",
]
1 change: 1 addition & 0 deletions river/tree/hoeffding_adaptive_tree_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class HoeffdingAdaptiveTreeClassifier(HoeffdingTreeClassifier):
>>> metric = metrics.Accuracy()

>>> evaluate.progressive_val_score(dataset, model, metric)

Accuracy: 91.49%
smastelini marked this conversation as resolved.
Show resolved Hide resolved
smastelini marked this conversation as resolved.
Show resolved Hide resolved

"""
Expand Down
Loading
Loading