You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that while the above environment fails, the following environment works. Implying there was a breaking change introduce in between Ray 2.5.1 and 2.7.1
The script is a minor variation of the example at https://github.com/ray-project/tune-sklearn/blob/master/examples/random_forest.py.
"""
An example training a RandomForestClassifier, performing
randomized search using TuneSearchCV.
"""
from tune_sklearn import TuneSearchCV
from sklearn.ensemble import RandomForestClassifier
from sklearn import datasets
from sklearn.model_selection import train_test_split
from scipy.stats import randint
import numpy as np
import os # I added this
digits = datasets.load_digits()
x = digits.data
y = digits.target
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=.2)
clf = RandomForestClassifier()
param_distributions = {
"n_estimators": randint(20, 80),
"max_depth": randint(2, 10)
}
tune_search = TuneSearchCV(
clf,
param_distributions,
n_trials=3,
# I added local_dir to prevent this error: https://github.com/ray-project/ray/issues/40349
local_dir = os.getcwd() + '/ray_examples/checkpoints',
verbose = True
)
tune_search.fit(x_train, y_train)
pred = tune_search.predict(x_test)
accuracy = np.count_nonzero(np.array(pred) == np.array(y_test)) / len(pred)
print(accuracy)```
### Issue Severity
Medium: It is a significant difficulty but I can work around it.
The text was updated successfully, but these errors were encountered:
TheDohn
added
bug
Something that is supposed to be working; but isn't
triage
Needs triage (eg: priority, bug/not-bug, and owning component)
labels
Oct 22, 2023
matthewdeng
added
P1
Issue that should be fixed within a few weeks
and removed
triage
Needs triage (eg: priority, bug/not-bug, and owning component)
labels
Oct 24, 2023
What happened + What you expected to happen
python random_forest.py
.DeprecationWarning:
fetch_trial_dataframesis deprecated. Access the
trial_dataframesproperty instead.
Versions / Dependencies
** ProductName: macOS
** ProductVersion: 13.6 (Ventura)
** BuildVersion: 22G120
The conda environment is defined by the following yaml (note that ray==2.7.1):
Note that while the above environment fails, the following environment works. Implying there was a breaking change introduce in between Ray 2.5.1 and 2.7.1
Reproduction script
The text was updated successfully, but these errors were encountered: