Import biultin datset from sklearn package

 

Import built-in dataset from Sklearn package

 

Iris Dataset

 

import pandas as pd

from sklearn import datasets

 

# Load the built-in dataset

iris = datasets.load_iris()

 

# Create a DataFrame from the data and feature names

df = pd.DataFrame(data=iris.data, columns=iris.feature_names)

 

# Add the target variable to the DataFrame

#df['target'] = iris.target

 

# Display the first few rows of the DataFrame

#print(df.head())

df

 

Wine Dataset

 

import pandas as pd

from sklearn import datasets

 

 Load the Wine dataset

wine = datasets.load_wine()

 

# Create a DataFrame from the data and feature names

df = pd.DataFrame(data=wine.data, columns=wine.feature_names)

 

 

 

# Display the first few rows of the DataFrame

df.head()

 

 

Breast_Cancer dataset

 

import pandas as pd

from sklearn import datasets

 

# Load the Breast Cancer dataset

cancer = datasets.load_breast_cancer()

 

# Create a DataFrame from the data and feature names

df = pd.DataFrame(data=cancer.data, columns=cancer.feature_names)

 

 

# Display the first few rows of the DataFrame

df.head()

 

 

Dibetes Dataset

 

import pandas as pd

from sklearn import datasets

 

# Load the Diabetes dataset

diabetes = datasets.load_diabetes()

 

# Create a DataFrame from the data and feature names

df = pd.DataFrame(data=diabetes.data, columns=diabetes.feature_names)

 

 

# Display the first few rows of the DataFrame

df.head()

 

 

import pandas as pd

from sklearn.datasets import fetch_california_housing

 

Load the House Prices dataset

house_prices = fetch_california_housing()

 

# Create a DataFrame from the data and feature names

df = pd.DataFrame(data=house_prices.data, columns=house_prices.feature_names)

 

# Display the first few rows of the DataFrame

df.head()

 

 

From Seaborn package import builtin datasets

 Import Titanic Dataset

import pandas as pd

import seaborn as sns

 

# Load the Titanic dataset from Seaborn

titanic = sns.load_dataset('titanic')

 

# Display the first few rows of the DataFrame

titanic.head()

 

 

टिप्पणी पोस्ट करा

0 टिप्पण्या