This should not be called directly but is called via :func:`hyperopt.fmin` Refer to :func:`hyperopt.fmin` for docs on each argument
(
self,
fn,
space,
algo,
max_evals,
timeout,
loss_threshold,
max_queue_len,
rstate,
verbose,
pass_expr_memo_ctrl,
catch_eval_exceptions,
return_argmin,
show_progressbar,
early_stop_fn,
trials_save_file="",
)
| 188 | raise NotImplementedError("SparkTrials does not support trial attachments.") |
| 189 | |
| 190 | def fmin( |
| 191 | self, |
| 192 | fn, |
| 193 | space, |
| 194 | algo, |
| 195 | max_evals, |
| 196 | timeout, |
| 197 | loss_threshold, |
| 198 | max_queue_len, |
| 199 | rstate, |
| 200 | verbose, |
| 201 | pass_expr_memo_ctrl, |
| 202 | catch_eval_exceptions, |
| 203 | return_argmin, |
| 204 | show_progressbar, |
| 205 | early_stop_fn, |
| 206 | trials_save_file="", |
| 207 | ): |
| 208 | """ |
| 209 | This should not be called directly but is called via :func:`hyperopt.fmin` |
| 210 | Refer to :func:`hyperopt.fmin` for docs on each argument |
| 211 | """ |
| 212 | |
| 213 | if timeout is not None: |
| 214 | if self.timeout is not None: |
| 215 | logger.warning( |
| 216 | "Timeout param was defined in Trials object, ignoring fmin definition" |
| 217 | ) |
| 218 | else: |
| 219 | validate_timeout(timeout) |
| 220 | self.timeout = timeout |
| 221 | |
| 222 | if loss_threshold is not None: |
| 223 | validate_loss_threshold(loss_threshold) |
| 224 | self.loss_threshold = loss_threshold |
| 225 | |
| 226 | assert ( |
| 227 | not pass_expr_memo_ctrl |
| 228 | ), "SparkTrials does not support `pass_expr_memo_ctrl`" |
| 229 | assert ( |
| 230 | not catch_eval_exceptions |
| 231 | ), "SparkTrials does not support `catch_eval_exceptions`" |
| 232 | |
| 233 | state = _SparkFMinState(self._spark, fn, space, self) |
| 234 | |
| 235 | # Will launch a dispatcher thread which runs each trial task as one spark job. |
| 236 | state.launch_dispatcher() |
| 237 | |
| 238 | try: |
| 239 | res = fmin( |
| 240 | fn, |
| 241 | space, |
| 242 | algo, |
| 243 | max_evals, |
| 244 | timeout=timeout, |
| 245 | loss_threshold=loss_threshold, |
| 246 | max_queue_len=max_queue_len, |
| 247 | trials=self, |
nothing calls this directly
no test coverage detected