Giter Club home page Giter Club logo

pa2_movies2's Introduction

movies-2

GitHub repo: shuchenku/PA2_movies2 https://github.com/shuchenku/PA2_movies2.git

CODECLIMATE REPORTS:

MovieData class: https://codeclimate.com/repos/54cac94ae30ba00498001947/MovieData MovieTest class: It was rated A but now CodeClimate fails to recognized that file.

My interpretation of the Codeclimate Grading:

Playing with CodeClimate gives me the sense that it emphisizes more on class simplictity rather than algorithm complextity.

My similarity function, which adopts a modified Cosine Similarity as metric, requires extra data structures and more lines of mathematical operations to be O(n). CodeClimate to did not like that and marked it as a high complexity function; the same is with my load_data() function where extra data structures were created to enable faster access to movies/users/rating. The way I designed the MovieData class is mainly focused on efficiency; if it was designed differently I imagine many of the methods will be O(n squared) complexity but CodeClimate might give me a better score. After considering the tradeoffs I decided to stick with what I have and be happy with a D (also ~ 1 min runtime).

MEAN ERROR Pearson Cosine 0.5 cutoff 0.5 cutoff u1: 0.83735 0.7959 u2: 0.82475 0.79305 u3: 0.8153 0.7912 u4: 0.80705 0.7916 u5: 0.81275 0.7966

RUNTIME Test size(u1) Runtime 10 1.0s 100 1.0s 1,000 3.1s 10,000 27.4s 20,000 54.8s 20,000(u3,4,5) ~70s

INDEX DEFINATION:

popularity index = 1/log(# of reviews)

similarity index = min(intersect(# of user1 reviewed movies, # of user2 reviewed movies), 8)/8 * cosine similarity Cutoff similarity index value for being "most similar": 0.5

* min # of movies required to not get penalized is set to be 8 b/c it gives the best prediction results.
* Cosine similarity improved prediction accuracy compared to Pearson correlation, therefore I cheaged the algorithm in Movies-2

Prediction of user u on movies m is based on average rating of u's similar users's ratings on m.

pa2_movies2's People

Contributors

shuchenku avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.