import pandas as pd
df = pd.read_csv('autos_titled_clean.csv')
df.head()
data = df.sample(frac=0.8, random_state=111)
data_unseen = df.drop(data.index)
data.reset_index(inplace=True, drop=True)
data_unseen.reset_index(inplace=True, drop=True)
print('Data for Modeling: ' + str(data.shape))
print('Unseen Data For Predictions: ' + str(data_unseen.shape))
from pycaret.regression import *
reg01 = setup(data=data, target='price')
best_model = compare_models()
model = create_model('ridge')
tuned = tune_model(model)
final = finalize_model(tuned)
print(final)
unseen_predictions = predict_model(final, data=data_unseen)
unseen_predictions.head()