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": "feature_importance",
  "method": "statsmodels",
  "dataset": "longley",
  "n": 16,
  "k": 6,
  "variable_names": [
    "GNP",
    "Unemployed",
    "Armed Forces",
    "Population",
    "Year",
    "Employed"
  ],
  "response": "GNP.deflator",
  "standardized_coefficients": {
    "variable_names": [
      "GNP",
      "Unemployed",
      "Armed Forces",
      "Population",
      "Year",
      "Employed"
    ],
    "standardized_coefficients": [
      2.4272014714815358,
      0.31591354072242517,
      0.07197475238361035,
      -1.119667902194419,
      -0.6259369556928599,
      0.0752695726135809
    ],
    "y_std": 41.79550663647948,
    "raw_coefficients": [
      0.26352724693255025,
      0.03648291369200263,
      0.011161050494472358,
      -1.7370298379331732,
      -1.4187985266985947,
      0.23128785076423242
    ]
  },
  "vif_ranking": {
    "variable_names": [
      "Armed Forces",
      "Unemployed",
      "Employed",
      "Population",
      "GNP",
      "Year"
    ],
    "vif_values": [
      12.156386301098246,
      83.95864609014245,
      220.4196816766494,
      230.91221480979843,
      1214.5721487549663,
      2065.7339385300716
    ],
    "ranking": [
      {
        "variable": "Armed Forces",
        "vif": 12.156386301098246,
        "rsquared": 0.9177387115519966,
        "interpretation": "High multicollinearity"
      },
      {
        "variable": "Unemployed",
        "vif": 83.95864609014245,
        "rsquared": 0.9880893743935991,
        "interpretation": "High multicollinearity"
      },
      {
        "variable": "Employed",
        "vif": 220.4196816766494,
        "rsquared": 0.9954632000536732,
        "interpretation": "High multicollinearity"
      },
      {
        "variable": "Population",
        "vif": 230.91221480979843,
        "rsquared": 0.995669349926665,
        "interpretation": "High multicollinearity"
      },
      {
        "variable": "GNP",
        "vif": 1214.5721487549663,
        "rsquared": 0.9991766648024779,
        "interpretation": "High multicollinearity"
      },
      {
        "variable": "Year",
        "vif": 2065.7339385300716,
        "rsquared": 0.9995159105529768,
        "interpretation": "High multicollinearity"
      }
    ]
  },
  "shap": {
    "variable_names": [
      "GNP",
      "Unemployed",
      "Armed Forces",
      "Population",
      "Year",
      "Employed"
    ],
    "shap_values": [
      [
        -40.427566717846126,
        -3.0547599670734935,
        -1.1347300524598865,
        17.05068488915201,
        10.64098895023946,
        -1.1550515267165782
      ],
      [
        -33.80328231170261,
        -3.1678569995187016,
        -1.2842881290858161,
        15.271966335108438,
        9.222190423540866,
        -0.9702525339559567
      ],
      [
        -34.16484169449407,
        1.7828743884860547,
        -1.1057113211742584,
        13.290015290026702,
        7.803391896842271,
        -1.190207280032742
      ],
      [
        -27.169510924669524,
        0.5752899452807689,
        -1.0677637494930523,
        11.282008797375944,
        6.384593370143676,
        -0.9552188236562821
      ],
      [
        -15.475225814790663,
        -3.9923708489579606,
        0.5494724671559922,
        9.291372603104525,
        4.965794843445082,
        -0.48477933520183364
      ],
      [
        -10.725410716078377,
        -4.6016355076144055,
        1.1019444666323739,
        7.215621946774395,
        3.546996316746487,
        -0.388101013582383
      ],
      [
        -5.880198753976517,
        -4.827829572504821,
        1.0494875293083539,
        4.047279522384291,
        2.128197790047892,
        -0.07586241505066892
      ],
      [
        -6.479196186254195,
        1.4034520860892281,
        0.8296148345672486,
        2.093120954709471,
        0.7093992633492974,
        -0.3598838957891467
      ],
      [
        2.574809436607426,
        -1.0554962967517503,
        0.49255110963418347,
        0.06253307416557193,
        -0.7093992633492974,
        0.16236407123649074
      ],
      [
        8.296249494760028,
        -1.3546561890261712,
        0.2793750451897612,
        -2.275509087692461,
        -2.128197790047892,
        0.5874711409411485
      ],
      [
        14.512593722651955,
        -0.9387509729373401,
        0.21352484727237456,
        -5.247567140396118,
        -3.546996316746487,
        0.6596329503795885
      ],
      [
        14.980881640451093,
        5.427517466317118,
        0.033831934311369334,
        -7.86179704648556,
        -4.965794843445082,
        0.2766202695140215
      ],
      [
        25.03655432890335,
        2.2608005578512897,
        -0.061036994891645706,
        -10.321431296998927,
        -6.384593370143676,
        0.7720388458510064
      ],
      [
        30.2799559611203,
        2.6912989394169213,
        -0.10344898677064047,
        -13.798965032541133,
        -7.803391896842271,
        0.9822795021956917
      ],
      [
        34.383602250353974,
        5.883553887467151,
        -0.03871489390270099,
        -18.11374714996715,
        -9.222190423540866,
        0.928389432967628
      ],
      [
        44.06058628496415,
        2.9685690834761402,
        0.24589189370634412,
        -21.985586658720166,
        -10.64098895023946,
        1.2105606108999913
      ]
    ],
    "base_value": 2946.856360185193,
    "mean_abs_shap": [
      21.765654139976522,
      2.874169544298083,
      0.5994617659722501,
      9.950575426600178,
      5.675194106794379,
      0.6974196029981973
    ]
  },
  "permutation_importance": {
    "variable_names": [
      "GNP",
      "Unemployed",
      "Armed Forces",
      "Population",
      "Year",
      "Employed"
    ],
    "importance": [
      0.004008269208238357,
      -0.0014419230898806256,
      -0.0005313056196234456,
      0.004754099105044185,
      -0.00033473523171484443,
      -0.001187850319917183
    ],
    "baseline_score": 0.9926473958221339,
    "n_permutations": 10,
    "seed": 42
  }
}