No Output. Let's check the metric container again.
get_metrics()
automl
This function returns the best model out of all trained models in the current setup based on the optimize parameter. Metrics evaluated can be accessed using the get_metrics function.
Example
# load dataset
from pycaret.datasets import get_data
data = get_data('diabetes')
# init setup
from pycaret.classification import *
clf1 = setup(data, target = 'Class variable')
# compare models
top5 = compare_models(n_select = 5)
# tune models
tuned_top5 = [tune_model(i) for i in top5]
# ensemble models
bagged_top5 = [ensemble_model(i) for i in tuned_top5]
# blend models
blender = blend_models(estimator_list = top5)
# stack models
stacker = stack_models(estimator_list = top5)
# automl
best = automl(optimize = 'Recall')
print(best)
get_logs
Returns a table of experiment logs. Only works when log_experiment = True when initializing the setup function.
Obtain the current experiment object and return a class. This is useful when you are using a functional API and want to move to an OOP API.
# loading dataset
from pycaret.datasets import get_data
data = get_data('insurance')
# init setup using functional API
from pycaret.regression import *
s = setup(data, target = 'charges', session_id = 123)
# compare models
best = compare_models()
# return OOP class for current functional experiment
reg1 = get_current_experiment()
set_current_experiment
Set the current experiment created using the OOP API to be used with the functional API.
# loading dataset
from pycaret.datasets import get_data
data = get_data('insurance')
# init setup using OOP API
from pycaret.regression import RegressionExperiment
reg1 = RegressionExperiment()
reg1.setup(data, target = 'charges', session_id = 123)
# compare models
best = compare_models()
# set OOP experiment as functional
set_current_experiment(reg1)
Output from pull()
Output from models()
Output from models(internal = True)
Output from get_config('X_train')
Output from get_metrics()
Output from add_metric('logloss', 'Log Loss', log_loss, greater_is_better = False)
Output from get_metrics() (after adding log loss metric)
Output from get_metrics() (after removing log loss metric)