def cv_run_workflow(self): """Execute workflow for individual run, consisting of the following tasks: 1) Execute overridden :meth:`on_run_start` tasks, 2) Initialize and fit Model, 3) Execute overridden :meth:`on_run_end` tasks""" self.on_run_start() self.model = model_selector(self.model_initializer)( self.model_initializer, self.model_init_params, self.model_extra_params, train_input=self.fold_train_input, train_target=self.fold_train_target, validation_input=self.fold_validation_input, validation_target=self.fold_validation_target, do_predict_proba=self.do_predict_proba, target_metric=self.target_metric, metrics_map=self.metrics_map, ) self.model.fit() self.on_run_end()
def cv_run_workflow(self): """Execute run workflow, consisting of: 1) Execute overridden :meth:`on_run_start` tasks, 2) Initialize and fit Model, 3) Execute overridden :meth:`on_run_end` tasks""" self.on_run_start() self.model = model_selector(self.model_initializer)( self.model_initializer, self.model_init_params, self.model_extra_params, train_input=self.data_train.input.T.fold, train_target=self.data_train.target.T.fold, validation_input=self.data_oof.input.T.fold, validation_target=self.data_oof.target.T.fold, do_predict_proba=self.do_predict_proba, target_metric=self.target_metric, metrics=self.metrics, ) self.model.fit() self.on_run_end()
def test_model_selector(initializer, model_cls): assert model_selector(initializer) == model_cls