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
''' | |
Implementation of Fastfood (Le, Sarlos, and Smola, ICML 2013). | |
Primarily by @esc (Valentin Haenel) and felixmaximilian | |
from https://github.com/scikit-learn/scikit-learn/pull/3665. | |
Modified by @dougalsutherland. | |
FHT implementation was "inspired by" https://github.com/nbarbey/fht. | |
''' |
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
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
# Roughly based on: http://stackoverflow.com/questions/11443302/compiling-numpy-with-openblas-integration | |
from __future__ import print_function | |
import numpy as np | |
from time import time |
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 scipy.stats | |
import matplotlib.pyplot as plt | |
import sklearn.model_selection | |
import sklearn.neighbors | |
def kde_scipy(x, x_grid): | |
""" | |
Using heuristic for bandwidth | |
""" | |
kde = scipy.stats.gaussian_kde(x) |