Skip to content

Instantly share code, notes, and snippets.

@pycaret
Last active June 29, 2020 04:37
Show Gist options
  • Save pycaret/ab3838d63c2c6482a43ceecef38a718f to your computer and use it in GitHub Desktop.
Save pycaret/ab3838d63c2c6482a43ceecef38a718f to your computer and use it in GitHub Desktop.
# Import dataset from pycaret repository
from pycaret.datasets import get_data
insurance = get_data('insurance')
# Initialize environment
from pycaret.regression import *
r1 = setup(insurance, target = 'charges', session_id = 123,
normalize = True,
polynomial_features = True, trigonometry_features = True,
feature_interaction=True,
bin_numeric_features= ['age', 'bmi'])
# Train a linear regression model
lr = create_model('lr')
# save transformation pipeline and model
save_model(lr, model_name = 'c:/username/pycaret-deployment-azure/deployment_28042020')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment