Results analysis

Visualization of results helps us understand and interpret the models’ performance. We can use Python resources, such as the seaborn and Matplotlib libraries, for this purpose. Scatterplots are good for visualizing relationships and checking for patterns. We can use them to see how our models predict the outcome based on a single variable of the data. Additionally, we’ll create a best-fit line on each scatterplot, with the x-axis representing the actual tip amount and the y-axis representing the predicted amounts.

We’ll analyze the results by generating scatterplots that utilize two variables from the tips dataset: the time variable and the sex variable. Additionally, we’ll produce a histogram to directly compare predictions with the actual data.

Remember: When we execute any of the code below again, we might have different results because the models will be trained again from scratch.

Based on the time variable

Because this column only had Lunch or Dinner as options, we’ll see how the predicted values align with the original values for each option.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy