KaaShiv Infotech

Inplant training in chennai | Internship in chennai

# Load inbuilt datasets

 

from sklearn import datasets

from sklearn.discriminant_analysis import LinearDiscriminantAnalysis

# Load the Iris flower dataset:

iris = datasets.load_iris()

X = iris.data

y = iris.target

print(iris.data)

print(iris.target_names)

print(iris.target)

 

import pandas as pd

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

pd_Frame

 


SAMPLE DATASETS FOR
CLUSTERING

 

#import Libraries

from sklearn.datasets import make_blobs

import matplotlib.pyplot as plt

#Create Clusters

X, y = make_blobs(n_samples = 200,

# two feature variables,

n_features = 3,

# three clusters,

centers = 3,

# with .3 cluster standard deviation

cluster_std = 0.3,

# shuffled,

shuffle = True)

#Plotting  the Clustered Data

plt.scatter(X[:,0],

X[:,1]

)

 


SAMPLE DATASETS FOR
CLASSIFICATION

 

#import Libraries

from sklearn.datasets import make_classifier

import matplotlib.pyplot as plt

#Create Clusters

X, y = make_ classifier(n_samples = 200,

# two feature variables,

n_features = 10,

# Useful column for  the classifier

n_informative = 5,

#  Unused column for the classifier

n_redundant = 5,

# Number of target classes

n_classes = 3

# Ratio  of data shuffled among the classes,

weights = [0.2,0.3,0.5] )

#Plotting  the Clustered Data

plt.scatter(X[:,0],

X[:,1]

)


SAMPLE DATASETS FOR
CLASSIFICATION

#import Libraries

from sklearn.datasets import make_regression

import matplotlib.pyplot as plt

#Create regression

X, y = make_ regression(n_samples = 200,

# two feature variables,

n_features = 3,

# Noise

noise = 0.2 )

#Plotting  the Clustered Data

plt.scatter(X[:,0],

X[:,1]

)

 

 


KaaShiv InfoTech Rated 5 / 5 based on 99,988 reviews.
× How can I help you?