Load the covertype dataset (classification).
Download it if necessary.
Classes | 7 |
Samples total | 581012 |
Dimensionality | 54 |
Features | int |
Read more in the User Guide.
Specify another download and cache folder for the datasets. By default all scikit-learn data is stored in ‘~/scikit_learn_data’ subfolders.
If False, raise an OSError if the data is not locally available instead of trying to download the data from the source site.
Determines random number generation for dataset shuffling. Pass an int for reproducible output across multiple function calls. See Glossary.
Whether to shuffle dataset.
If True, returns (data.data, data.target) instead of a Bunch object.
Added in version 0.20.
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.24.
Number of retries when HTTP errors are encountered.
Added in version 1.5.
Number of seconds between retries.
Added in version 1.5.
Bunch
Dictionary-like object, with the following attributes.
Each row corresponds to the 54 features in the dataset.
Each value corresponds to one of the 7 forest covertypes with values ranging between 1 to 7.
Only present when as_frame=True. Contains data and target.
Description of the forest covertype dataset.
The names of the dataset columns.
The names of the target columns.
return_X_y is 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.
Added in version 0.20.
>>> from sklearn.datasets import fetch_covtype >>> cov_type = fetch_covtype() >>> cov_type.data.shape (581012, 54) >>> cov_type.target.shape (581012,) >>> # Let's check the 4 first feature names >>> cov_type.feature_names[:4] ['Elevation', 'Aspect', 'Slope', 'Horizontal_Distance_To_Hydrology']
© 2007–2025 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/1.6/modules/generated/sklearn.datasets.fetch_covtype.html