View nmf_cd.py
""" | |
NMF by coordinate descent, designed for sparse data (without missing values) | |
""" | |
# Author: Mathieu Blondel <mathieu@mblondel.org> | |
# License: BSD 3 clause | |
import numpy as np | |
import scipy.sparse as sp | |
import numba |
View local_regression.py
"""Local regression""" | |
# Author: Mathieu Blondel <mathieu@mblondel.org> | |
# License: BSD 3 clause | |
import numpy as np | |
from sklearn.base import BaseEstimator, RegressorMixin | |
from sklearn.metrics.pairwise import pairwise_kernels | |
from sklearn.linear_model import Ridge |
View letor_metrics.py
# (C) Mathieu Blondel, November 2013 | |
# License: BSD 3 clause | |
import numpy as np | |
def ranking_precision_score(y_true, y_score, k=10): | |
"""Precision at rank k | |
Parameters |
View matrix_sketch.py
# (C) Mathieu Blondel, November 2013 | |
# License: BSD 3 clause | |
import numpy as np | |
from scipy.linalg import svd | |
def frequent_directions(A, ell, verbose=False): | |
""" | |
Return the sketch of matrix A. |
View curve_averaging.py
"""Variable-length curve averaging""" | |
# Author: Mathieu Blondel <mathieu@mblondel.org> | |
# License: BSD 3 clause | |
import numpy as np | |
from scipy.interpolate import interp1d | |
def curves_mean_std(X, Y, kind="linear"): |
View kernel_kmeans.py
"""Kernel K-means""" | |
# Author: Mathieu Blondel <mathieu@mblondel.org> | |
# License: BSD 3 clause | |
import numpy as np | |
from sklearn.base import BaseEstimator, ClusterMixin | |
from sklearn.metrics.pairwise import pairwise_kernels | |
from sklearn.utils import check_random_state |
View gaussian_process.py
"""Gaussian processes""" | |
# Author: Mathieu Blondel <mathieu@mblondel.org> | |
# License: BSD 3 clause | |
import numpy as np | |
from scipy.linalg import cholesky, solve_triangular | |
from sklearn.base import BaseEstimator, RegressorMixin | |
from sklearn.metrics.pairwise import pairwise_kernels |
View sparse_multiclass_numba.py
""" | |
(C) August 2013, Mathieu Blondel | |
# License: BSD 3 clause | |
This is a Numba-based reimplementation of the block coordinate descent solver | |
(without line search) described in the paper: | |
Block Coordinate Descent Algorithms for Large-scale Sparse Multiclass | |
Classification. Mathieu Blondel, Kazuhiro Seki, and Kuniaki Uehara. | |
Machine Learning, May 2013. |
View imputer.py
# (C) Mathieu Blondel | |
# License: BSD 3 clause | |
import numpy as np | |
from numpy import ma | |
import scipy.sparse as sp | |
def _get_mask(X, missing_values, sparse=False): | |
if sparse: |
View xref.txt
paper.tex: main manuscript | |
supp.tex: supplementary material | |
Cross-referencing | |
----------------- | |
We want to cross-reference equations in paper.tex from supp.tex. | |