STATUS_OK

27 views
Skip to first unread message

Ray Bell

unread,
Oct 11, 2019, 9:30:23 PM10/11/19
to hyperopt-discuss
Hi,

Could someone please tell me what STATUS_OK does? as in:

def score(params):
    model = XGBRegressor(**params)
    
    model.fit(X_train, Y_train, eval_set=[(X_train, Y_train), (X_valid, Y_valid)],
              verbose=False, early_stopping_rounds=10)
    Y_pred = model.predict(X_valid).clip(0, 20)
    score = sqrt(mean_squared_error(Y_valid, Y_pred))
    print(score)
    return {'loss': score, 'status': STATUS_OK}

Ray Bell

unread,
Oct 11, 2019, 9:31:12 PM10/11/19
to hyperopt-discuss
For reference i'm writing a blog and trying to understand hyperopt in doing so

Brent Komer

unread,
Oct 12, 2019, 3:40:09 PM10/12/19
to Ray Bell, hyperopt-discuss
Hi Ray,

The STATUS_OK is just a signal to the optimizer that a particular evaluation was a success. For example, if a particular combination of parameters causes the output to be undefined or if an exception is caught then a STATUS_FAIL could be supplied instead. For some optimizers it could be helpful to be able to distinguish a 'fail' from simply a bad score.
It looks like they are also used for colours in some plots: https://github.com/hyperopt/hyperopt/blob/master/hyperopt/plotting.py#L30

Cheers,
Brent

--
You received this message because you are subscribed to the Google Groups "hyperopt-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hyperopt-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hyperopt-discuss/81acef96-3427-44ef-8f81-f3b4fcbd7a9f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages