Load and return the wine dataset (classification).
Added in version 0.18.
The wine dataset is a classic and very easy multi-class classification dataset.
The copy of UCI ML Wine Data Set dataset is downloaded and modified to fit standard format from: https://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data
Read more in the User Guide.
If True, returns (data, target)
instead of a Bunch object. See below for more information about the data
and target
object.
If True, the data is a pandas DataFrame including columns with appropriate dtypes (numeric). The target is a pandas DataFrame or Series depending on the number of target columns. If return_X_y
is True, then (data
, target
) will be pandas DataFrames or Series as described below.
Added in version 0.23.
Bunch
Dictionary-like object, with the following attributes.
The data matrix. If as_frame=True
, data
will be a pandas DataFrame.
The classification target. If as_frame=True
, target
will be a pandas Series.
The names of the dataset columns.
The names of target classes.
Only present when as_frame=True
. DataFrame with data
and target
.
Added in version 0.23.
The full description of the dataset.
return_X_y
is True
A tuple of two ndarrays by default. The first contains a 2D array of shape (178, 13) with each row representing one sample and each column representing the features. The second array of shape (178,) contains the target samples.
Examples
Let’s say you are interested in the samples 10, 80, and 140, and want to know their class name.
>>> from sklearn.datasets import load_wine >>> data = load_wine() >>> data.target[[10, 80, 140]] array([0, 1, 2]) >>> list(data.target_names) [np.str_('class_0'), np.str_('class_1'), np.str_('class_2')]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4