linreg-core 0.8.1

Lightweight regression library (OLS, Ridge, Lasso, Elastic Net, WLS, LOESS, Polynomial) with 14 diagnostic tests, cross validation, and prediction intervals. Pure Rust - no external math dependencies. WASM, Python, FFI, and Excel XLL bindings.
Documentation
{
  "test": "wls",
  "method": "statsmodels",
  "dataset": "prostate",
  "formula": "lcavol ~ lweight + age + lbph + svi + lcp + gleason + pgg45 + lpsa",
  "n": 97,
  "k": 8,
  "df_residual": 88,
  "df_model": 8,
  "variable_names": [
    "Intercept",
    "lweight",
    "age",
    "lbph",
    "svi",
    "lcp",
    "gleason",
    "pgg45",
    "lpsa"
  ],
  "coefficients": [
    -2.420612677468017,
    -0.02592501595313611,
    0.02211318860609609,
    -0.09313839276613638,
    -0.15296648397562806,
    0.3671799273581572,
    0.19724921786369295,
    -0.0071173479101549674,
    0.5658259787397043
  ],
  "std_errors": [
    1.2970274399030135,
    0.2118165727554283,
    0.011080045227358202,
    0.05805766826315426,
    0.25428873545773506,
    0.08181430071005688,
    0.1542066506012278,
    0.0043309299976101645,
    0.08806453056693662
  ],
  "t_stats": [
    -1.8662771526630313,
    -0.1223937089335788,
    1.995766998450105,
    -1.6042392943508164,
    -0.6015464416867667,
    4.487967557889574,
    1.2791226389695183,
    -1.6433763450534566,
    6.42512910813313
  ],
  "p_values": [
    0.06533334737744978,
    0.9028663006438177,
    0.04905161605048833,
    0.11224448077435399,
    0.5490226664749707,
    2.1671829385215447e-05,
    0.20421651738247687,
    0.10387352009159394,
    6.548216391611521e-09
  ],
  "r_squared": 0.6762746554982422,
  "adj_r_squared": 0.6468450787253551,
  "f_statistic": 22.979421712964676,
  "f_p_value": 1.4520660426755573e-18,
  "mse": 0.49058749077511726,
  "rmse": 0.7004195105614329,
  "mae": 0.5436760151030304,
  "residual_std_error": 0.7004195105614329,
  "log_likelihood": -98.37503596899982,
  "aic": 214.75007193799965,
  "bic": 237.9224707445301,
  "conf_int_lower": [
    -4.998182163195194,
    -0.44686594419327275,
    9.392702389616689e-05,
    -0.20851580848123308,
    -0.6583119106915193,
    0.20459119675881163,
    -0.10920409596568834,
    -0.015724161199698928,
    0.39081622969291646
  ],
  "conf_int_upper": [
    0.15695680825916014,
    0.3950159122870005,
    0.04413245018829601,
    0.022239022948960324,
    0.35237894274026316,
    0.5297686579575027,
    0.5037025316930742,
    0.0014894653793889922,
    0.7408357277864921
  ],
  "fitted_values": [
    -0.8269065985651027,
    -0.5124734376075949,
    -0.08746932094978437,
    -0.5115184377949292,
    -0.12474589766663075,
    -0.1619459722228907,
    -0.045119606094716824,
    -0.21502469021846005,
    -0.07686126867358667,
    0.2845967213545674,
    0.44377218593433854,
    0.1525685897601291,
    0.6878499209491858,
    0.7112721573888454,
    0.8581352073292283,
    0.5817973813045143,
    0.6998532754406749,
    1.238015220530677,
    0.08654552888688172,
    0.4531438177805863,
    0.526398343417197,
    1.3497084925971974,
    0.504816632441809,
    1.1984112157470026,
    0.5154470571425881,
    0.6481029396700279,
    0.6572837204443919,
    0.5487378563802461,
    0.8342448289498606,
    1.9084676929528117,
    0.7069740261491129,
    0.570112471082038,
    0.7634542963256812,
    0.6362224367920459,
    1.0671750141574416,
    0.7018551761161026,
    2.4537469672716874,
    1.0672384766635954,
    1.7533887292686272,
    1.2264465759085947,
    0.9507015276687776,
    1.2229657617889003,
    1.0327137124453305,
    1.9359627636587402,
    1.2946266218594953,
    0.9927483784758336,
    2.387233428893169,
    1.21021589124681,
    0.7095085332611832,
    1.26350782937318,
    1.1277868952044265,
    0.8812778236201868,
    1.1807537621067488,
    1.961816833036718,
    1.2885642273904692,
    1.0331113884070202,
    1.787273006922974,
    0.6883106818535298,
    1.2954758556457957,
    0.8862262134758595,
    1.1422365681427544,
    1.984125545601073,
    2.4951224341344247,
    1.956544917852012,
    1.3350104035390566,
    1.4198277424138313,
    1.8367627305349532,
    1.6793577918280265,
    1.4708670853536405,
    1.565085847763354,
    1.9330810847579487,
    1.4449724013562153,
    2.031872706708958,
    1.9358599839914061,
    2.7743288310565495,
    2.6523384488542057,
    1.9162559539936397,
    1.7191528322683887,
    2.776369054888991,
    2.151594472514331,
    2.074572503193262,
    2.515000218493073,
    2.4675054466533055,
    2.753202542101064,
    2.1470545084311894,
    2.742291760562683,
    1.3693212663837828,
    2.2171754752874238,
    2.9834060309848223,
    2.3284262131207942,
    2.0605064740372994,
    1.655998986944354,
    2.8789951080016305,
    2.970554298120165,
    3.7417396779810232,
    3.1699489128102827,
    4.249964183660828
  ],
  "residuals": [
    0.2470881035651027,
    -0.48177883539240507,
    -0.4233563030502156,
    -0.6924543662050707,
    0.8761619866666308,
    -0.8878761517771094,
    0.7822836720947168,
    0.90817187121846,
    -0.6996675203264133,
    -0.06145317035456738,
    -0.18912996793433856,
    -1.499642237760129,
    0.9255800130508142,
    0.7657765666111547,
    0.3478355996707716,
    0.9593616906954856,
    -1.115368719440675,
    1.050470948469323,
    -0.6486644468868817,
    -0.27082226078058635,
    0.6210041095828029,
    0.7095303414028025,
    -1.0495438074418089,
    0.5832979172529973,
    -0.13018465614258812,
    0.7988160433299721,
    -0.1444600944443919,
    -0.9492154233802461,
    0.20603188305013942,
    0.5011764720471883,
    -0.4217950841491129,
    -0.38779091408203803,
    0.5119085036743187,
    -0.626272105792046,
    -1.0772253501574416,
    0.6064776438838974,
    -1.0306386332716875,
    -0.6098136296635954,
    0.9075698647313726,
    -0.42893937990859476,
    -0.3301250396687776,
    0.2192362312110998,
    -0.45049809244533046,
    -0.1644060016587403,
    0.19151307414050467,
    0.6711777195241663,
    0.3406193991068309,
    -0.04706508124680986,
    1.0362069977388169,
    -0.042677908373180085,
    -0.03586359420442653,
    0.7788532033798132,
    -0.6679301361067488,
    0.16522368696328193,
    1.865026130609531,
    0.23383621459297976,
    -0.8127133669229741,
    -0.2245766658535298,
    -0.7531515646457957,
    0.1750302885241405,
    -0.6848117211427545,
    0.013292160398927111,
    0.2805864158655753,
    0.07816073014798808,
    0.7381615254609433,
    0.03878728058616865,
    0.18610845946504684,
    0.5189772801719734,
    -1.9171541883536405,
    -0.371163379763354,
    -0.06900095375794879,
    -0.2849514843562153,
    -0.8169599627089579,
    -0.09689891299140618,
    0.2248973319434504,
    0.4887920271457942,
    0.09463904500636033,
    0.8185043827316112,
    -0.1280688578889908,
    0.627845724485669,
    -0.606698155193262,
    -0.001344155493073096,
    0.14550120534669464,
    -0.07561154810106396,
    -0.5847082034311895,
    0.560557498437317,
    0.6548718006162173,
    -0.4855199302874238,
    -0.17581219998482212,
    -0.7660799081207943,
    1.1859845179627007,
    0.8769038610556459,
    -0.04872727400163068,
    0.8504493088798353,
    -0.8342923189810234,
    -0.28738533781028286,
    -0.7779977306608283
  ],
  "weights": [
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0
  ]
}