Skip to content

Instantly share code, notes, and snippets.

View Nathan-Furnal's full-sized avatar
🤖
🤖

Nathan Furnal Nathan-Furnal

🤖
🤖
View GitHub Profile
@derekpowell
derekpowell / pymc3-horseshoe-prior.py
Last active March 7, 2022 11:56
pymc3 horseshoe prior implementation
def horseshoe_prior(name, X, y, m, v, s):
'''
Regularizing horseshoe prior as introduced by Piironen & Vehtari
https://arxiv.org/pdf/1707.01694.pdf
name: variable name
X: X (2-d array)
y: y (for setting pseudo-variance)
m: expected number of relevant features (must be < total N)
v: regularizing student-t df
@bshishov
bshishov / forecasting_metrics.py
Last active July 19, 2024 18:17
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
@mishurov
mishurov / qt.mak
Last active June 18, 2024 20:52
Makefile to build QT projects (Linux) without qmake
CC=g++
MOC=moc-qt4
CFLAGS=-Wall
SOURCES=hello.cc hello_cls.cc
MOC_HEADERS=hello_cls.h
EXECUTABLE=hello
INCDIRS=-I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtCore
LIBS=-lQtCore -lQtGui
# Change postfixes
MOC_SOURCES=$(MOC_HEADERS:.h=.moc.cc)