Wine#

Results of a chemical analysis of wines grown in the same region of Italy but derived from three different cultivars. The analysis measured 13 constituents in each wine. The classes are well separated, which makes it a good dataset for a first test of a new classifier.

Overview#

Loader

load_wine()

Task

Classification

Samples

178

Features

13

Targets

3 classes: class_0 (0), class_1 (1), class_2 (2)

Missing values

None

License

CC BY 4.0

Features#

13 chemical measurements such as alcohol, malic_acid, ash and proline. The features have very different scales, so the dataset is a good place to try feature scaling.

Target#

y holds the cultivar as an integer label 0, 1 or 2. The UCI file numbers the cultivars 1 to 3, the labels here are shifted by one. The classes have 59, 71 and 48 samples.

Source and citation#

Please cite the dataset as:

Aeberhard, S. & Forina, M. (1992). Wine [Dataset]. UCI Machine Learning Repository. https://doi.org/10.24432/C5PC7J

See also:

  • Forina, M. et al. PARVUS: an extendable package of programs for data exploration, classification and correlation. Institute of Pharmaceutical and Food Analysis and Technologies, Genoa, Italy.

License#

CC BY 4.0, as stated by the source. The license was checked at the source on 2026-10-17. See License and citation.

Changes made#

  • Converted to the NumPy NPZ format. Values are stored as float64 and the cultivar as int64 labels.

  • The cultivar labels are 0, 1 and 2 (the UCI file numbers them 1, 2 and 3).

  • Feature and class names follow scikit-learn.

Example#

>>> import numpy as np
>>> from pyml_datasets import load_wine
>>> data = load_wine()
>>> data.X.shape
(178, 13)
>>> np.bincount(data.y)
array([59, 71, 48])