Skip to content

Instantly share code, notes, and snippets.

@nancychenxizhong
nancychenxizhong / kernel_kmeans.py
Created August 24, 2022 03:37 — forked from mblondel/kernel_kmeans.py
Kernel K-means.
"""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