Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 1.12 KB

README.md

File metadata and controls

36 lines (25 loc) · 1.12 KB

KRNN with spatial features

Implementation of the technique described in

László et al (2018): Improving the Performance of the k Rare Class Nearest Neighbor Classifier by the Ranking of Point Patterns. In: Lecture Notes in Computer Science, vol 10833, p. 265-283

Installation

pip install git+https://github.com/gykovacs/krnn_with_spatial_features

Sample usage

# importing the dataset package from sklearn
import sklearn.datasets as sd

# import the KRNN_SF classifier
from KRNN_SF import KRNN_SF

# loading the IRIS dataset
X, y= sd.load_iris(return_X_y= True)

# turning the IRIS multi-classification problem into an unbalanced binary classification
y[y == 2]= 1

# fitting and predicting
krnn_sf= KRNN_SF(correction= 'r1')
krnn_sf.fit(X, y)
krnn_sf.predict_proba(X)