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 scipy.special import chdtrc | |
from scipy.sparse import spdiags | |
from sklearn.base import BaseEstimator, TransformerMixin | |
from sklearn.preprocessing import LabelBinarizer | |
def _chisquare(f_obs, f_exp, reduce): | |
"""Replacement for scipy.stats.chisquare with custom reduction. |
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
/* | |
* Nonogram/paint-by-numbers solver in SWI-Prolog. Uses CLP(FD), | |
* in particular the automaton/3 (finite-state/RE) constraint. | |
* Copyright 2011, 2014 Lars Buitinck | |
* Copyright 2014 Markus Triska | |
* Do with this code as you like, but don't remove the copyright notice. | |
*/ | |
:- use_module(library(clpfd)). |
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
""" | |
Three ways of computing the Hellinger distance between two discrete | |
probability distributions using NumPy and SciPy. | |
""" | |
import numpy as np | |
from scipy.linalg import norm | |
from scipy.spatial.distance import euclidean | |
OlderNewer