Skip to content

The parent company of Rockstar Games and 2K Interactive gave this to me as a take-home assignment

Notifications You must be signed in to change notification settings

halfwind22/pythonml100k

Repository files navigation

Take2 Interactive Tech Interview Question

The MovieLens 100K Dataset is used for this exercise. It can be downloaded from https://grouplens.org/datasets/movielens/100k/ for a sample glance.

Dataset is available under https://files.grouplens.org/datasets/movielens/ml-100k.zip

Introduction

All the 3 questions have been implemented as 3 separate functions in a single main.py file . Execution of the main file leads to generated outputs in the target folder. Unit tests check for data integrity issues.A file based logger logs messages to a log file.

Steps to run the project:

Method1: Using Docker
  • The contents of the zip file must be extracted into any location.
  • Docker must be installed and is a pre-requisite.
  • Execute the below commands:
    cd Take2Project
    docker build --rm --pull -t "take2projectfeaturedev:latest" .
  • At this point the Docker image is built and is assigned a random name. To verify, run
    docker images
  • We should be seeing an image with the name take2projectfeaturedev .Note the IMAGE ID of this image.
  • To run a container off the image,
    docker run -it IMAGE ID
  • This spins up a container that runs the ETL job and print the output files onto the terminal.
Method2: Using python and cmd (Windows Terminal,but universal with only minor changes needed)
  • First, we must create a virtual environment using below command, and also activate it:
    python3 -m venv venv
    venv\Scripts\activate
  • Next, we must install the required dependencies using:
    pip install -r requirements.txt
  • Create a directory for storing the output files.
    mkdir target
    python -m unittest test_etl.py -v
  • Run main script
    python main_etl.py
  • The target folder should have 3 files generated corresponding to each question.

About

The parent company of Rockstar Games and 2K Interactive gave this to me as a take-home assignment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published