
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
When called, the importance
function shuffles each feature n
times and computes the difference between the base score (calculated with original features X
and target variable y
) and permuted data. Intuitively that measures how the performance of a model decreases when we "remove" the feature.
// Create and train a model first
const rf = new RandomForestRegressor({
maxDepth: 20,
nEstimators: 50
})
rf.train(X, y)
// Get feature importance
const imp = importance(rf, X, y, {
kind: 'mse',
n: 10,
means: true,
verbose: false
})
console.log(impsRF)
You can also check example.js
in this repo that uses the random-forest package as a predictive model.
importance(model, X, y, options)
model
- trained model with predict
method (predictProba
if cross-entropy used as score)X
- 2D array of featuresy
- 1D array of target variablesOptions:
kind
- scoring function (mse
, mae
, rmse
, smape
, acc
, ce
(cross-entropy)n
- number of times each feature is shuffled.means
- if true
returns only average importanceverbose
- if true
throws some info into consoleFeature importance is often used for variable selection. Permutation-based importance is a good method for that goal, but if you need more robust selection method check boruta.js
The importance
package is used for feature selection on StatSim Select and for data visualization on StatSim Vis
FAQs
Permutation feature importance
The npm package importance receives a total of 35 weekly downloads. As such, importance popularity was classified as not popular.
We found that importance demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.