Skip to content

Instantly share code, notes, and snippets.

View vlainic's full-sized avatar

Milos Vlainic vlainic

View GitHub Profile
@aditya00kumar
aditya00kumar / bayesian_rating.py
Last active November 16, 2021 07:31
Function to provide bayesian Average approximation to ratings on K scale.
import math
import scipy.stats as st
def bayesian_rating_products(n, confidence=0.95):
"""
Function to calculate wilson score for N star rating system.
:param n: Array having count of star ratings where ith index represent the votes for that category i.e. [3, 5, 6, 7, 10]
here, there are 3 votes for 1-star rating, similarly 5 votes for 2-star rating.
:param confidence: Confidence interval
:return: Score
@aditya00kumar
aditya00kumar / wilson_score.py
Created January 1, 2020 06:32
Function to provide Wilson lower bound score for given positive and total ratings
import math
import scipy.stats as st
def wilson_lower_bound(pos, n, confidence=0.95):
"""
Function to provide lower bound of wilson score
:param pos: No of positive ratings
:param n: Total number of ratings
:param confidence: Confidence interval, by default is 95 %
:return: Wilson Lower bound score
@hitvoice
hitvoice / plot_confusion_matrix.png
Last active October 16, 2024 13:24
Generate matrix plot for confusion matrix with pretty annotations.
plot_confusion_matrix.png
@stared
stared / live_loss_plot_keras.ipynb
Last active July 17, 2025 17:36
Live loss plot for training models in Keras (see: https://github.com/stared/livelossplot/ for a library)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.