Skip to content

Instantly share code, notes, and snippets.

View joshloyal's full-sized avatar

Joshua Loyal joshloyal

View GitHub Profile
import numpy as np
def whiten(X, method='zca'):
"""
Whitens the input matrix X using specified whitening method.
Inputs:
X: Input data matrix with data examples along the first dimension
method: Whitening method. Must be one of 'zca', 'zca_cor', 'pca',
@eickenberg
eickenberg / loess.py
Created February 2, 2015 17:27
Locally weighted regression
# Author Michael Eickenberg <michael.eickenberg@nsup.org>, Fabian Pedregosa
# Coded in 2012, another era, pure python, no guarantees for 1000% correctness or speed
"""
This module implements the Lowess function for nonparametric regression.
Functions:
lowess Fit a smooth nonparametric regression curve to a scatterplot.
For more information, see
@eickenberg
eickenberg / spam.py
Created February 2, 2015 17:26
An implementation of Sparse Additive Models in Coordinate Descent
# Author Michael Eickenberg <michael.eickenberg@nsup.org>, Fabian Pedregosa
# Coded in 2012, another era, pure python, no guarantees for 1000% correctness or speed
# requires loess.py
import numpy as np
from loess import lowess
VERBOSE = 100