Menu
CoddyTech

Recap: Wine Dataset

Part of the Data and Plots section of Coddy's Machine Learning journey. Lesson 56 of 60.

challenge icon

Challenge

Medium

A lab measured 13 chemical features of wines from three grape cultivars. scikit-learn ships them as load_wine:

178 wines by alcohol and proline, one color per cultivar: class_0 sits high and to the right, class_1 low and to the left, class_2 low in the middle

Before training a model, the lab wants three facts. The program reads a feature name, like hue. Load the wines with as_frame=True, split them into X and y, then print:

  1. The class with the most wines, and how many.
  2. The class with the highest mean of the feature.
  3. How many wines of that class are above the feature's mean over all wines.

For the input malic_acid:

Most wines: class_1 (71)
Highest malic_acid: class_2
class_2 wines above the average malic_acid: 41

Try it yourself

from sklearn.datasets import load_wine

feature = input()

# Write your code below

All lessons in Data and Plots

Practice on your own: Online Python compiler