cf_engine ======================================== .. py:module:: evalml.automl.engine.cf_engine .. autoapi-nested-parse:: Custom CFClient API to match Dask's CFClient and allow context management. Module Contents --------------- Classes Summary ~~~~~~~~~~~~~~~ .. autoapisummary:: evalml.automl.engine.cf_engine.CFClient evalml.automl.engine.cf_engine.CFComputation evalml.automl.engine.cf_engine.CFEngine Contents ~~~~~~~~~~~~~~~~~~~ .. py:class:: CFClient(pool) Custom CFClient API to match Dask's CFClient and allow context management. :param pool: The resource pool to execute the futures work on. :type pool: cf.ThreadPoolExecutor or cf.ProcessPoolExecutor **Methods** .. autoapisummary:: :nosignatures: evalml.automl.engine.cf_engine.CFClient.close evalml.automl.engine.cf_engine.CFClient.is_closed evalml.automl.engine.cf_engine.CFClient.submit .. py:method:: close(self) Closes the underlying Executor. .. py:method:: is_closed(self) :property: Property that determines whether the Engine's Client's resources are closed. .. py:method:: submit(self, *args, **kwargs) Pass through to imitate Dask's Client API. .. py:class:: CFComputation(future) A Future-like wrapper around jobs created by the CFEngine. :param future: The concurrent.futures.Future that is desired to be executed. :type future: cf.Future **Methods** .. autoapisummary:: :nosignatures: evalml.automl.engine.cf_engine.CFComputation.cancel evalml.automl.engine.cf_engine.CFComputation.done evalml.automl.engine.cf_engine.CFComputation.get_result evalml.automl.engine.cf_engine.CFComputation.is_cancelled .. py:method:: cancel(self) Cancel the current computation. :returns: False if the call is currently being executed or finished running and cannot be cancelled. True if the call can be canceled. :rtype: bool .. py:method:: done(self) Returns whether the computation is done. .. py:method:: get_result(self) Gets the computation result. Will block until the computation is finished. :raises Exception: If computation fails. Returns traceback. :raises cf.TimeoutError: If computation takes longer than default timeout time. :raises cf.CancelledError: If computation was canceled before completing. :returns: The result of the requested job. .. py:method:: is_cancelled(self) :property: Returns whether computation was cancelled. .. py:class:: CFEngine(client=None) The concurrent.futures (CF) engine. :param client: If None, creates a threaded pool for processing. Defaults to None. :type client: None or CFClient **Methods** .. autoapisummary:: :nosignatures: evalml.automl.engine.cf_engine.CFEngine.close evalml.automl.engine.cf_engine.CFEngine.is_closed evalml.automl.engine.cf_engine.CFEngine.setup_job_log evalml.automl.engine.cf_engine.CFEngine.submit_evaluation_job evalml.automl.engine.cf_engine.CFEngine.submit_scoring_job evalml.automl.engine.cf_engine.CFEngine.submit_training_job .. py:method:: close(self) Function to properly shutdown the Engine's Client's resources. .. py:method:: is_closed(self) :property: Property that determines whether the Engine's Client's resources are shutdown. .. py:method:: setup_job_log() :staticmethod: Set up logger for job. .. py:method:: submit_evaluation_job(self, automl_config, pipeline, X, y, X_holdout=None, y_holdout=None) Send evaluation job to cluster. :param automl_config: Structure containing data passed from AutoMLSearch instance. :param pipeline: Pipeline to evaluate. :type pipeline: pipeline.PipelineBase :param X: Input data for modeling. :type X: pd.DataFrame :param y: Target data for modeling. :type y: pd.Series :param X_holdout: Holdout input data for holdout scoring. :type X_holdout: pd.Series :param y_holdout: Holdout target data for holdout scoring. :type y_holdout: pd.Series :returns: An object wrapping a reference to a future-like computation occurring in the resource pool :rtype: CFComputation .. py:method:: submit_scoring_job(self, automl_config, pipeline, X, y, objectives, X_train=None, y_train=None) Send scoring job to cluster. :param automl_config: Structure containing data passed from AutoMLSearch instance. :param pipeline: Pipeline to train. :type pipeline: pipeline.PipelineBase :param X: Input data for modeling. :type X: pd.DataFrame :param y: Target data for modeling. :type y: pd.Series :param X_train: Training features. Used for feature engineering in time series. :type X_train: pd.DataFrame :param y_train: Training target. Used for feature engineering in time series. :type y_train: pd.Series :param objectives: Objectives to score on. :type objectives: list[ObjectiveBase] :returns: An object wrapping a reference to a future-like computation occurring in the resource pool. :rtype: CFComputation .. py:method:: submit_training_job(self, automl_config, pipeline, X, y) Send training job to cluster. :param automl_config: Structure containing data passed from AutoMLSearch instance. :param pipeline: Pipeline to train. :type pipeline: pipeline.PipelineBase :param X: Input data for modeling. :type X: pd.DataFrame :param y: Target data for modeling. :type y: pd.Series :returns: An object wrapping a reference to a future-like computation occurring in the resource pool :rtype: CFComputation