MCPcopy Create free account
hub / github.com/modAL-python/modAL / __init__

Method __init__

modAL/models/learners.py:372–389  ·  view source on GitHub ↗
(self,
                 estimator: BaseEstimator,
                 query_strategy: Callable = max_EI,
                 X_training: Optional[modALinput] = None,
                 y_training: Optional[modALinput] = None,
                 bootstrap_init: bool = False,
                 on_transformed: bool = False,
                 **fit_kwargs)

Source from the content-addressed store, hash-verified

370 """
371
372 def __init__(self,
373 estimator: BaseEstimator,
374 query_strategy: Callable = max_EI,
375 X_training: Optional[modALinput] = None,
376 y_training: Optional[modALinput] = None,
377 bootstrap_init: bool = False,
378 on_transformed: bool = False,
379 **fit_kwargs) -> None:
380 super(BayesianOptimizer, self).__init__(estimator, query_strategy,
381 X_training, y_training, bootstrap_init, on_transformed, **fit_kwargs)
382 # setting the maximum value
383 if self.y_training is not None:
384 max_idx = np.argmax(self.y_training)
385 self.X_max = retrieve_rows(self.X_training, max_idx)
386 self.y_max = self.y_training[max_idx]
387 else:
388 self.X_max = None
389 self.y_max = -np.inf
390
391 def _set_max(self, X: modALinput, y: modALinput) -> None:
392 max_idx = np.argmax(y)

Callers

nothing calls this directly

Calls 2

retrieve_rowsFunction · 0.90
__init__Method · 0.45

Tested by

no test coverage detected