I am trying to build a ML model using pycaret. I used the below setup function
clf = setup(data = df.loc[:, df.columns != 'ID'], target='final_label',session_id=123,
categorical_features=['Gender','Country'],
fold_strategy='stratifiedkfold',
fold=5, fold_shuffle=True, n_jobs=-1,
create_clusters=False,polynomial_features=False,
polynomial_degree=2, trigonometry_features=False, polynomial_threshold=0.1,
remove_multicollinearity=True, multicollinearity_threshold=0.90)
This initializes the process with list of variables from which I wish to extract transformed_train_set and transformed_test_set
I would like to export the train and test data before and after transformation but pycaret doesn't have any way to export this data?
When I try the code below:
train_data = predict_model(rft,data = X_train,raw_score=True)
train_data['phase'] = 'train'
test_data = predict_model(rft,data = X_test,raw_score=True)
test_data['phase'] = 'test'
it throws error:
NameError: name 'X_train' is not defined