The supervised learning relation
Y = f(X)
fit f on labelled rows, then predict Y for new x
Every supervised task. If you cannot point at the column that holds Y, the task is unsupervised and this does not apply.
- X
- Input variables, the predictors or features
- Y
- Output variable, the label or target
- f
- The mapping the algorithm learns
Train-test split
training rows = 0.80 x n
validation rows = 0.20 x n
accept when performance(train) ~ performance(validation)
Before fitting anything. The class logistic-regression workbook uses 800 train and 200 test on 1,000 rows, exactly this ratio.
- n
- Total labelled rows available
- 0.80 / 0.20
- Section B's stated default split; the ratio is a decision to record
KNN aggregation rule
classification: predicted class = majority vote of the k nearest labels
regression: predicted value = average of the k nearest targets
Whenever the same neighbours must produce a label or a number. It is the one line of the algorithm that changes between the two tasks.
- k
- How many nearest neighbours are consulted