[1] O. Chapelle, "Active Learning for Parzen Window Classifier", Proceedings of the Tenth International Workshop Artificial Intelligence and Statistics, 2005.
下面是分类器
import numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils import check_random_state, check_array
from src.utils.mathematical_functions import kernels
class PWC(BaseEstimator, ClassifierMixin):
"""PWC
The Parzen window classifier (PWC) [1] is a simple and probabilistic classifier. This classifier is based on a
non-parametric density estimation obtained by applying a kernel function.
Parameters
----------
n_classes: int,
This parameter indicates the number of available classes.
metric: str,
The metric must a be a valid kernel defined by the function sklearn.metrics.pairwise.pairwise_kernels.
n_neighbors: int,
Number of nearest neighbours. Default is None, which means all available samples are considered.
kwargs: str,
Any further parameters are passed directly to the kernel function.
Attributes
----------
n_classes: int,
This parameters indicates the number of available classes.
metric: str,
The metric must a be a valid kernel defined by the function sklearn.metrics.pairwise.pairwise_kernels.
n_neighbors: int,
Number of nearest neighbours. Default is None, which means all available samples are considered.
kwargs: str,
Any furth
Python代码复现Active Learning for Parzen Window Classifier
[1] O. Chapelle, "Active Learning for Parzen Window Classifier", Proceedings of the Tenth International Workshop Artificial Intelligence and Statistics, 2005.