Skip to content

Code for the paper: Error rates for kernel classification under source and capacity conditions

Notifications You must be signed in to change notification settings

HugoCui/Kernel_class_g3m

Repository files navigation

Kernel_class_g3m

Code for the paper : Error scaling laws for kernel classification under source and capacity conditions (link to paper)

illus

SVM classification

(Figs. 1 & 3)

  • maxmargin_simus.ipynb contains the code used to run max-margin classification experiments on Gaussian synthetic data, satisfying the source and capacity conditions (8).
  • hinge_repl.py implements the theoretical characterization (13) for the misclassification error $\epsilon_g$.

To run obtain the theoretical characterization for e.g. source $r=0.3$, capacity $\alpha=1.2$, noise level $\sigma=0.5$, using a large features dimension cut-off $p=10000$

python3 hinge_repl.py --a 1.2 --r 0.3 --s 0.5 --p 10000

Ridge classification

(Figs. 2 & 3)

  • CV_l2_simus.ipynb contains the code used to run the ridge classification experiments on Gaussian synthetic data, satisfying the source and capacity conditions (8).
  • hinge_repl.py implements the theoretical characterization (17) for the misclassification error $\epsilon_g$.

To run obtain the theoretical characterization for e.g. source $r=0.3$, capacity $\alpha=1.2$, noise level $\sigma=0.5$, using a large features dimension cut-off $p=10000$

python3 CV_l2_repl.py --a 1.2 --r 0.3 --s 0.5 --p 10000

Real data experiments

(Figs. 3)
The code implementing ridge (resp. SVM) classification on real data is provided in Real_l2.ipynb (resp. Real_mm.ipynb), from data stored in a --datasets/ folder.

Versions: These notebooks employ Python 3.12 , and Pytorch 2.5.

About

Code for the paper: Error rates for kernel classification under source and capacity conditions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages