autopredictor.show_all
Module Contents
Functions
|
This function converts the trained regression model scores stored in a dictionary by |
- autopredictor.show_all.show_all(result)[source]
This function converts the trained regression model scores stored in a dictionary by the “fit” function into a DataFrame, sorted alphabetically by model. It also outputs the DataFrame in a table format.
- Parameters:
result (dict) – A dictionary containing scoring metrics data for each regression model. The keys represent model names where the values represent the scoring results and should be numeric.
- Returns:
A DataFrame containing all scoring metrics results alongside the corresponding model, sorted alphabetically.
- Return type:
DataFrame
- Raises:
TypeError – If result is not a dictionary.
ValueError – If result dictionary is empty. If there is invalid scoring metrics in the result dictionary’s value. If the number of scoring metrics are not correct.
Examples
>>> from autopredictor.show_all import show_all >>> model_scores = { 'Linear Regression': {'Mean Absolute Error': 0.453, 'Mean Absolute Percentage Error': 0.346, 'R2 Score': 0.512, 'Mean Squared Error': 0.567, 'Root Mean Squared Error': 0.987}, 'Linear Regression (L1)': {'Mean Absolute Error': 61.2, 'Mean Absolute Percentage Error': 0.457, 'R2 Score': 0.239, 'Mean Squared Error': 0.873, 'Root Mean Squared Error': 72.4} } >>> test_scores = show_all(model_scores)