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 all 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
6 changes: 6 additions & 0 deletions docs/releases/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@
## tree

- Instead of letting trees grow indefinitely, setting the `max_depth` parameter to `None` will stop the trees from growing when they reach the system recursion limit.

-Added `tree.LASTClassifier` (Local Adaptive Streaming Tree Classifier).

## stream

- `stream.iter_arff` now supports blank values (treated as missing values).
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",
]
Loading
Loading