edaflow.ml.save_model_artifacts

edaflow.ml.save_model_artifacts(model: Any, model_name: str, experiment_config: Dict[str, Any], performance_metrics: Dict[str, float], save_dir: str = 'model_artifacts', include_data_sample: bool = True, X_sample: DataFrame | None = None, format: str = 'joblib') Dict[str, str][source]

Save complete model artifacts including model, config, and metadata.

Parameters:

modelAny

The trained model to save

model_namestr

Name of the model for file naming

experiment_configDict[str, Any]

Configuration dictionary from setup_ml_experiment

performance_metricsDict[str, float]

Dictionary of performance metrics

save_dirstr, default=”model_artifacts”

Directory to save artifacts

include_data_samplebool, default=True

Whether to save a sample of training data

X_samplepd.DataFrame, optional

Sample data to save (if not provided, uses first 100 rows)

formatstr, default=’joblib’

Format to save model (β€˜joblib’ or β€˜pickle’)

Returns:

Dict[str, str]

Dictionary with paths to saved artifacts