-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfind_metrics.js
More file actions
36 lines (33 loc) · 1.44 KB
/
Copy pathfind_metrics.js
File metadata and controls
36 lines (33 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const fs = require('fs');
const path = require('path');
function searchNotebooks() {
const files = fs.readdirSync('notebooks').filter(f => f.endsWith('.ipynb'));
for (const file of files) {
try {
const nb = JSON.parse(fs.readFileSync(`notebooks/${file}`, 'utf8'));
let cellCounter = 0;
for (const cell of nb.cells) {
cellCounter++;
if (cell.outputs) {
for (const output of cell.outputs) {
if (output.text) {
const text = Array.isArray(output.text) ? output.text.join('') : output.text;
if (text.includes('0.9605') || text.includes('0.960') || text.includes('macro avg') || text.includes('MCC')) {
console.log(`\n--- Match found in ${file} (Cell ${cellCounter}) ---`);
const lines = text.split('\n');
lines.forEach(line => {
if (line.match(/accuracy|macro|weighted|mcc|0\.960|precision|recall/i)) {
console.log(line);
}
});
}
}
}
}
}
} catch (e) {
// Ignore parse errors for broken notebooks
}
}
}
searchNotebooks();