Skip to content

Instantly share code, notes, and snippets.

View eneskemalergin's full-sized avatar

Enes Ergin eneskemalergin

View GitHub Profile
@bshishov
bshishov / forecasting_metrics.py
Last active October 31, 2025 02:26
Python Numpy functions for most common forecasting metrics
import numpy as np
EPSILON = 1e-10
def _error(actual: np.ndarray, predicted: np.ndarray):
""" Simple error """
return actual - predicted
@shagunsodhani
shagunsodhani / LIME.md
Created January 28, 2017 12:32
Summary of "Why Should I Trust You? Explaining the Predictions of Any Classifier" paper

"Why Should I Trust You?": Explaining the Predictions of Any Classifier

Introduction

  • The paper introduces a novel technique to explain the predictions of any classifier in an interpretable and faithful manner.
  • It also proposes a method to explain models by obtaining representative individual predictions and their explanations.
  • Link to the paper
  • Demo

Desired Characteristics for Explanations

@karpathy
karpathy / min-char-rnn.py
Last active December 26, 2025 21:02
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@Iman
Iman / clean.sh
Last active December 26, 2025 11:52
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/usr/bin/env bash
# Ubuntu Server or VM Cleaner. Safe by default; aggressive when asked.
# Example safe: sudo ./clean.sh
# Example aggressive: sudo JOURNAL_DAYS=3 AGGRESSIVE=1 ./clean.sh
# Enable Docker image prune (images only): sudo ./clean.sh --docker-images
# Tested on Ubuntu 20.04, 22.04, 24.04 (server/VM images).
set -Eeuo pipefail
trap 'rc=$?; echo "Error on line $LINENO: $BASH_COMMAND (exit $rc)"; exit $rc' ERR
IFS=$'\n\t'
@s-boardman
s-boardman / Cufflinks easy installation
Last active October 27, 2016 21:51
Cufflinks installation for Unix systems
@alimuldal
alimuldal / dunn.py
Last active October 5, 2023 06:04
Implementation of Dunn's multiple comparison test, following a Kruskal-Wallis 1-way ANOVA
import numpy as np
from scipy import stats
from itertools import combinations
from statsmodels.stats.multitest import multipletests
from statsmodels.stats.libqsturng import psturng
import warnings
def kw_dunn(groups, to_compare=None, alpha=0.05, method='bonf'):
"""
@bsweger
bsweger / useful_pandas_snippets.md
Last active December 21, 2025 05:17
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@katychuang
katychuang / remove_brew-mongo_osx.sh
Last active December 1, 2025 21:05
remove mongodb that was installed via brew
#!/usr/bin/env sh
# first check to see if mongo service is running. you can't delete any files until the service stops so perform a quick check.
launchctl list | grep mongo
# NOTE: the pipe | symbol means the commands on the right performs on the output from the left
# grep is a string search utility. `grep mongo` means search for the substring mongo
# use the unload command to end the mongo service. this is required to 'unlock' before removing the service.
# first look for the file to delete
MONGO_SERVICE_FILE=$(ls ~/Library/LaunchAgents/*mongodb*)
@JosefJezek
JosefJezek / how-to-use-pelican.md
Last active August 24, 2025 22:27
How to use Pelican on GitHub Pages