aprender-core 0.60.0

Next-generation machine learning library in pure Rust
//! Pinned scikit-learn `SVC(kernel='rbf')` reference fixture for the
//! `OBLIG-RBF-SVC-SKLEARN-PARITY` falsifier.
//!
//! Pre-computed OFFLINE (never recomputed at test time) on a fixed,
//! reproducible non-linearly-separable XOR-structured dataset, then pinned
//! here. `SKLEARN_GRID_PRED` is `sklearn.svm.SVC(kernel='rbf', gamma=0.5,
//! C=1.0).predict(grid)` over an 11x11 held-out grid spanning the data.
//!
//! Generation (for provenance — do NOT run at test time):
//! rng = RandomState(42); 4 clusters of 15 pts (sigma=0.35) at (+/-1.5, +/-1.5);
//! class 1 = top-left & bottom-right (XOR diagonal), class 0 = the other diagonal.
//! clf = SVC(kernel='rbf', gamma=0.5, C=1.0).fit(X, y)  # train_acc = 1.0
//! grid = meshgrid(linspace(-3, 3, 11), linspace(-3, 3, 11))
//! SKLEARN_GRID_PRED = clf.predict(grid)

// sklearn 1.9.0 SVC(kernel='rbf', gamma=0.5, C=1.0)
// train_acc=1.0, n_sv=15
pub const GAMMA: f32 = 0.5;
pub const C: f32 = 1.0;
pub const N_TRAIN: usize = 60;
pub const N_GRID: usize = 121;
#[rustfmt::skip]
pub const TRAIN_X: [f32; 120] = [
    -1.3261500597000122f32, -1.5483925342559814f32,
    -1.2733089923858643f32, -0.9669395685195923f32,
    -1.5819536447525024f32, -1.581947922706604f32,
    -0.9472755193710327f32, -1.2313978672027588f32,
    -1.6643160581588745f32, -1.3101040124893188f32,
    -1.662196159362793f32, -1.6630054712295532f32,
    -1.4153132438659668f32, -2.1696481704711914f32,
    -2.1037211418151855f32, -1.6968005895614624f32,
    -1.854490876197815f32, -1.3900134563446045f32,
    -1.8178083896636963f32, -1.9943063259124756f32,
    -0.9870229363441467f32, -1.579021692276001f32,
    -1.476365089416504f32, -1.9986618757247925f32,
    -1.690533995628357f32, -1.461177110671997f32,
    -1.9028477668762207f32, -1.3685057163238525f32,
    -1.7102235555648804f32, -1.6020928621292114f32,
    1.289402723312378f32, 2.1482973098754883f32,
    1.4952759742736816f32, 1.1298011541366577f32,
    1.7878906726837158f32, 1.0727046728134155f32,
    1.5731022357940674f32, 0.8141154646873474f32,
    1.0351349115371704f32, 1.5689014196395874f32,
    1.7584632635116577f32, 1.5599788427352905f32,
    1.45952308177948f32, 1.3946137428283691f32,
    0.9825173020362854f32, 1.2480545043945312f32,
    1.3387764692306519f32, 1.869992733001709f32,
    1.6202664375305176f32, 0.8829359412193298f32,
    1.6134294271469116f32, 1.3652211427688599f32,
    1.2630772590637207f32, 1.714086651802063f32,
    1.8608498573303223f32, 1.8259479999542236f32,
    1.2062739133834839f32, 1.3917757272720337f32,
    1.6159422397613525f32, 1.8414407968521118f32,
    -1.6677110195159912f32, 1.4350193738937378f32,
    -1.8872172832489014f32, 1.0813276767730713f32,
    -1.21561598777771f32, 1.9746840000152588f32,
    -1.5252035856246948f32, 1.8512364625930786f32,
    -1.373427391052246f32, 1.2742080688476562f32,
    -1.373511552810669f32, 2.0383129119873047f32,
    -1.5125391483306885f32, 2.0476253032684326f32,
    -2.4169108867645264f32, 1.787665843963623f32,
    -1.4695335626602173f32, 1.3953474760055542f32,
    -1.4678837060928345f32, 0.8043508529663086f32,
    -1.5768851041793823f32, 1.62498939037323f32,
    -0.9827370643615723f32, 1.3186054229736328f32,
    -1.782972812652588f32, 1.3243850469589233f32,
    -1.1796092987060547f32, 1.6150628328323364f32,
    -1.6854161024093628f32, 1.6796436309814453f32,
    1.5339771509170532f32, -1.1609742641448975f32,
    1.2542814016342163f32, -1.6146817207336426f32,
    1.3627620935440063f32, -2.012230157852173f32,
    1.6036421060562134f32, -1.408630609512329f32,
    1.5017896890640259f32, -1.5821055173873901f32,
    1.0046201944351196f32, -1.6472258567810059f32,
    1.3800499439239502f32, -1.780797004699707f32,
    1.4435499906539917f32, -1.3585822582244873f32,
    2.1601650714874268f32, -1.438897728919983f32,
    1.5901426076889038f32, -1.5260560512542725f32,
    0.8284300565719604f32, -1.5092798471450806f32,
    1.5210806131362915f32, -0.6378652453422546f32,
    1.432673692703247f32, -1.3944584131240845f32,
    1.4878509044647217f32, -1.9090373516082764f32,
    1.8999879360198975f32, -1.2368234395980835f32,
];
#[rustfmt::skip]
pub const TRAIN_Y: [usize; 60] = [
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
];
#[rustfmt::skip]
pub const GRID_X: [f32; 242] = [
    -3.0f32, -3.0f32,
    -2.4000000953674316f32, -3.0f32,
    -1.7999999523162842f32, -3.0f32,
    -1.2000000476837158f32, -3.0f32,
    -0.6000000238418579f32, -3.0f32,
    0.0f32, -3.0f32,
    0.6000000238418579f32, -3.0f32,
    1.2000000476837158f32, -3.0f32,
    1.7999999523162842f32, -3.0f32,
    2.4000000953674316f32, -3.0f32,
    3.0f32, -3.0f32,
    -3.0f32, -2.4000000953674316f32,
    -2.4000000953674316f32, -2.4000000953674316f32,
    -1.7999999523162842f32, -2.4000000953674316f32,
    -1.2000000476837158f32, -2.4000000953674316f32,
    -0.6000000238418579f32, -2.4000000953674316f32,
    0.0f32, -2.4000000953674316f32,
    0.6000000238418579f32, -2.4000000953674316f32,
    1.2000000476837158f32, -2.4000000953674316f32,
    1.7999999523162842f32, -2.4000000953674316f32,
    2.4000000953674316f32, -2.4000000953674316f32,
    3.0f32, -2.4000000953674316f32,
    -3.0f32, -1.7999999523162842f32,
    -2.4000000953674316f32, -1.7999999523162842f32,
    -1.7999999523162842f32, -1.7999999523162842f32,
    -1.2000000476837158f32, -1.7999999523162842f32,
    -0.6000000238418579f32, -1.7999999523162842f32,
    0.0f32, -1.7999999523162842f32,
    0.6000000238418579f32, -1.7999999523162842f32,
    1.2000000476837158f32, -1.7999999523162842f32,
    1.7999999523162842f32, -1.7999999523162842f32,
    2.4000000953674316f32, -1.7999999523162842f32,
    3.0f32, -1.7999999523162842f32,
    -3.0f32, -1.2000000476837158f32,
    -2.4000000953674316f32, -1.2000000476837158f32,
    -1.7999999523162842f32, -1.2000000476837158f32,
    -1.2000000476837158f32, -1.2000000476837158f32,
    -0.6000000238418579f32, -1.2000000476837158f32,
    0.0f32, -1.2000000476837158f32,
    0.6000000238418579f32, -1.2000000476837158f32,
    1.2000000476837158f32, -1.2000000476837158f32,
    1.7999999523162842f32, -1.2000000476837158f32,
    2.4000000953674316f32, -1.2000000476837158f32,
    3.0f32, -1.2000000476837158f32,
    -3.0f32, -0.6000000238418579f32,
    -2.4000000953674316f32, -0.6000000238418579f32,
    -1.7999999523162842f32, -0.6000000238418579f32,
    -1.2000000476837158f32, -0.6000000238418579f32,
    -0.6000000238418579f32, -0.6000000238418579f32,
    0.0f32, -0.6000000238418579f32,
    0.6000000238418579f32, -0.6000000238418579f32,
    1.2000000476837158f32, -0.6000000238418579f32,
    1.7999999523162842f32, -0.6000000238418579f32,
    2.4000000953674316f32, -0.6000000238418579f32,
    3.0f32, -0.6000000238418579f32,
    -3.0f32, 0.0f32,
    -2.4000000953674316f32, 0.0f32,
    -1.7999999523162842f32, 0.0f32,
    -1.2000000476837158f32, 0.0f32,
    -0.6000000238418579f32, 0.0f32,
    0.0f32, 0.0f32,
    0.6000000238418579f32, 0.0f32,
    1.2000000476837158f32, 0.0f32,
    1.7999999523162842f32, 0.0f32,
    2.4000000953674316f32, 0.0f32,
    3.0f32, 0.0f32,
    -3.0f32, 0.6000000238418579f32,
    -2.4000000953674316f32, 0.6000000238418579f32,
    -1.7999999523162842f32, 0.6000000238418579f32,
    -1.2000000476837158f32, 0.6000000238418579f32,
    -0.6000000238418579f32, 0.6000000238418579f32,
    0.0f32, 0.6000000238418579f32,
    0.6000000238418579f32, 0.6000000238418579f32,
    1.2000000476837158f32, 0.6000000238418579f32,
    1.7999999523162842f32, 0.6000000238418579f32,
    2.4000000953674316f32, 0.6000000238418579f32,
    3.0f32, 0.6000000238418579f32,
    -3.0f32, 1.2000000476837158f32,
    -2.4000000953674316f32, 1.2000000476837158f32,
    -1.7999999523162842f32, 1.2000000476837158f32,
    -1.2000000476837158f32, 1.2000000476837158f32,
    -0.6000000238418579f32, 1.2000000476837158f32,
    0.0f32, 1.2000000476837158f32,
    0.6000000238418579f32, 1.2000000476837158f32,
    1.2000000476837158f32, 1.2000000476837158f32,
    1.7999999523162842f32, 1.2000000476837158f32,
    2.4000000953674316f32, 1.2000000476837158f32,
    3.0f32, 1.2000000476837158f32,
    -3.0f32, 1.7999999523162842f32,
    -2.4000000953674316f32, 1.7999999523162842f32,
    -1.7999999523162842f32, 1.7999999523162842f32,
    -1.2000000476837158f32, 1.7999999523162842f32,
    -0.6000000238418579f32, 1.7999999523162842f32,
    0.0f32, 1.7999999523162842f32,
    0.6000000238418579f32, 1.7999999523162842f32,
    1.2000000476837158f32, 1.7999999523162842f32,
    1.7999999523162842f32, 1.7999999523162842f32,
    2.4000000953674316f32, 1.7999999523162842f32,
    3.0f32, 1.7999999523162842f32,
    -3.0f32, 2.4000000953674316f32,
    -2.4000000953674316f32, 2.4000000953674316f32,
    -1.7999999523162842f32, 2.4000000953674316f32,
    -1.2000000476837158f32, 2.4000000953674316f32,
    -0.6000000238418579f32, 2.4000000953674316f32,
    0.0f32, 2.4000000953674316f32,
    0.6000000238418579f32, 2.4000000953674316f32,
    1.2000000476837158f32, 2.4000000953674316f32,
    1.7999999523162842f32, 2.4000000953674316f32,
    2.4000000953674316f32, 2.4000000953674316f32,
    3.0f32, 2.4000000953674316f32,
    -3.0f32, 3.0f32,
    -2.4000000953674316f32, 3.0f32,
    -1.7999999523162842f32, 3.0f32,
    -1.2000000476837158f32, 3.0f32,
    -0.6000000238418579f32, 3.0f32,
    0.0f32, 3.0f32,
    0.6000000238418579f32, 3.0f32,
    1.2000000476837158f32, 3.0f32,
    1.7999999523162842f32, 3.0f32,
    2.4000000953674316f32, 3.0f32,
    3.0f32, 3.0f32,
];
#[rustfmt::skip]
pub const SKLEARN_GRID_PRED: [usize; 121] = [
    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
    1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
    1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
    1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
    1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
];