The proposed files implement the Adaptive Nearest Neighbors method for Partial Labels (PL A-kNN) presented in AISTATS 2026.
All MATLAB source files are located in the code/ folder.
PL_Aknn_classifier.m— Main algorithm. Implements the Adaptive Nearest Neighbor method for Partial Labels (PL A-kNN). In cases where two or more labels remain in the candidate set after T iterations performs the heuristic desambiguatuon criterion specified in the paper.
-
nn_preprocess_vision.m— Preprocessing pipeline for the vision benchmarks (CIFAR-10, MNIST, Fashion-MNIST). -
nn_preprocess_real_partial_datasets.m— Preprocessing pipeline for the real-world partial label datasets (MIRFlickr, MSRCv2).
-
candidate_generator_vision.m— Generates partial labels scenarios for the vision benchmarks as specified in the paper. -
real_partial_datasets_with_noise.m— Adds synthetic noise to the existing partial label annotations of the real-world datasets (MIRFlickr, MSRCv2).
dataset_split_part_labels.m— Splits a dataset into training and test sets while preserving the partial label structure.
The examples/ folder provides minimal runnable scripts that demonstrate
how to use the method on any dataset and setting specified in the paper.
-
vision_script.m— Example script for the vision benchmarks (CIFAR-10, MNIST, Fashion-MNIST). Loads a dataset, generates a partial label scenario with a configurable noise level, preprocesses the features, and runs PL A-kNN returning the prediction accuracy. -
real_partial_datasets_script.m— Example script for the real-world partial label datasets (MIRFlickr, MSRCv2). Loads a dataset, adds configurable noise to the existing partial labels, preprocesses the features, and runs PL A-kNN returning the prediction accuracy.
The key parameters that can be adjusted at the top of each script are:
noise— (0.0 to 1.0)T— maximum number of iterationsc_1— hyperparameter of PL-A-kNNprop_train— train/test split proportion
Nicolas A. Errandonea nerrandonea@bcamath.org
This project is licensed under the MIT License — see the LICENSE file for details.
If you find this code useful in your research, please include an explicit mention of our work in your publication with the following entry in your bibliography: