watex.datasets.load_bagoue#
- watex.datasets.load_bagoue(*, return_X_y=False, as_frame=False, split_X_y=False, test_size=0.3, tag=None, data_names=None, **kws)[source]#
Load the Bagoue dataset.
The Bagoue dataset is a classic and a multi-class classification dataset. Refer to the description for more details.
- Parameters
return_X_y (bool, default=False) – If True, returns
(data, target)instead of aBoxspaceobject. See below for more information about the data and target object. .. versionadded:: 0.1.2as_frame (bool, default=False) – 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. .. versionadded:: 0.1.1
split_X_y (bool, default=False,) – If True, the data is splitted to hold the training set (X, y) and the testing set (Xt, yt) with the according to the test size ratio.
test_size (float, default is {{.3}} i.e. 30% (X, y)) – The ratio to split the data into training (X, y) and testing (Xt, yt) set respectively.
tag (None) – tag and data_names do nothing. just for API purpose. They allow to fetch the same data uing the func:~watex.datasets.fetch_data since the latter already holds tag and data_names as parameters.
data_names (None) – tag and data_names do nothing. just for API purpose. They allow to fetch the same data uing the func:~watex.datasets.fetch_data since the latter already holds tag and data_names as parameters.
- Returns
data (
Boxspace) – Dictionary-like object, with the following attributes. data : {ndarray, dataframe} of shape (150, 4)The data matrix. If as_frame=True, data will be a pandas DataFrame.
- target: {ndarray, Series} of shape (150,)
The classification target. If as_frame=True, target will be a pandas Series.
- feature_names: list
The names of the dataset columns.
- target_names: list
The names of target classes.
- frame: DataFrame of shape (150, 5)
Only present when as_frame=True. DataFrame with data and target. .. versionadded:: 0.1.2
- DESCR: str
The full description of the dataset.
- filename: str
The path to the location of the data. .. versionadded:: 0.1.2
data, target (tuple if
return_X_yis True) – A tuple of two ndarray. The first containing a 2D array of shape (n_samples, n_features) with each row representing one sample and each column representing the features. The second ndarray of shape (n_samples,) containing the target samples. .. versionadded:: 0.1.2X, Xt, y, yt (Tuple if
split_X_yis True) – A tuple of two ndarray (X, Xt). The first containing a 2D array of:\[ \begin{align}\begin{aligned}\text{shape}(X, y) = 1- \text{test_ratio} * (n_{samples}, n_{features}) *100\\\text{shape}(Xt, yt)= \text{test_ratio} * (n_{samples}, n_{features}) *100\end{aligned}\end{align} \]where each row representing one sample and each column representing the features. The second ndarray of shape(n_samples,) containing the target samples.
Examples
Let’s say you are interested in the samples 10, 25, and 50, and want to know their class name:
>>> from watex.datasets import load_bagoue >>> d = load_bagoue () >>> d.target[[10, 25, 50]]
array([0, 2, 0]) >>> list(d.target_names) [‘flow’]