[go: up one dir, main page]

0% found this document useful (0 votes)
54 views2 pages

Introduction To SciKit - Ipynb - Colaboratory

This document introduces scikit-learn through an example using the iris dataset. It loads dependencies like pandas, numpy and seaborn. It loads and visualizes the iris dataset, which contains measurements of iris flowers split into three species types. It then splits the dataset into training and test sets for supervised learning. Classification is discussed as predicting labels or classes from data, and using the iris dataset as an example to predict flower species from measurements.

Uploaded by

Vincent Giang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views2 pages

Introduction To SciKit - Ipynb - Colaboratory

This document introduces scikit-learn through an example using the iris dataset. It loads dependencies like pandas, numpy and seaborn. It loads and visualizes the iris dataset, which contains measurements of iris flowers split into three species types. It then splits the dataset into training and test sets for supervised learning. Classification is discussed as predicting labels or classes from data, and using the iris dataset as an example to predict flower species from measurements.

Uploaded by

Vincent Giang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Introduction to SciKit.ipynb - Colaboratory https://colab.research.google.com/drive/1srVswFoHSpdXSFo...

Preparation

Load Dependencies

1 import seaborn as sns
2 import pandas as pd
3 import numpy as np

Supervised Learning

Load IRIS Dataset

1 iris = sns.load_dataset('iris')
2 iris_features = ['petal_length', 'petal_width', 'sepal_length', 'sepal_width']
3 iris_label = 'species'
4 iris.head()

1 # test-train split iris dataset
2 from sklearn.model_selection import train_test_split
3 iris_train, iris_test = train_test_split(iris, test_size=0.2, random_state=42)

Visualizations

1 sns.pairplot(iris, hue=iris_label)

Classi9cation
In a classi9cation problem, we try to determine the label of a class based on the
readings/ data we have. For example whether an image is an image of a cat or a dog.

For the examples during the section, we will use the iris dataset, in which we have
measurements relating to the different species of iris Eower. Here we will focus on
determining which type of species that a measurement corresponds to.

1 of 2 8/11/20, 6:25 AM
Introduction to SciKit.ipynb - Colaboratory https://colab.research.google.com/drive/1srVswFoHSpdXSFo...

2 of 2 8/11/20, 6:25 AM

You might also like