WeaklySupervisedKNeighborsClassifier

class scikit_weak.classification.WeaklySupervisedKNeighborsClassifier(k=3, metric='minkowski')

A class to perform classification for weakly supervised data, based on k-nearest neighbors. The y input to the fit method should be given as an iterable of DiscreteWeakLabel

Parameters
  • k (int, default=3) – The number of neighbors

  • metric (str or callable, default 'minkowski') – The metric for neighbors queries

Variables
  • __n_classes (int) – The number of unique classes in y

  • __classes (list of int) – The unique classes in y

fit(X, y)

Fit the WeaklySupervisedKNeighborsClassifier model

predict(X)

Returns predictions for the given X

predict_proba(X)

Returns probability distributions for the given X