pycaret.classification.finalize_model#
- pycaret.classification.finalize_model(estimator, fit_kwargs: dict | None = None, groups: str | Any | None = None, model_only: bool = False, experiment_custom_tags: Dict[str, Any] | None = None) Any[source]#
This function trains a given estimator on the entire dataset including the holdout set.
Example
>>> from pycaret.datasets import get_data >>> juice = get_data('juice') >>> from pycaret.classification import * >>> exp_name = setup(data = juice, target = 'Purchase') >>> lr = create_model('lr') >>> final_lr = finalize_model(lr)
- estimator: scikit-learn compatible object
Trained model object
- fit_kwargs: dict, default = {} (empty dict)
Dictionary of arguments passed to the fit method of the model.
- groups: str or array-like, with shape (n_samples,), default = None
Optional group labels when GroupKFold is used for the cross validation. It takes an array with shape (n_samples, ) where n_samples is the number of rows in training dataset. When string is passed, it is interpreted as the column name in the dataset containing group labels.
- model_onlybool, default = False
Whether to return the complete fitted pipeline or only the fitted model.
- experiment_custom_tags: dict, default = None
Dictionary of tag_name: String -> value: (String, but will be string-ified if not) passed to the mlflow.set_tags to add new custom tags for the experiment.
- Returns:
Trained pipeline or model object fitted on complete dataset.