
Security News
PyPI Expands Trusted Publishing to GitLab Self-Managed as Adoption Passes 25 Percent
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads
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
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.