<jupyter_start><jupyter_text>Example 02: General Use of RegressionMetrics[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/slickml/slick-ml/blob/master/examples/metrics/example_02_RegressionMetrics.ipynb)  Google Colab Configuration<jupyter_code># !git clone https://github.com/slickml/slick-ml.git
# %cd slick-ml
# !pip install -r requirements.txt<jupyter_output><empty_output><jupyter_text>Local Environment Configuration<jupyter_code># Change path to project root
%cd ../..<jupyter_output>/home/amirhessam/Documents/GitHub/slick-ml<jupyter_text>Import Python Libraries<jupyter_code>%load_ext autoreload

# widen the screen
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:95% !important; }</style>"))

# change the path and loading class
import os, sys
import pandas as pd
import numpy as np
import seaborn as sns
%autoreload
from slickml.metrics import RegressionMetrics<jupyter_output><empty_output><jupyter_text>_____ RegressionMetrics Docstring<jupyter_code>help(RegressionMetrics)<jupyter_output>Help on class RegressionMetrics in module slickml.metrics:

class RegressionMetrics(builtins.object)
 |  RegressionMetrics(y_true, y_pred, multioutput=None, precision_digits=None, display_df=True)
 |  
 |  Regression Metrics.
 |  This is wrapper to calculate all the regression metrics.
 |  In case of multioutput regression, calculation methods can be chosen
 |  among ["raw_values", "uniform_average", "variance_weighted".
 |  
 |  Parameters
 |  ----------
 |  y_true: numpy.array[int] or list[float]
 |      List of ground truth target (response) values
 |  
 |  y_pred: numpy.array[float] or list[float]
 |      List of predicted target values list[float]
 |  
 |  multioutput: str, optional (default="uniform_average")
 |      Method to calculate the metric for multioutput targets. Possible values are
 |      ["raw_values", "uniform_average", "variance_weighted"].
 |      "raw_values" returns a full set of scores in case of multioutput input.
 |      "uniform_average" scores of all outputs[...]<jupyter_text>Example 1<jupyter_code>from sklearn import linear_model, datasets
from sklearn.model_selection import cross_val_predict
boston = datasets.load_boston()
X = boston.data
y_true = boston.target
model = linear_model.LinearRegression()
y_pred = cross_val_predict(model, X, y_true, cv=4)
example1 = RegressionMetrics(y_true, y_pred)
example1.plot()
example1.metrics_df_
example1.metrics_dict_<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10412573673870335, 'fraction_numerical': 0.004715127701375246, 'mean_word_length': 5.7, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '514955', 'license': 'MIT', 'n_tokens_mistral': 831, 'n_tokens_neox': 802, 'n_words': 195, 'path': 'examples/metrics/example_02_RegressionMetrics.ipynb', 'repo_name': 'Tsmith5151/slick-ml', 'size': '2545'}