Following is the list of a few datasets which comes with the scikit-learn (sklearn) library in Python:
from sklearn.datasets import load_boston
# Load the dataset
boston = load_boston()
# Print the dataset description
print(boston.DESCR)
# Access the feature matrix
X = boston.data
# Access the target vector
y = boston.target
from sklearn.datasets import load_iris
# Load the Iris dataset
iris = load_iris()
# Print the data and target shape
print(f"Data shape: {iris.data.shape}")
print(f"Target shape: {iris.target.shape}")
from sklearn.datasets import load_wine
# Load wine dataset
wine_data = load_wine()
# Print the description of the dataset
print(wine_data.DESCR)
from sklearn.datasets import load_breast_cancer
# load breast cancer dataset
breast_cancer = load_breast_cancer()
# print dataset description
print(breast_cancer.DESCR)
# print dataset shape
print(breast_cancer.data.shape)
from sklearn import datasets
# Load the diabetes dataset
diabetes = datasets.load_diabetes()
# Print the feature names
print(diabetes.feature_names)
# Print the first 5 rows of the data
print(diabetes.data[:5])
# Print the target variable (i.e. disease progression)
print(diabetes.target)
Advertisement
Advertisement