raghav
raghav

Reputation: 533

Objective function for Optimization problem

I am dealing with an optimization problem where I have to optimize model parameters to minimize errors in the model predictions (y_pred) w.r.t. observations (y_obs). My objective is to minimize Root Mean Square Error (RMSE) and maximize the correlation coefficient (CORR). I came up with following objective function:

minimize(f) =  minimize(lambda*RMSE/CORR)
where lambda is some negative large value (e.g., -1e6) if CORR < 0
else lambda = 1

Did I define the objective function correctly or It can be defined in better way?

Upvotes: 0

Views: 161

Answers (1)

Cyril Bourgeois
Cyril Bourgeois

Reputation: 1

Try ^^

I think you need to search in minimize variable and put your equation inside the function or variable.

minimize = RMSE/CORR # if it's a variable
# for function need search ^^

study = optuna.create_study(directions["minimize"],...)

func = lambda trial: objective(trial, X_enc, y_train_full)
study.optimize(func, n_trials=10)

For more information, see this Optuna tutorial.

Upvotes: 0

Related Questions