pc.create_model
pc.create_model(repository_name, dataset, config, engine=None, repo_description=None, model_description=None)
Create a model repo and train the first model given a configuration and a dataset.
Parameters:
repository_name: str
Name of the model repository to be created.
dataset: Dataset
Dataset to train the model on.
config: dict
Dictionary config used to train the model.
engine: Engine, default None
Engine to use for the training job.
- If no engine is specified, then the current session set engine is used.
repo_description: str, default None
Description for the repository being created.
model_description: str, default None
Description for the first model version being trained.
Returns:
Examples:
Create and train a model with a pandas dataframe using a specific engine.
import yaml
with open("~/{path to file}/titanic_config.yaml", 'r') as f:
try:
config=yaml.safe_load(f)
df = pd.read_csv('titanic.csv')
dataset = pc.create_dataset(df, 'Titanic Dataset')
engine = pc.get_engine('medium_cpu_engine', activate=True)
model = pc.create_model(
"Titanic Repo",
dataset, config,
engine=engine,
repo_description="Predicting Titanic Survivors",
model_description="Baseline Model"
)