Questions tagged [hyperopt]

Hyperopt is a Python library for serial and parallel optimization over awkward search spaces, which may include real-valued, discrete, and conditional dimensions

Resources and Tutorials:

128 questions
14
votes
2 answers

How to use hyperopt for hyperparameter optimization of Keras deep learning network?

I want to build a non linear regression model using keras to predict a +ve continuous variable. For the below model how do I select the following hyperparameters? Number of Hidden layers and Neurons Dropout ratio Use BatchNormalization or…
GeorgeOfTheRF
  • 8,244
  • 23
  • 57
  • 80
13
votes
1 answer

passing supplementary parameters to hyperopt objective function

I am using Python's hyperopt library to perform ML hyperparameters' optimization. In particular I am trying to find lightgbm optimal hyperparameter using this function to minimize: def lgb_objective_map(params): """ objective function for lightgbm…
Giorgio Spedicato
  • 2,413
  • 3
  • 31
  • 45
10
votes
4 answers

How to save the best hyperopt optimized keras models and its weights?

I optimized my keras model using hyperopt. Now how do we save the best optimized keras model and its weights to disk. My code: from hyperopt import fmin, tpe, hp, STATUS_OK, Trials from sklearn.metrics import roc_auc_score import sys X = [] y =…
Eka
  • 14,170
  • 38
  • 128
  • 212
9
votes
1 answer

Best parameters solved by Hyperopt is unsuitable

I used hyperopt to search best parameters for SVM classifier, but Hyperopt says best 'kernel' is '0'. {'kernel': '0'} is obviously unsuitable. Does anyone know whether it's caused by my fault or a bag of hyperopt ? Code is below. from hyperopt…
7
votes
1 answer

qloguniform search space setting issue in Hyperopt

I am working on using hyperopt to tune my ML model but having troubles in using the qloguniform as the search space. I am giving the example from official wiki and changed the search space. import pickle import time #utf8 import pandas as…
Venkatachalam
  • 16,288
  • 9
  • 49
  • 77
7
votes
1 answer

Problems setting up conditional search space in hyperopt

I'll fully admit that I may be setting up the conditional space wrong here but for some reason, I just can't get this to function at all. I am attempting to use hyperopt to tune a logistic regression model and depending on the solver there are some…
6
votes
1 answer

What are some reasons Bayesian Optimization might not work for a CNN

I tried to apply Bayesian Optimisation to a simple CNN for the MNIST handwritten digits dataset and I'm getting little indication that it works. I've tried doing k-fold validation to smooth out noise but still doesn't seem like the optimisation is…
Alexander Soare
  • 2,825
  • 3
  • 25
  • 53
5
votes
1 answer

Hyperopt spark 3.0 issues

I am running runtime 8.1 (includes Apache Spark 3.1.1, Scala 2.12) trying to get hyperopt working as defined…
Brian
  • 848
  • 10
  • 32
5
votes
4 answers

Hyperopt list of values per hyperparameter

I'm trying to use Hyperopt on a regression model such that one of its hyperparameters is defined per variable and needs to be passed as a list. For example, if I have a regression with 3 independent variables (excluding constant), I would pass…
5
votes
1 answer

Understading hyperopt's TPE algorithm

I am illustrating hyperopt's TPE algorithm for my master project and cant seem to get the algorithm to converge. From what i understand from the original paper and youtube lecture the TPE algorithm works in the following steps: (in the following,…
Søren Jensen
  • 153
  • 1
  • 12
5
votes
3 answers

contents of Trials() object in hyperopt

This query is referring to usage of trials as an argument in fmin. trials = Trials() best = fmin(objective, space=hp.uniform('x', -10, 10), algo=tpe.suggest, max_evals=100, trials=trials) The documentation…
Regi Mathew
  • 2,603
  • 3
  • 24
  • 38
5
votes
1 answer

Hyperopt: Optimal parameter changing with rerun

I am trying to use Bayesian optimization (Hyperopt) for obtaining optimal parameters for SVM algorithm. However, I find that the optimal parameters are changing with every run. Provided below is a simple reproducible case. Can you please throw some…
Regi Mathew
  • 2,603
  • 3
  • 24
  • 38
5
votes
2 answers

Hyperopt: Define parameter which is dependent on other parameter

I am using python package hyperopt and I have a parameter a which requires to be larger than parameter b. For example, I hope my parameter space is like from hyperopt import hp space = {"b": hp.uniform(0, 0.5), "a": hp.uniform(b, 0.5)} Which,…
MJeremy
  • 1,102
  • 17
  • 27
4
votes
1 answer

Different result metric from evaluation and prediction with hyperopt

This is my first experience with tuning XGBoost's hyperparameter. My plan is finding the optimal hyperparameter by using hyperopt. def obj (params): xgb_model=xgb.XGBRegressor( n_estimator=params['n_estimator'], …
4
votes
1 answer

Can we save the result of the Hyperopt Trials with Sparktrials

I am currently trying to optimize the hyperparameters of a gradient boosting method with the library hyperopt. When I was working on my own computer, I used the class Trials and I was able to save and reload my results with the library pickles. This…
RO-ito
  • 111
  • 5
1
2 3
8 9