Skip to content

Commit 8bfb68a

Browse files
author
Luis Cañas-Díaz
committed
[model] NPM model version 0.2. Updates both notebook and Python code
Changes fix several issues found in 0.1 version. A new Python Notebook file is included, with the updated Python code to calculate the score. Main changes with respect to the previous three notebooks: - Fix: Join metrics and expert labels on SPDXID instead of the repository URL, which is not unique for packages living in the same monorepo. - Fix: Compute correlations only on the 166 labelled packages, on a signed log1p scale so a few giant repositories do not dominate them. - Improvement: Drop constant metrics (found_file_adopters, file_types_binary) and metrics derived from another one (commits_per_*, message_size_median, commit_size_removed_lines) before the correlation pass. - Improvement: Within each group of correlated metrics (|Pearson| > 0.8) keep the one with the highest univariate ROC AUC against the expert label, instead of the first column in metrics.json. - Improvement: Put StandardScaler and LogisticRegression in a Pipeline so scaling is fitted per fold; no more scaler_params.csv. - Improvement: Evaluate with 10-fold StratifiedGroupKFold grouped by repository (out-of-sample score for every package) instead of a single 75/25 split. - Add confusion matrix, classification report, misclassified packages, model weights and the distribution of the scores. Result on the current data: 11 of 32 metrics kept, 95.2% agreement with the expert (ROC AUC 0.971). Assisted-by: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Luis Cañas-Díaz <canasdiaz@aboutcode.org>
1 parent 4a92fed commit 8bfb68a

5 files changed

Lines changed: 1342 additions & 1625 deletions

File tree

0 commit comments

Comments
 (0)