Skip to content

Instantly share code, notes, and snippets.

View Hugo101's full-sized avatar
🐳

Changbin Li Hugo101

🐳
View GitHub Profile
@Hugo101
Hugo101 / nmf_cd.py
Created September 26, 2018 22:08 — forked from mblondel/nmf_cd.py
NMF by coordinate descent
"""
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
@Hugo101
Hugo101 / gaussian_process.py
Created September 26, 2018 22:07 — forked from mblondel/gaussian_process.py
Gaussian Process Regression
"""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
@Hugo101
Hugo101 / svm.py
Created September 26, 2018 22:07 — forked from mblondel/svm.py
Support Vector Machines
# Mathieu Blondel, September 2010
# License: BSD 3 clause
import numpy as np
from numpy import linalg
import cvxopt
import cvxopt.solvers
def linear_kernel(x1, x2):
return np.dot(x1, x2)
I think you should use an
`<addr>` element here instead.