-
Notifications
You must be signed in to change notification settings - Fork 4
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
Best iteration is always 0 #133
Labels
documentation
Improvements or additions to documentation
Comments
and this is an example hyperactive app (modified slightly. from https://github.com/SimonBlanke/Hyperactive/blob/master/examples/optimization_applications/hyperpara_optimize.py ) """
This example shows the original purpose of Hyperactive.
You can search for any number of hyperparameters and Hyperactive
will return the best one after the optimization run.
"""
import numpy as np
from sklearn.model_selection import cross_val_score
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.datasets import load_wine
from hyperactive import Hyperactive
data = load_wine()
X, y = data.data, data.target
def model(opt):
gbr = GradientBoostingClassifier(
n_estimators=opt["n_estimators"],
max_depth=opt["max_depth"],
min_samples_split=opt["min_samples_split"],
min_samples_leaf=opt["min_samples_leaf"],
criterion=opt["criterion"],
)
scores = cross_val_score(gbr, X, y, cv=4)
return scores.mean()
search_space = {
"n_estimators": list(range(10, 150, 5)),
"max_depth": list(range(2, 12)),
"min_samples_split": list(range(2, 25)),
"min_samples_leaf": list(range(1, 25)),
"criterion": ["friedman_mse", "squared_error"],#, "absolute_error"],
"subsample": list(np.arange(0.1, 3, 0.1)),
}
if __name__ == '__main__':
hyper = Hyperactive()
hyper.add_search(model, search_space, n_iter=40)
hyper.run() and its result:
you can see "Best iteration: 0" in this case |
wkpark
added
documentation
Improvements or additions to documentation
and removed
bug
Something isn't working
labels
Mar 31, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've ran around 10 auto merges so far, and for some reason at the end I always end up with it saying "best iteration: 0"
Also the entire time seems to be spent on evaluation.
Thoughts?
The text was updated successfully, but these errors were encountered: