3.8 Supervised Learning With Python A
3.8 Supervised Learning With Python A
• the aim is to build a model that is able to predict the target variable given the predictor variables
• Independent Variable features predictor variables
SUPERVISED • Dependent Variable target response variable
LEARNING
Classfication Regression
the target variable consists of categories the target is a continuous variable
sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) species
0 5.1 3.5 1.4 0.2 setosa
1 4.9 3.0 1.4 0.2 setosa
2 4.7 3.2 1.3 0.2 setosa
3 4.6 3.1 1.5 0.2 setosa
4 5.0 3.6 1.4 0.2 setosa
K-NEAREST • algorithm that predicts the label of a data by taking the majority vote of the ‘k’ closest labeled data
NEIGHBOR points
.fit() trains the model to the data .predict() predicts the label of an unlabeled data point