{{ message }}

Instantly share code, notes, and snippets.

# Mathieu Blondel mblondel

Last active Jun 12, 2019
NMF by coordinate descent
View nmf_cd.py
 """ NMF by coordinate descent, designed for sparse data (without missing values) """ # Author: Mathieu Blondel # License: BSD 3 clause import numpy as np import scipy.sparse as sp import numba
Last active Aug 29, 2015
Local regression
View local_regression.py
 """Local regression""" # Author: Mathieu Blondel # 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
Last active Apr 20, 2021
Learning to rank metrics.
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
Last active Feb 13, 2019
Frequent directions algorithm for matrix sketching.
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.
Last active May 13, 2017
Variable-length curve averaging
View curve_averaging.py
 """Variable-length curve averaging""" # Author: Mathieu Blondel # License: BSD 3 clause import numpy as np from scipy.interpolate import interp1d def curves_mean_std(X, Y, kind="linear"):
Last active May 19, 2021
Kernel K-means.
View kernel_kmeans.py
 """Kernel K-means""" # Author: Mathieu Blondel # 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
Created Aug 14, 2013
Gaussian Process Regression
View gaussian_process.py
 """Gaussian processes""" # Author: Mathieu Blondel # 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
Last active Jan 27, 2020
Sparse Multiclass Classification in Numba!
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.
Last active May 13, 2017
Missing-value imputation
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:
Created May 10, 2013
Cross-referencing in LaTeX.
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.