# Experimenting Machine Learning with JavaScript —applied to Movie Ratings

Objective
Predict the rating of movies, based on previous ratings
Method
k-nearest neighbors (KNN) regression
(k-NN is a non-parametric method used for classification and regression. In both cases, the input consists of the k closest training examples in the feature space. In k-NN regression, the output is the average of the values of its k nearest neighbors. More on Wikipedia)
Training Data
380 rated movies (or you can upload your IDMb movie ratings csv)
Features
IMDb Rating; Runtime (mins); Year; Num. Votes
Unlabeled Data
a list of 100 films (or you can upload your IDMb watchlist csv)

## 1. Training Data

Select the training dataset:

or Select your IMDb ratings csv

instructions

## 2. Features

Select the features that could predict a movie rating:

## 3. Unlabeled Data

Select unrated movies to predict the rating:

or Select your IMDb watchlist csv

instructions

## 4. K

Select K (= number of nearest neighbours to look for):

## 5. Run the Algorithm Once

The xxx nearest neighbors:

Distance formula
$\sqrt{(distance_1^2+distance_2^2+...+distance_k^2)}$
Normalization formula
$distance_k = \frac{property_k(training) - property_k(unseen)}{range_k}$

## 6. All Predictions

TitlePredicted rating
TitlePredicted rating
TitlePredicted rating

Explore by Changing parameters (Training set, Unlabeled set, Features, K)