Skip to content

Instantly share code, notes, and snippets.

View seralouk's full-sized avatar
💭
Brainstorming with myself

Serafeim Loukas seralouk

💭
Brainstorming with myself
View GitHub Profile
@seralouk
seralouk / recommendationSystem.py
Created April 24, 2024 14:11
A Movie Recommendation System in Python from Scratch
mean_rating = ratings.groupby('movieId')[['rating']].mean()
mean_rating = mean_rating.reset_index()
mean_rating
@seralouk
seralouk / partial_corr.py
Created March 9, 2020 12:35 — forked from fabianp/partial_corr.py
Partial Correlation in Python (clone of Matlab's partialcorr)
"""
Partial Correlation in Python (clone of Matlab's partialcorr)
This uses the linear regression approach to compute the partial
correlation (might be slow for a huge number of variables). The
algorithm is detailed here:
http://en.wikipedia.org/wiki/Partial_correlation#Using_linear_regression
Taking X and Y two variables of interest and Z the matrix with all the variable minus {X, Y},