MODULO Machine Learning: Artificial Intelligence SagaTHEORY

Read a nearest-neighbour estimate

Use preorders as a one-dimensional input. Training pairs (preorders, demand) are (10, 14), (20, 22) and (40, 50). Estimate demand at 23 with one and then two nearest neighbours.

Check your work

Distances are 13, 3 and 17. The nearest prediction is 22. With equal weight on the two nearest, the estimate is (22 + 14) / 2 = 18. Adding a neighbour can pull a forecast away from the local trend.