-
Notifications
You must be signed in to change notification settings - Fork 41
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
information displayed in the optimization process #29
Comments
Hello @vanquanTRAN, could you describe your problem in more detail? Do you want to print this information in each iteration? The more information you give about your problem and what you want to do, the better I can help you. |
Hello @vanquanTRAN, thank you for going into so much detail! I am currently working on a new feature that should solve this problem. |
Hello @vanquanTRAN, I looked into a solution for your problem. I had to do some small additions to the optimization backend, so you should update it via: After the update you can run the example code below: from sklearn.datasets import load_boston
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.model_selection import cross_val_score
from hyperactive import Hyperactive
data = load_boston()
X, y = data.data, data.target
def model(para):
gbr = GradientBoostingRegressor(
n_estimators=para["n_estimators"],
max_depth=para["max_depth"],
min_samples_split=para["min_samples_split"],
)
scores = cross_val_score(gbr, X, y, cv=3)
print(
"Iteration:", para.optimizer.nth_iter, " Best score", para.optimizer.best_score
)
return scores.mean()
search_space = {
"n_estimators": list(range(10, 150, 5)),
"max_depth": list(range(2, 12)),
"min_samples_split": list(range(2, 22)),
}
hyper = Hyperactive()
hyper.add_search(model, search_space, n_iter=20)
hyper.run() Please let me know if this solution works for you. |
Thank you Simon, your solution is well done for me now, your work will be cited in my paper if it is published |
Very good @vanquanTRAN! I would appreciate a citation in your paper. I will leave this issue open for now, because I have an additional new feature, that will be released within the next week. |
Since v3.2.0 a streamlit-based dashboard for the visualization of the search data (automatically) collected during the optimization run has been added: Example |
Thank you for your code sharing and your extraordinary development. I try to modify your code to show each iteration versus best score, that help us to show a graph n_iter vs best score.
print('Iteration {}: Best Cost = {}'.format(best_iter, best_score=)).
But i cant not succeed,
Could you help me to handle this issue ? Thank you for your help.
The text was updated successfully, but these errors were encountered: