This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (C) Kyle Kastner, June 2014 | |
# License: BSD 3 clause | |
#This code is for fun only! Use scipy.linalg.hadamard | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import functools | |
def memoize(obj): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (C) Kyle Kastner, June 2014 | |
# License: BSD 3 clause | |
import numpy as np | |
from scipy import linalg | |
from sklearn.utils import array2d, as_float_array | |
from sklearn.utils.extmath import svd_flip | |
from sklearn.utils.testing import assert_array_almost_equal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (C) Kyle Kastner, June 2014 | |
# License: BSD 3 clause | |
import numpy as np | |
# Using data from http://www.mathsisfun.com/data/standard-deviation.html | |
X = np.array([600, 470, 170, 430, 300]) | |
# Showing steps from basic to Welford's and batch | |
# See http://cpsc.yale.edu/sites/default/files/files/tr222.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# License: GPL | |
# Based on scikit-tensor by mnick | |
# https://github.com/mnick/scikit-tensor | |
"""Tensor factorization.""" | |
import numpy as np | |
from scipy import linalg | |
def _matricize(X, axis): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from numpy.testing import assert_almost_equal | |
A = np.arange(200).reshape(40, 5).astype('float32') | |
B = np.arange(100).reshape(20, 5) + 10. | |
C = np.vstack((A, B)) | |
mA = np.mean(A, axis=0) | |
mB = np.mean(B, axis=0) | |
mC = np.mean(C, axis=0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Kyle Kastner | |
# License: BSD 3-clause | |
import numpy as np | |
from scipy.signal import lfilter | |
import matplotlib.pyplot as plt | |
sine = np.sin(np.linspace(-4 * np.pi, 4 * np.pi, 10000)) | |
noise = 0.2 * np.random.randn(len(sine)) | |
s = sine + noise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original code from tinrtgu on Kaggle under WTFPL license | |
# Relicensed to BSD 3-clause (it does say do what you want...) | |
# Authors: Kyle Kastner | |
# License: BSD 3-clause | |
# Reference links: | |
# Adaptive learning: http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/41159.pdf | |
# Criteo scalable response prediction: http://people.csail.mit.edu/romer/papers/TISTRespPredAds.pdf | |
# Vowpal Wabbit (hashing trick): https://github.com/JohnLangford/vowpal_wabbit/ | |
# Hashing Trick: http://arxiv.org/pdf/0902.2206.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf 8 -*- | |
# Author: Kyle Kastner | |
# License: BSD 3-clause | |
from __future__ import division | |
import os | |
import numpy as np | |
import tables | |
import numbers | |
import fnmatch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i 111.mp3 -acodec pcm_s16le -ac 1 -ar 16000 out.wav | |
find ../mp3_symlinks/ -name *.mp3 -exec sh -c 'echo $(basename {} .mp3)' \; | |
find ../mp3_symlinks/ -name *.mp3 -exec sh -c 'ffmpeg -i {} -acodec pcm_s16le -ac 1 -ar 16000 $(basename {} .mp3).wav' \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in *.ipynb ; do echo $f; aspell list < "$f" | sort | uniq -c ; done | less | |
2to3 -f imports folder/path | patch -p0 |
OlderNewer