<jupyter_start><jupyter_text>Calculate RMSE & MAPE<jupyter_code>from sklearn.metrics import mean_squared_error
from math import sqrt

y_actual = [0,1,2,1,0]
y_predicted = [0.03,1.2,1.6,.9,0.1]
rms = sqrt(mean_squared_error(y_actual, y_predicted))
print('Root Mean Squared Error (RMSE) is:', rms)
from sklearn.metrics import mean_absolute_error

y_actual = [0,1,2,1,0]
y_predicted = [0.03,1.2,1.6,.9,0.1]
mape = mean_absolute_error(y_actual, y_predicted) * 100
print('Mean Absolute Percentage Error (MAPE) is:', round(mape,2), '%')<jupyter_output>Mean Absolute Percentage Error (MAPE) is: 16.6 %
{'fraction_non_alphanumeric': 0.14814814814814814, 'fraction_numerical': 0.06228956228956229, 'mean_word_length': 7.04054054054054, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '76312', 'license': 'MIT', 'n_tokens_mistral': 271, 'n_tokens_neox': 246, 'n_words': 50, 'path': 'Lesson3/Exercise37.ipynb', 'repo_name': 'TrainingByPackt/Introduction-to-Natural-Language-Processing', 'size': '594'}