Icon

FINAL - Movie Recommendation Model (CF)

<p><strong>Movie Recommendation System</strong></p><p><strong><em>Author(s)</em></strong></p><ul><li><p>Tylah Jenkins (14248037)</p></li><li><p>Dayhe Kwon (25531308)</p></li><li><p>Aabhii Taneja (13568821)</p></li><li><p>Harshit Setia (25206804)</p></li></ul><p><strong>Date: </strong>01/08/2025</p><p></p><p></p><p><strong>Overview &amp; Purpose</strong></p><p>This workflow builds a simple movie recommendation system using the MovieLens 100k dataset to predict user preferences and movie ratings.</p><p></p><p><strong>Data Used</strong></p><p>Uses MovieLens 100k dataset files: u.data (for the final working model), uX.base/test files if running the hyperparameter tuning, and u.user/u.item if running the hybrid model.</p><ul><li><p><strong>Required Location: </strong>On the user's Desktop is the most convenient location.</p></li></ul><p></p><p><strong>Methodology</strong></p><p>Workflow steps include:</p><ul><li><p>Data loading (ingestion) and initial inspection</p></li><li><p>Cleaning &amp; preprocessing (column renaming, cleaning was conducted and trusted from source)</p></li><li><p>Data splitting (Partitioned - 80/20 train/test split) / Test validation set checks</p></li><li><p>Spark environment initialisation and required transformations</p></li><li><p>Model training/prediction (Collaborative Filtering)</p></li><li><p>Output generation (predicted vs actual)</p></li><li><p>Evaluation &amp; Analysis</p></li></ul><p></p><p><strong>How to run the Workflow</strong></p><ul><li><p>Place data files in the specified location.</p></li><li><p>Open workflow in KNIME.</p></li><li><p>Drag mouse over all nodes in the 'Final Working Model' section and select execute all.</p></li></ul><p></p><p><strong>Outputs</strong></p><ul><li><p>Actual vs. Predicted ratings.</p></li><li><p>Table of Top 10 Recommendations table for each user (unrated movies).</p></li><li><p>Evaluation metrics table: RMSE and Recall.</p></li></ul><p></p><p><strong>Evaluation Metrics</strong></p><p>System evaluated using RMSD and Recall metrics on the u.data set (training/test split).</p><p></p><p><strong>Assumptions</strong></p><ul><li><p>Data files are complete, unaltered, and tab-separated.</p></li><li><p>Input data includes required pre-cleaning (users &gt;= 20 ratings, with complete demographics).</p></li><li><p>Rating scale is a 1-5.</p></li><li><p>Data provided is reliable and credible.</p></li></ul>

URL: Social Information Network Analysis - Assignment 2 Brief https://drive.google.com/file/d/1eBkvvoXW0e3ZKEg91z5mIXKacE1m-Nc4/view?usp=sharing

Final Working Model (Proved to have the best combined balance between Recall & RMSE)

Model Training via Collaborative Filtering

Data Loading (Ingestion) & Inspection

Data Preprocessing

Model Evaluation & Analysis

Spark Environment Initialisation & Table to Spark Transformation

Data Splitting & Test set validation of having known users and items


Generated Top Ten Movie List for Each User (Unrated Items)

Loads the raw data from the u.data file
CSV Reader
Splits the data into a trainingand test set (80/20 split)
Partitioning
Removes columns not necessary
Column Filter
Flags predicted ratings that are Not a Number
Math Formula
Groups data by user to find known users in the test set
GroupBy
Unique users
Duplicate Row Filter
Renames columns for clarity
Column Renamer
Groups data by item to find knownitems in the test set.
GroupBy
Adds details including movie titles and genres to the final list of recommendations
Joiner
Filters the test set to keep only rows with known users
Reference Row Filter
Creates the list of all possibleuser-movie combinations for prediction
Cross Joiner
Converts binary genre measureto string combined value
Expression
Filters the test set to keep onlyrows with known items
Reference Row Filter
Unique movies
Duplicate Row Filter
Loads the raw movie data from the u.item file
CSV Reader
Renames columns for clarity
Column Renamer
Selects necessary columns
Column Filter
Removes trailing comma andwhitespace from genre list
Expression
Initialises the Spark environment for processing
Create Local Big Data Environment
Converts the test datainto a Spark DataFrame
Table to Spark
Joiner
Uses the trained model to predict ratings for the unrated user-movie pairs
Spark Predictor (MLlib)
Selects necessary columns
Column Filter
Saves the final list of recommended movies to a CSV file
CSV Writer
Converts the test datainto a Spark DataFrame
Table to Spark
Converts the list of unrated pairs into a format usable by Spark prediction nodes.
Table to Spark
VIEW STATS (RMSD)
Table View
Removes columns user would not beinterested in
Column Filter
Orders by user and then by predicted rating
Sorter
Write results to local location
Excel Writer
Converts the predicted ratings from Spark back into a standard table
Spark to Table
VIEW STATS (Recall)
Table View
Converts the Spark DataFrame with predictions back into a KNIME data table
Spark to Table
Selects the top 10 "liked" predicted moviesfor each user
Top k Row Filter
Calculates regression metrics(including RMSE/RMSD)
Numeric Scorer
Write results to local location
Excel Writer
Trains the collaborative filteringmodel on the Spark training data
Spark Collaborative Filtering Learner (MLlib)
Classifies predicted ratings into "Liked"/"Disliked"(4 or greater is liked)
Rule Engine
Iterates through the predictedratings for each user
Group Loop Start
Uses the trained model to predictratings on the test data
Spark Predictor (MLlib)
Classifies actual ratings into "Liked"/"Disliked"(4 or greater is liked)
Rule Engine
Calculates classification metrics (including Recall/Sensitivity)
Scorer
Consolidates the top 10 recommended movies for all users into asingle table
Loop End
Removes the rows containing invalid (NaN)
Row Filter

Nodes

Extensions

Links