Regression metrics 3 – How to Tell if Your Toaster is Learning – Machine Learning Essentials

All of this might sound complicated, but luckily, the scikit-learn package has a built-in method to do this, as shown: from sklearn.cross_validation import train_test_split# function that splits data into training and testing sets# setting our overall data X, and yfeature_cols = [‘temp’]X = bikes[feature_cols]y = bikes[‘count’]# Note that in this example, we are attempting to […]

Regression metrics 2 – How to Tell if Your Toaster is Learning – Machine Learning Essentials

Even better! At first, this seems like a major triumph, but there is actually a hidden danger here. Note that we are training the line to fit X and y and then asking it to predict X again! This is actually a huge mistake in ML because it can lead to overfitting, which means that […]

Regression metrics – How to Tell if Your Toaster is Learning – Machine Learning Essentials

Regression metrics There are usually three main metrics when using regression ML models. They are as follows: • Mean Absolute Error (MAE): This is the average of the absolute errors between the predicted values and the actual values. It’s calculated by taking the sum of the absolute values of the errors (the differences between the […]