Skip to content

Instantly share code, notes, and snippets.

View aswinmohanme's full-sized avatar
🎯
Focusing

Aswin Mohan aswinmohanme

🎯
Focusing
View GitHub Profile
# Import the Iris Dataset
from sklearn.datasets import load_iris
# Really load Iris
iris = load_iris()
# Every coloums is a feature
# Every Row is an observation
print(iris.feature_names)
# Prints the Target Species
print(iris.target)
# PRitn the names of the species
print(iris.target_names)
# The Dimensions are retured using the shape attribute
print(iris.data.shape)
print(iris.target.shape)
# It is convention that X holds the Feature array and y holds the label array
X = iris.data
y = iris.target
#Import the Algorythm
from sklearn.neighbors import KNeighborsClassifier
# Instantiate the Classifier
knn = KNeighborsClassifier()
# Train the Model
knn.fit(X,y)
# Create some test data , this corresponds with 0 species
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Privacy Policy</title> <style>body{font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding:1em;}</style></head> <body><h2>Privacy Policy</h2> <p> Aswin Mohan built the Tet app as a Free app. This SERVICE is provided by Aswin Mohan at no cost and is intended for use as is.
</p> <p>This page is used to inform website visitors regarding my policies with the collection, use, and
disclosure of Personal Information if anyone decided to use my Service.
</p> <p>If you choose to use my Service, then you agree to the collection and use of information in relation
to this policy. The Personal Information that I collect is used for providing and improving the
Service. I will not use or share your information with anyone except as described
in this Privacy Policy.
</p>
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Privacy Policy</title> <style>body{font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding:1em;}</style></head> <body><h2>Privacy Policy</h2> <p> Aswin Mohan built the Tet app as a Free app. This SERVICE is provided by Aswin Mohan at no cost and is intended for use as is.
</p> <p>This page is used to inform website visitors regarding my policies with the collection, use, and
disclosure of Personal Information if anyone decided to use my Service.
</p> <p>If you choose to use my Service, then you agree to the collection and use of information in relation
to this policy. The Personal Information that I collect is used for providing and improving the
Service. I will not use or share your information with anyone except as described
in this Privacy Policy.
</p>
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Privacy Policy</title> <style>body{font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding:1em;}</style></head> <body><h2>Privacy Policy</h2> <p> Aswin Mohan built the Tet Pro app as a Commercial app. This SERVICE is provided by Aswin Mohan and is intended for use as is.
</p> <p>This page is used to inform website visitors regarding my policies with the collection, use, and
disclosure of Personal Information if anyone decided to use my Service.
</p> <p>If you choose to use my Service, then you agree to the collection and use of information in relation
to this policy. The Personal Information that I collect is used for providing and improving the
Service. I will not use or share your information with anyone except as described
in this Privacy Policy.
</p>
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Privacy Policy</title> <style>body{font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding:1em;}</style></head> <body><h2>Privacy Policy</h2> <p> Aswin Mohan built the Hack News app as an Ad Supported app. This SERVICE is provided by Aswin Mohan at no cost and is intended for use as is.
</p> <p>This page is used to inform website visitors regarding my policies with the collection, use, and
disclosure of Personal Information if anyone decided to use my Service.
</p> <p>If you choose to use my Service, then you agree to the collection and use of information in relation
to this policy. The Personal Information that I collect is used for providing and improving the
Service. I will not use or share your information with anyone except as described
in this Privacy Policy.
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Privacy Policy</title> <style>body{font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding:1em;}</style></head> <body><h2>Privacy Policy</h2> <p> Aswin Mohan built the HackNews Pro app as an Ad Supported app. This SERVICE is provided by Aswin Mohan at no cost and is intended for use as is.
</p> <p>This page is used to inform website visitors regarding my policies with the collection, use, and
disclosure of Personal Information if anyone decided to use my Service.
</p> <p>If you choose to use my Service, then you agree to the collection and use of information in relation
to this policy. The Personal Information that I collect is used for providing and improving the
Service. I will not use or share your information with anyone except as described
in this Privacy Policy.