Skip to content
BI & Data ScienceWhat machine learning is

Formulas for this chapter

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
Step 3 of 26
The real wordsTheory

Four things it is not

The comparison table from the class notes, worth learning as four pairs.

Core ideaMain goal
Machine learningLearns patterns from data to predictMaximise accuracy
Artificial intelligenceBroader field, human-like intelligenceAchieve intelligent behaviour
Traditional programmingRules and logic written by humansExecute predefined instructions
StatisticsAnalyse data and make inferencesTest hypotheses