@iyulab/mloop-mcp 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/build/server.d.ts.map +1 -1
- package/build/server.js +3 -1
- package/build/server.js.map +1 -1
- package/build/tools/calibrate.d.ts +66 -0
- package/build/tools/calibrate.d.ts.map +1 -0
- package/build/tools/calibrate.js +64 -0
- package/build/tools/calibrate.js.map +1 -0
- package/build/tools/detect.d.ts +0 -5
- package/build/tools/detect.d.ts.map +1 -1
- package/build/tools/detect.js +6 -13
- package/build/tools/detect.js.map +1 -1
- package/build/tools/drift.js +1 -1
- package/build/tools/drift.js.map +1 -1
- package/build/tools/feedback.d.ts +15 -2
- package/build/tools/feedback.d.ts.map +1 -1
- package/build/tools/feedback.js +41 -17
- package/build/tools/feedback.js.map +1 -1
- package/build/tools/index.d.ts +4 -0
- package/build/tools/index.d.ts.map +1 -1
- package/build/tools/index.js +2 -0
- package/build/tools/index.js.map +1 -1
- package/build/tools/predict.d.ts +5 -0
- package/build/tools/predict.d.ts.map +1 -1
- package/build/tools/predict.js +10 -2
- package/build/tools/predict.js.map +1 -1
- package/build/tools/prep.d.ts +17 -2
- package/build/tools/prep.d.ts.map +1 -1
- package/build/tools/prep.js +26 -7
- package/build/tools/prep.js.map +1 -1
- package/build/tools/sample.d.ts +18 -1
- package/build/tools/sample.d.ts.map +1 -1
- package/build/tools/sample.js +41 -18
- package/build/tools/sample.js.map +1 -1
- package/build/tools/threshold.d.ts +5 -0
- package/build/tools/threshold.d.ts.map +1 -1
- package/build/tools/threshold.js +6 -2
- package/build/tools/threshold.js.map +1 -1
- package/build/tools/train.d.ts +8 -0
- package/build/tools/train.d.ts.map +1 -1
- package/build/tools/train.js +11 -1
- package/build/tools/train.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -76,10 +76,11 @@ plugins:
|
|
|
76
76
|
| `mloop_promote` | Promote an experiment to production (explicit ID, `latest`, or `best`); a model the quality gate refuses needs `force`; `history` lists every change of production with the gate outcome (mloop >= 0.39) |
|
|
77
77
|
| `mloop_rollback` | Return production to the experiment it held before (or `to` a former production experiment) |
|
|
78
78
|
| `mloop_threshold` | Choose a binary model's decision threshold for a target precision on labeled rows, show it, or clear it (mloop >= 0.39) |
|
|
79
|
+
| `mloop_calibrate` | Fit a classifier's probability calibration (binary platt · isotonic, multiclass temperature) on labeled rows without retraining, show it, or clear it (mloop >= 0.40) |
|
|
79
80
|
| `mloop_export_onnx` | Model as ONNX + manifest (inputs and their data columns, outputs, classes, hashes) for runtimes without ML.NET |
|
|
80
81
|
| `mloop_info` | Analyze and profile datasets |
|
|
81
82
|
| `mloop_analyze` | Run one read-only EDA aspect (profile/correlation/importance/outliers/distribution) as structured JSON |
|
|
82
|
-
| `mloop_drift` | Recent inputs and answers vs the training data — PSI per column, for the answers (mloop >= 0.39), per slice, as JSON (mloop >= 0.38) |
|
|
83
|
+
| `mloop_drift` | Recent inputs and answers vs the training data — PSI per column, for the answers (mloop >= 0.39), for free-text columns by length and unseen words (mloop >= 0.40), per slice, as JSON (mloop >= 0.38) |
|
|
83
84
|
| `mloop_detect` | One-shot time-series anomaly detection with SPC bounds — no training, no project required (mloop >= 0.21) |
|
|
84
85
|
| `mloop_prep_plan` | Declare a preprocessing step in mloop.yaml (policy only, no data change) as structured JSON |
|
|
85
86
|
| `mloop_features_select` | Declare feature include/exclude in mloop.yaml (policy only, no data change) as structured JSON |
|
|
@@ -169,8 +170,15 @@ npm start
|
|
|
169
170
|
|
|
170
171
|
# Test with MCP Inspector
|
|
171
172
|
npx @modelcontextprotocol/inspector node build/index.js
|
|
173
|
+
|
|
174
|
+
# Check that every tool passes the CLI only options it has (needs the mloop CLI; pass its path if not on PATH)
|
|
175
|
+
npm run check:cli -- /path/to/mloop
|
|
172
176
|
```
|
|
173
177
|
|
|
178
|
+
`check:cli` calls each tool with its schema filled in against a stand-in that records the command line, then compares
|
|
179
|
+
every option and argument with the real CLI's `--help`. Run it before a release and whenever a tool or the CLI's
|
|
180
|
+
options change — a tool passing an option the CLI does not have fails only when an agent calls it.
|
|
181
|
+
|
|
174
182
|
## Architecture
|
|
175
183
|
|
|
176
184
|
```
|
package/build/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAmCpE;;GAEG;AACH,wBAAgB,YAAY,IAAI,SAAS,CA6OxC"}
|
package/build/server.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
5
|
import {
|
|
6
6
|
// Existing tools
|
|
7
|
-
trainTool, train, trainSchema, predictTool, predict, predictSchema, listTool, list, listSchema, promoteTool, promote, promoteSchema, rollbackTool, rollback, rollbackSchema, thresholdTool, threshold, thresholdSchema, exportOnnxTool, exportOnnx, exportOnnxSchema, infoTool, info, infoSchema, statusTool, status, statusSchema, compareTool, compare, compareSchema, evaluateTool, evaluate, evaluateSchema, serveTool, serve, serveSchema,
|
|
7
|
+
trainTool, train, trainSchema, predictTool, predict, predictSchema, listTool, list, listSchema, promoteTool, promote, promoteSchema, rollbackTool, rollback, rollbackSchema, thresholdTool, threshold, thresholdSchema, calibrateTool, calibrate, calibrateSchema, exportOnnxTool, exportOnnx, exportOnnxSchema, infoTool, info, infoSchema, statusTool, status, statusSchema, compareTool, compare, compareSchema, evaluateTool, evaluate, evaluateSchema, serveTool, serve, serveSchema,
|
|
8
8
|
// New basic tools
|
|
9
9
|
initTool, init, initSchema, validateTool, validate, validateSchema, prepTool, prep, prepSchema, logsTool, logs, logsSchema, feedbackTool, feedback, feedbackSchema, sampleTool, sample, sampleSchema, triggerTool, trigger, triggerSchema, driftTool, drift, driftSchema, analyzeTool, analyze, analyzeSchema, detectTool, detect, detectSchema, prepPlanTool, prepPlan, prepPlanSchema, featuresSelectTool, featuresSelect, featuresSelectSchema,
|
|
10
10
|
// Composite workflow tools
|
|
@@ -30,6 +30,8 @@ export function createServer() {
|
|
|
30
30
|
server.tool(rollbackTool.name, rollbackTool.description, rollbackSchema.shape, async (params) => rollback(params));
|
|
31
31
|
// Register mloop_threshold
|
|
32
32
|
server.tool(thresholdTool.name, thresholdTool.description, thresholdSchema.shape, async (params) => threshold(params));
|
|
33
|
+
// Register mloop_calibrate
|
|
34
|
+
server.tool(calibrateTool.name, calibrateTool.description, calibrateSchema.shape, async (params) => calibrate(params));
|
|
33
35
|
// Register mloop_export_onnx
|
|
34
36
|
server.tool(exportOnnxTool.name, exportOnnxTool.description, exportOnnxSchema.shape, async (params) => exportOnnx(params));
|
|
35
37
|
// Register mloop_info
|
package/build/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO;AACL,iBAAiB;AACjB,SAAS,EAAE,KAAK,EAAE,WAAW,EAC7B,WAAW,EAAE,OAAO,EAAE,aAAa,EACnC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAC1B,WAAW,EAAE,OAAO,EAAE,aAAa,EACnC,YAAY,EAAE,QAAQ,EAAE,cAAc,EACtC,aAAa,EAAE,SAAS,EAAE,eAAe,EACzC,cAAc,EAAE,UAAU,EAAE,gBAAgB,EAC5C,QAAQ,EAAE,IAAI,EAAE,UAAU,EAC1B,UAAU,EAAE,MAAM,EAAE,YAAY,EAChC,WAAW,EAAE,OAAO,EAAE,aAAa,EACnC,YAA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,CAAC,IAAI,CACT,cAAc,CAAC,IAAI,EACnB,cAAc,CAAC,WAAW,EAC1B,gBAAgB,CAAC,KAAK,EACtB,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,MAA0C,CAAC,CACzE,CAAC;IAEF,4BAA4B;IAC5B,MAAM,CAAC,IAAI,CACT,aAAa,CAAC,IAAI,EAClB,aAAa,CAAC,WAAW,EACzB,eAAe,CAAC,KAAK,EACrB,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,MAAyC,CAAC,CACvE,CAAC;IAEF,kCAAkC;IAClC,MAAM,CAAC,IAAI,CACT,mBAAmB,CAAC,IAAI,EACxB,mBAAmB,CAAC,WAAW,EAC/B,qBAAqB,CAAC,KAAK,EAC3B,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,eAAe,CAAC,MAA+C,CAAC,CACnF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_calibrate tool - Fit, show or remove a binary classifier's probability calibration
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export declare const calibrateSchema: z.ZodObject<{
|
|
6
|
+
projectPath: z.ZodString;
|
|
7
|
+
experimentId: z.ZodOptional<z.ZodString>;
|
|
8
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
9
|
+
dataFile: z.ZodOptional<z.ZodString>;
|
|
10
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
platt: "platt";
|
|
12
|
+
isotonic: "isotonic";
|
|
13
|
+
temperature: "temperature";
|
|
14
|
+
}>>;
|
|
15
|
+
weight: z.ZodOptional<z.ZodString>;
|
|
16
|
+
clear: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type CalibrateParams = z.infer<typeof calibrateSchema>;
|
|
19
|
+
export declare function calibrate(params: CalibrateParams): Promise<{
|
|
20
|
+
content: Array<{
|
|
21
|
+
type: 'text';
|
|
22
|
+
text: string;
|
|
23
|
+
}>;
|
|
24
|
+
isError?: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const calibrateTool: {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
inputSchema: {
|
|
30
|
+
type: string;
|
|
31
|
+
properties: {
|
|
32
|
+
projectPath: {
|
|
33
|
+
type: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
experimentId: {
|
|
37
|
+
type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
modelName: {
|
|
41
|
+
type: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
dataFile: {
|
|
45
|
+
type: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
method: {
|
|
49
|
+
type: string;
|
|
50
|
+
enum: string[];
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
weight: {
|
|
54
|
+
type: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
clear: {
|
|
58
|
+
type: string;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
required: string[];
|
|
63
|
+
};
|
|
64
|
+
handler: typeof calibrate;
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=calibrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calibrate.d.ts","sourceRoot":"","sources":["../../src/tools/calibrate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,eAAe;;;;;;;;;;;;iBAQ1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,wBAAsB,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAwBvI;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBzB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_calibrate tool - Fit, show or remove a binary classifier's probability calibration
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { executeMloop } from '../executor.js';
|
|
6
|
+
import { parseCliOutput } from '../utils/parser.js';
|
|
7
|
+
import { formatError } from '../utils/errors.js';
|
|
8
|
+
export const calibrateSchema = z.object({
|
|
9
|
+
projectPath: z.string().describe('Path to MLoop project directory'),
|
|
10
|
+
experimentId: z.string().optional().describe('Experiment to calibrate (default: the production model)'),
|
|
11
|
+
modelName: z.string().optional().describe('Model name'),
|
|
12
|
+
dataFile: z.string().optional().describe('Labeled rows the calibration is fit on — rows the model was not trained on'),
|
|
13
|
+
method: z.enum(['platt', 'isotonic', 'temperature']).optional().describe('Binary: platt (default; steady on a few hundred rows) or isotonic (no shape assumed, needs more rows). Multiclass: temperature (default; answers unchanged)'),
|
|
14
|
+
weight: z.string().optional().describe('Column that weights the rows (1/π for a recheck sample)'),
|
|
15
|
+
clear: z.boolean().optional().describe('Remove the calibration: the model answers with its own probabilities again'),
|
|
16
|
+
});
|
|
17
|
+
export async function calibrate(params) {
|
|
18
|
+
try {
|
|
19
|
+
const { projectPath, experimentId, modelName, dataFile, method, weight, clear } = params;
|
|
20
|
+
const args = ['calibrate'];
|
|
21
|
+
if (experimentId)
|
|
22
|
+
args.push(experimentId);
|
|
23
|
+
if (modelName)
|
|
24
|
+
args.push('--name', modelName);
|
|
25
|
+
if (dataFile)
|
|
26
|
+
args.push('--data', dataFile);
|
|
27
|
+
if (method)
|
|
28
|
+
args.push('--method', method);
|
|
29
|
+
if (weight)
|
|
30
|
+
args.push('--weight', weight);
|
|
31
|
+
if (clear)
|
|
32
|
+
args.push('--clear');
|
|
33
|
+
args.push('--json');
|
|
34
|
+
const result = await executeMloop(args, { cwd: projectPath });
|
|
35
|
+
return {
|
|
36
|
+
content: [{ type: 'text', text: parseCliOutput(result.stdout) || 'No calibration output.' }],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
return {
|
|
41
|
+
content: [{ type: 'text', text: formatError(error) }],
|
|
42
|
+
isError: true,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export const calibrateTool = {
|
|
47
|
+
name: 'mloop_calibrate',
|
|
48
|
+
description: 'A classifier\'s probability calibration, as JSON. With dataFile, fits a map from the model\'s own probability to how often it is right on those labeled rows (binary: platt or isotonic; multiclass: temperature, answers unchanged; weighted rows allowed) and writes it beside the model without retraining — predict, serve, evaluate (its ECE) and a threshold chosen afterwards then read calibrated probabilities, and promote carries it. Reports ECE before and after on the fit rows (in-sample). Refused while the model has a decision threshold (clear it, calibrate, choose it again). Without dataFile, shows the current one; with clear, removes it (mloop >= 0.40).',
|
|
49
|
+
inputSchema: {
|
|
50
|
+
type: 'object',
|
|
51
|
+
properties: {
|
|
52
|
+
projectPath: { type: 'string', description: 'Path to MLoop project directory' },
|
|
53
|
+
experimentId: { type: 'string', description: 'Experiment (default: production)' },
|
|
54
|
+
modelName: { type: 'string', description: 'Model name for namespacing' },
|
|
55
|
+
dataFile: { type: 'string', description: 'Labeled rows to fit on' },
|
|
56
|
+
method: { type: 'string', enum: ['platt', 'isotonic', 'temperature'], description: 'Calibration method (default: platt for binary, temperature for multiclass)' },
|
|
57
|
+
weight: { type: 'string', description: 'Column that weights the rows' },
|
|
58
|
+
clear: { type: 'boolean', description: 'Remove the calibration' },
|
|
59
|
+
},
|
|
60
|
+
required: ['projectPath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AAE,spBAAspB;IACnqB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iCAAiC,EAAE;YAC/E,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kCAAkC,EAAE;YACjF,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;YACxE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;YACnE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,WAAW,EAAE,4EAA4E,EAAE;YACjK,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8BAA8B,EAAE;YACvE,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,wBAAwB,EAAE;SAClE;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;IACD,OAAO,EAAE,SAAS;CACnB,CAAC"}
|
package/build/tools/detect.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export declare const detectSchema: z.ZodObject<{
|
|
|
7
7
|
column: z.ZodOptional<z.ZodString>;
|
|
8
8
|
threshold: z.ZodOptional<z.ZodNumber>;
|
|
9
9
|
sensitivity: z.ZodOptional<z.ZodNumber>;
|
|
10
|
-
period: z.ZodOptional<z.ZodNumber>;
|
|
11
10
|
output: z.ZodOptional<z.ZodString>;
|
|
12
11
|
}, z.core.$strip>;
|
|
13
12
|
export type DetectParams = z.infer<typeof detectSchema>;
|
|
@@ -40,10 +39,6 @@ export declare const detectTool: {
|
|
|
40
39
|
type: string;
|
|
41
40
|
description: string;
|
|
42
41
|
};
|
|
43
|
-
period: {
|
|
44
|
-
type: string;
|
|
45
|
-
description: string;
|
|
46
|
-
};
|
|
47
42
|
output: {
|
|
48
43
|
type: string;
|
|
49
44
|
description: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/tools/detect.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/tools/detect.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,YAAY;;;;;;iBAMvB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,wBAAsB,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAmCjI;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BtB,CAAC"}
|
package/build/tools/detect.js
CHANGED
|
@@ -9,14 +9,13 @@ import * as path from 'node:path';
|
|
|
9
9
|
export const detectSchema = z.object({
|
|
10
10
|
dataPath: z.string().describe('Path to the CSV file containing the time series'),
|
|
11
11
|
column: z.string().optional().describe('Value column to monitor (auto-selected when the CSV has a single column)'),
|
|
12
|
-
threshold: z.number().optional().describe(
|
|
13
|
-
sensitivity: z.number().optional().describe('
|
|
14
|
-
period: z.number().optional().describe('Seasonality period in points (default: auto-detect; 0 = non-seasonal)'),
|
|
12
|
+
threshold: z.number().positive().optional().describe("Score above which a point is an anomaly (> 0; the score is a point's saliency relative to the points before it; default 3)"),
|
|
13
|
+
sensitivity: z.number().gt(0).lt(100).optional().describe('Coverage of the control limits in percent (0-100, exclusive; 99.73 = 3 sigma; default 99.73)'),
|
|
15
14
|
output: z.string().optional().describe('Also write the full per-point result to this CSV file'),
|
|
16
15
|
});
|
|
17
16
|
export async function detect(params) {
|
|
18
17
|
try {
|
|
19
|
-
const { dataPath, column, threshold, sensitivity,
|
|
18
|
+
const { dataPath, column, threshold, sensitivity, output } = params;
|
|
20
19
|
const cliParams = {};
|
|
21
20
|
if (column)
|
|
22
21
|
cliParams['column'] = column;
|
|
@@ -24,8 +23,6 @@ export async function detect(params) {
|
|
|
24
23
|
cliParams['threshold'] = threshold;
|
|
25
24
|
if (sensitivity !== undefined)
|
|
26
25
|
cliParams['sensitivity'] = sensitivity;
|
|
27
|
-
if (period !== undefined)
|
|
28
|
-
cliParams['period'] = period;
|
|
29
26
|
if (output)
|
|
30
27
|
cliParams['output'] = output;
|
|
31
28
|
cliParams['json'] = true;
|
|
@@ -54,7 +51,7 @@ export async function detect(params) {
|
|
|
54
51
|
}
|
|
55
52
|
export const detectTool = {
|
|
56
53
|
name: 'mloop_detect',
|
|
57
|
-
description: 'One-shot time-series anomaly detection over an entire CSV series (
|
|
54
|
+
description: 'One-shot time-series anomaly detection over an entire CSV series (spectral residual, no training, no MLoop project required). Every point returns an anomaly verdict (isAnomaly), its score, an expectedValue and control limits (controlLower/controlUpper — the chartable band normal points lie inside); nearEdge marks points too close to the end of the series to judge as surely. Use this instead of train+predict when analyzing a whole series once.',
|
|
58
55
|
inputSchema: {
|
|
59
56
|
type: 'object',
|
|
60
57
|
properties: {
|
|
@@ -68,15 +65,11 @@ export const detectTool = {
|
|
|
68
65
|
},
|
|
69
66
|
threshold: {
|
|
70
67
|
type: 'number',
|
|
71
|
-
description:
|
|
68
|
+
description: "Score above which a point is an anomaly (> 0; the score is a point's saliency relative to the points before it; default 3)",
|
|
72
69
|
},
|
|
73
70
|
sensitivity: {
|
|
74
71
|
type: 'number',
|
|
75
|
-
description: '
|
|
76
|
-
},
|
|
77
|
-
period: {
|
|
78
|
-
type: 'number',
|
|
79
|
-
description: 'Seasonality period in points (default: auto-detect; 0 = non-seasonal)',
|
|
72
|
+
description: 'Coverage of the control limits in percent (0-100, exclusive; 99.73 = 3 sigma; default 99.73)',
|
|
80
73
|
},
|
|
81
74
|
output: {
|
|
82
75
|
type: 'string',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect.js","sourceRoot":"","sources":["../../src/tools/detect.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;IAChF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0EAA0E,CAAC;IAClH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"detect.js","sourceRoot":"","sources":["../../src/tools/detect.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,IAA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|
package/build/tools/drift.js
CHANGED
|
@@ -40,7 +40,7 @@ export async function drift(params) {
|
|
|
40
40
|
}
|
|
41
41
|
export const driftTool = {
|
|
42
42
|
name: 'mloop_drift',
|
|
43
|
-
description: 'How far the production model\'s recent inputs (its own logged predictions) have moved from the data it was trained on, as JSON: status (Measured, NoProduction, NoProfile, TooFewRows), and per column the population stability index (PSI — under 0.1 stable, 0.1–0.25 moderate, 0.25+ significant), its level and the bin that moved most with its training and current share; plus, under drift.prediction, the same measure for the model\'s own answers against its answers at training (predicted class, or predicted value by decile; null when the model has no answer profile — mloop >= 0.39). With sliceBy, the same per value of an input column. Answers that move while inputs hold mean the mix of requests shifted inside known ranges. Use it to decide where to look harder or whether to retrain (mloop >= 0.38).',
|
|
43
|
+
description: 'How far the production model\'s recent inputs (its own logged predictions) have moved from the data it was trained on, as JSON: status (Measured, NoProduction, NoProfile, TooFewRows), and per column the population stability index (PSI — under 0.1 stable, 0.1–0.25 moderate, 0.25+ significant), its level and the bin that moved most with its training and current share; plus, under drift.prediction, the same measure for the model\'s own answers against its answers at training (predicted class, or predicted value by decile; null when the model has no answer profile — mloop >= 0.39). A free-text column appears as two columns, "<column> (length)" and "<column> (unseen words)" — the share of words training never saw, the one that moves when the text changes subject (mloop >= 0.40). With sliceBy, the same per value of an input column. Answers that move while inputs hold mean the mix of requests shifted inside known ranges. Use it to decide where to look harder or whether to retrain (mloop >= 0.38).',
|
|
44
44
|
inputSchema: {
|
|
45
45
|
type: 'object',
|
|
46
46
|
properties: {
|
package/build/tools/drift.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drift.js","sourceRoot":"","sources":["../../src/tools/drift.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OA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,EAAE,CAAC,aAAa,CAAC;KAC1B;IACD,OAAO,EAAE,KAAK;CACf,CAAC"}
|
|
@@ -10,10 +10,14 @@ export declare const feedbackSchema: z.ZodObject<{
|
|
|
10
10
|
metrics: "metrics";
|
|
11
11
|
}>;
|
|
12
12
|
modelName: z.ZodOptional<z.ZodString>;
|
|
13
|
-
value: z.ZodOptional<z.ZodString>;
|
|
14
13
|
predictionId: z.ZodOptional<z.ZodString>;
|
|
14
|
+
value: z.ZodOptional<z.ZodString>;
|
|
15
|
+
source: z.ZodOptional<z.ZodString>;
|
|
16
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
15
17
|
}, z.core.$strip>;
|
|
16
18
|
export type FeedbackParams = z.infer<typeof feedbackSchema>;
|
|
19
|
+
/** The CLI arguments for one call — the option names `mloop feedback <action>` accepts. */
|
|
20
|
+
export declare function feedbackArgs(params: FeedbackParams): string[];
|
|
17
21
|
export declare function feedback(params: FeedbackParams): Promise<{
|
|
18
22
|
content: Array<{
|
|
19
23
|
type: 'text';
|
|
@@ -40,12 +44,21 @@ export declare const feedbackTool: {
|
|
|
40
44
|
type: string;
|
|
41
45
|
description: string;
|
|
42
46
|
};
|
|
47
|
+
predictionId: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
43
51
|
value: {
|
|
44
52
|
type: string;
|
|
45
53
|
description: string;
|
|
46
54
|
};
|
|
47
|
-
|
|
55
|
+
source: {
|
|
56
|
+
type: string;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
weight: {
|
|
48
60
|
type: string;
|
|
61
|
+
minimum: number;
|
|
49
62
|
description: string;
|
|
50
63
|
};
|
|
51
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../src/tools/feedback.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../src/tools/feedback.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,cAAc;;;;;;;;;;;;iBASzB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,EAAE,CAY7D;AAED,wBAAsB,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CA2BrI;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCxB,CAAC"}
|
package/build/tools/feedback.js
CHANGED
|
@@ -8,21 +8,36 @@ import { formatError } from '../utils/errors.js';
|
|
|
8
8
|
export const feedbackSchema = z.object({
|
|
9
9
|
projectPath: z.string().describe('Path to MLoop project directory'),
|
|
10
10
|
action: z.enum(['add', 'list', 'metrics']).describe('Feedback action to perform'),
|
|
11
|
-
modelName: z.string().optional().describe('Model name (default: "default")'),
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
modelName: z.string().optional().describe('Model name for "list" and "metrics" (default: "default")'),
|
|
12
|
+
predictionId: z.string().optional().describe('Prediction ID to add feedback for (required for "add")'),
|
|
13
|
+
value: z.string().optional().describe('The actual (ground-truth) value (required for "add")'),
|
|
14
|
+
source: z.string().optional().describe('Where the value came from, e.g. "human", "reviewer-llm" (for "add")'),
|
|
15
|
+
weight: z.number().nonnegative().optional().describe('How much this row counts in training and evaluation built from feedback — for a row reviewed with probability p, 1/p (for "add"; default 1)'),
|
|
14
16
|
});
|
|
17
|
+
/** The CLI arguments for one call — the option names `mloop feedback <action>` accepts. */
|
|
18
|
+
export function feedbackArgs(params) {
|
|
19
|
+
const cliParams = {};
|
|
20
|
+
if (params.action === 'add') {
|
|
21
|
+
cliParams['prediction-id'] = params.predictionId;
|
|
22
|
+
cliParams['actual-value'] = params.value;
|
|
23
|
+
cliParams['source'] = params.source;
|
|
24
|
+
cliParams['weight'] = params.weight;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
cliParams['model'] = params.modelName;
|
|
28
|
+
cliParams['json'] = true;
|
|
29
|
+
}
|
|
30
|
+
return buildArgsWithPositional('feedback', [params.action], cliParams);
|
|
31
|
+
}
|
|
15
32
|
export async function feedback(params) {
|
|
16
33
|
try {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const args = buildArgsWithPositional('feedback', [params.action], cliParams);
|
|
25
|
-
const result = await executeMloop(args, { cwd: params.projectPath });
|
|
34
|
+
if (params.action === 'add' && (!params.predictionId || params.value === undefined)) {
|
|
35
|
+
return {
|
|
36
|
+
content: [{ type: 'text', text: '"add" needs predictionId and value — the prediction ID from mloop_logs, and the actual value.' }],
|
|
37
|
+
isError: true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const result = await executeMloop(feedbackArgs(params), { cwd: params.projectPath });
|
|
26
41
|
const output = parseCliOutput(result.stdout);
|
|
27
42
|
return {
|
|
28
43
|
content: [{
|
|
@@ -43,7 +58,7 @@ export async function feedback(params) {
|
|
|
43
58
|
}
|
|
44
59
|
export const feedbackTool = {
|
|
45
60
|
name: 'mloop_feedback',
|
|
46
|
-
description: 'Manage feedback for model predictions. Add
|
|
61
|
+
description: 'Manage feedback for model predictions. Add the actual value for a logged prediction (with its source and an optional weight), list existing feedback, or view feedback metrics (accuracy is weighted when feedback carries weights).',
|
|
47
62
|
inputSchema: {
|
|
48
63
|
type: 'object',
|
|
49
64
|
properties: {
|
|
@@ -58,15 +73,24 @@ export const feedbackTool = {
|
|
|
58
73
|
},
|
|
59
74
|
modelName: {
|
|
60
75
|
type: 'string',
|
|
61
|
-
description: 'Model name (default: "default")',
|
|
76
|
+
description: 'Model name for "list" and "metrics" (default: "default")',
|
|
77
|
+
},
|
|
78
|
+
predictionId: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
description: 'Prediction ID to add feedback for (required for "add")',
|
|
62
81
|
},
|
|
63
82
|
value: {
|
|
64
83
|
type: 'string',
|
|
65
|
-
description: '
|
|
84
|
+
description: 'The actual (ground-truth) value (required for "add")',
|
|
66
85
|
},
|
|
67
|
-
|
|
86
|
+
source: {
|
|
68
87
|
type: 'string',
|
|
69
|
-
description: '
|
|
88
|
+
description: 'Where the value came from, e.g. "human", "reviewer-llm" (for "add")',
|
|
89
|
+
},
|
|
90
|
+
weight: {
|
|
91
|
+
type: 'number',
|
|
92
|
+
minimum: 0,
|
|
93
|
+
description: 'How much this row counts in training and evaluation built from feedback — for a row reviewed with probability p, 1/p (for "add"; default 1)',
|
|
70
94
|
},
|
|
71
95
|
},
|
|
72
96
|
required: ['projectPath', 'action'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback.js","sourceRoot":"","sources":["../../src/tools/feedback.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CA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.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { listTool, list, listSchema, type ListParams } from './list.js';
|
|
|
7
7
|
export { promoteTool, promote, promoteSchema, type PromoteParams } from './promote.js';
|
|
8
8
|
export { rollbackTool, rollback, rollbackSchema, type RollbackParams } from './rollback.js';
|
|
9
9
|
export { thresholdTool, threshold, thresholdSchema, type ThresholdParams } from './threshold.js';
|
|
10
|
+
export { calibrateTool, calibrate, calibrateSchema, type CalibrateParams } from './calibrate.js';
|
|
10
11
|
export { exportOnnxTool, exportOnnx, exportOnnxSchema, type ExportOnnxParams } from './export-onnx.js';
|
|
11
12
|
export { infoTool, info, infoSchema, type InfoParams } from './info.js';
|
|
12
13
|
export { statusTool, status, statusSchema, type StatusParams } from './status.js';
|
|
@@ -49,6 +50,9 @@ export declare const allTools: readonly [{
|
|
|
49
50
|
}, {
|
|
50
51
|
readonly name: "mloop_threshold";
|
|
51
52
|
readonly module: () => Promise<typeof import("./threshold.js")>;
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "mloop_calibrate";
|
|
55
|
+
readonly module: () => Promise<typeof import("./calibrate.js")>;
|
|
52
56
|
}, {
|
|
53
57
|
readonly name: "mloop_export_onnx";
|
|
54
58
|
readonly module: () => Promise<typeof import("./export-onnx.js")>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,a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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCX,CAAC"}
|
package/build/tools/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export { listTool, list, listSchema } from './list.js';
|
|
|
8
8
|
export { promoteTool, promote, promoteSchema } from './promote.js';
|
|
9
9
|
export { rollbackTool, rollback, rollbackSchema } from './rollback.js';
|
|
10
10
|
export { thresholdTool, threshold, thresholdSchema } from './threshold.js';
|
|
11
|
+
export { calibrateTool, calibrate, calibrateSchema } from './calibrate.js';
|
|
11
12
|
export { exportOnnxTool, exportOnnx, exportOnnxSchema } from './export-onnx.js';
|
|
12
13
|
export { infoTool, info, infoSchema } from './info.js';
|
|
13
14
|
export { statusTool, status, statusSchema } from './status.js';
|
|
@@ -42,6 +43,7 @@ export const allTools = [
|
|
|
42
43
|
{ name: 'mloop_promote', module: () => import('./promote.js') },
|
|
43
44
|
{ name: 'mloop_rollback', module: () => import('./rollback.js') },
|
|
44
45
|
{ name: 'mloop_threshold', module: () => import('./threshold.js') },
|
|
46
|
+
{ name: 'mloop_calibrate', module: () => import('./calibrate.js') },
|
|
45
47
|
{ name: 'mloop_export_onnx', module: () => import('./export-onnx.js') },
|
|
46
48
|
{ name: 'mloop_info', module: () => import('./info.js') },
|
|
47
49
|
{ name: 'mloop_status', module: () => import('./status.js') },
|
package/build/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,iBAAiB;AACjB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAoB,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAmB,MAAM,WAAW,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<z.ZodString>;
|
|
8
8
|
modelName: z.ZodOptional<z.ZodString>;
|
|
9
|
+
experimentId: z.ZodOptional<z.ZodString>;
|
|
9
10
|
output: z.ZodOptional<z.ZodString>;
|
|
10
11
|
log: z.ZodOptional<z.ZodBoolean>;
|
|
11
12
|
unknownStrategy: z.ZodOptional<z.ZodEnum<{
|
|
@@ -41,6 +42,10 @@ export declare const predictTool: {
|
|
|
41
42
|
type: string;
|
|
42
43
|
description: string;
|
|
43
44
|
};
|
|
45
|
+
experimentId: {
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
44
49
|
output: {
|
|
45
50
|
type: string;
|
|
46
51
|
description: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predict.d.ts","sourceRoot":"","sources":["../../src/tools/predict.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"predict.d.ts","sourceRoot":"","sources":["../../src/tools/predict.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;iBAUxB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,wBAAsB,OAAO,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAuDnI;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCvB,CAAC"}
|
package/build/tools/predict.js
CHANGED
|
@@ -9,6 +9,8 @@ export const predictSchema = z.object({
|
|
|
9
9
|
projectPath: z.string().describe('Path to MLoop project directory'),
|
|
10
10
|
dataFile: z.string().optional().describe('Prediction data file (default: datasets/predict.csv)'),
|
|
11
11
|
modelName: z.string().optional().describe('Model name'),
|
|
12
|
+
experimentId: z.string().optional()
|
|
13
|
+
.describe('Predict with this experiment (e.g. a staging candidate) instead of production — production does not move'),
|
|
12
14
|
output: z.string().optional().describe('Output file path'),
|
|
13
15
|
log: z.boolean().optional().describe('Enable prediction logging'),
|
|
14
16
|
unknownStrategy: z.enum(['auto', 'error', 'use-most-frequent', 'use-missing']).optional()
|
|
@@ -16,7 +18,7 @@ export const predictSchema = z.object({
|
|
|
16
18
|
});
|
|
17
19
|
export async function predict(params) {
|
|
18
20
|
try {
|
|
19
|
-
const { projectPath, dataFile, modelName, output, log, unknownStrategy } = params;
|
|
21
|
+
const { projectPath, dataFile, modelName, experimentId, output, log, unknownStrategy } = params;
|
|
20
22
|
// dataFile is a positional argument
|
|
21
23
|
const positional = [];
|
|
22
24
|
if (dataFile)
|
|
@@ -24,6 +26,8 @@ export async function predict(params) {
|
|
|
24
26
|
const cliParams = {};
|
|
25
27
|
if (modelName)
|
|
26
28
|
cliParams['name'] = modelName;
|
|
29
|
+
if (experimentId)
|
|
30
|
+
cliParams['experiment'] = experimentId;
|
|
27
31
|
if (output)
|
|
28
32
|
cliParams['output'] = output;
|
|
29
33
|
if (log)
|
|
@@ -73,7 +77,7 @@ export async function predict(params) {
|
|
|
73
77
|
}
|
|
74
78
|
export const predictTool = {
|
|
75
79
|
name: 'mloop_predict',
|
|
76
|
-
description: 'Run predictions using a trained model. Uses production model by default.',
|
|
80
|
+
description: 'Run predictions using a trained model. Uses production model by default; `experimentId` predicts with that experiment instead (a shadow prediction — production does not move). The JSON names the model that answered in `experimentId`.',
|
|
77
81
|
inputSchema: {
|
|
78
82
|
type: 'object',
|
|
79
83
|
properties: {
|
|
@@ -89,6 +93,10 @@ export const predictTool = {
|
|
|
89
93
|
type: 'string',
|
|
90
94
|
description: 'Model name to use for prediction',
|
|
91
95
|
},
|
|
96
|
+
experimentId: {
|
|
97
|
+
type: 'string',
|
|
98
|
+
description: 'Experiment to predict with instead of production (e.g. a staging candidate, "exp-003"). Production does not move; logged rows carry this id.',
|
|
99
|
+
},
|
|
92
100
|
output: {
|
|
93
101
|
type: 'string',
|
|
94
102
|
description: 'Output file path for predictions',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predict.js","sourceRoot":"","sources":["../../src/tools/predict.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACnE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;IAChG,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;IACvD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;IAC1D,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IACjE,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE;SACtF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SAAS;gBACf,WAAW,EAAE,wCAAwC;aACtD;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,aAAa,CAAC;gBAC3D,WAAW,EAAE,sNAAsN;aACpO;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;IACD,OAAO,EAAE,OAAO;CACjB,CAAC"}
|
package/build/tools/prep.d.ts
CHANGED
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
export declare const prepSchema: z.ZodObject<{
|
|
6
6
|
projectPath: z.ZodString;
|
|
7
|
-
|
|
7
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
8
|
+
input: z.ZodOptional<z.ZodString>;
|
|
9
|
+
output: z.ZodOptional<z.ZodString>;
|
|
10
|
+
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
8
11
|
}, z.core.$strip>;
|
|
9
12
|
export type PrepParams = z.infer<typeof prepSchema>;
|
|
10
13
|
export declare function prep(params: PrepParams): Promise<{
|
|
@@ -24,7 +27,19 @@ export declare const prepTool: {
|
|
|
24
27
|
type: string;
|
|
25
28
|
description: string;
|
|
26
29
|
};
|
|
27
|
-
|
|
30
|
+
modelName: {
|
|
31
|
+
type: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
input: {
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
output: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
dryRun: {
|
|
28
43
|
type: string;
|
|
29
44
|
description: string;
|
|
30
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prep.d.ts","sourceRoot":"","sources":["../../src/tools/prep.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"prep.d.ts","sourceRoot":"","sources":["../../src/tools/prep.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,UAAU;;;;;;iBAMrB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,wBAAsB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CA6B7H;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BpB,CAAC"}
|
package/build/tools/prep.js
CHANGED
|
@@ -7,13 +7,20 @@ import { parseCliOutput } from '../utils/parser.js';
|
|
|
7
7
|
import { formatError } from '../utils/errors.js';
|
|
8
8
|
export const prepSchema = z.object({
|
|
9
9
|
projectPath: z.string().describe('Path to MLoop project directory'),
|
|
10
|
-
|
|
10
|
+
modelName: z.string().optional().describe("Model whose prep steps (mloop.yaml) to run (default: 'default')"),
|
|
11
|
+
input: z.string().optional().describe('Input CSV file (default: datasets/train.csv)'),
|
|
12
|
+
output: z.string().optional().describe('Output CSV file (default: <input>_prep.csv)'),
|
|
13
|
+
dryRun: z.boolean().optional().describe('Show the pipeline steps without executing them'),
|
|
11
14
|
});
|
|
12
15
|
export async function prep(params) {
|
|
13
16
|
try {
|
|
14
|
-
const cliParams = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
const cliParams = {
|
|
18
|
+
name: params.modelName,
|
|
19
|
+
input: params.input,
|
|
20
|
+
output: params.output,
|
|
21
|
+
dryRun: params.dryRun,
|
|
22
|
+
json: true,
|
|
23
|
+
};
|
|
17
24
|
const args = buildArgsWithPositional('prep', ['run'], cliParams);
|
|
18
25
|
const result = await executeMloop(args, { cwd: params.projectPath });
|
|
19
26
|
const output = parseCliOutput(result.stdout);
|
|
@@ -36,7 +43,7 @@ export async function prep(params) {
|
|
|
36
43
|
}
|
|
37
44
|
export const prepTool = {
|
|
38
45
|
name: 'mloop_prep',
|
|
39
|
-
description:
|
|
46
|
+
description: "Run a model's preprocessing pipeline — the prep steps declared under the model in mloop.yaml (see mloop_prep_plan) — over a CSV file, writing the prepared file.",
|
|
40
47
|
inputSchema: {
|
|
41
48
|
type: 'object',
|
|
42
49
|
properties: {
|
|
@@ -44,9 +51,21 @@ export const prepTool = {
|
|
|
44
51
|
type: 'string',
|
|
45
52
|
description: 'Path to MLoop project directory',
|
|
46
53
|
},
|
|
47
|
-
|
|
54
|
+
modelName: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
description: "Model whose prep steps (mloop.yaml) to run (default: 'default')",
|
|
57
|
+
},
|
|
58
|
+
input: {
|
|
48
59
|
type: 'string',
|
|
49
|
-
description: '
|
|
60
|
+
description: 'Input CSV file (default: datasets/train.csv)',
|
|
61
|
+
},
|
|
62
|
+
output: {
|
|
63
|
+
type: 'string',
|
|
64
|
+
description: 'Output CSV file (default: <input>_prep.csv)',
|
|
65
|
+
},
|
|
66
|
+
dryRun: {
|
|
67
|
+
type: 'boolean',
|
|
68
|
+
description: 'Show the pipeline steps without executing them',
|
|
50
69
|
},
|
|
51
70
|
},
|
|
52
71
|
required: ['projectPath'],
|
package/build/tools/prep.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prep.js","sourceRoot":"","sources":["../../src/tools/prep.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,cAAc,E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D,MAAM,EAAE;gBACN,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,gDAAgD;aAC9D;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;IACD,OAAO,EAAE,IAAI;CACd,CAAC"}
|
package/build/tools/sample.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* mloop_sample tool -
|
|
2
|
+
* mloop_sample tool - Sample data from CSV files or prediction logs
|
|
3
3
|
*/
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
export declare const sampleSchema: z.ZodObject<{
|
|
@@ -8,11 +8,16 @@ export declare const sampleSchema: z.ZodObject<{
|
|
|
8
8
|
create: "create";
|
|
9
9
|
stats: "stats";
|
|
10
10
|
}>;
|
|
11
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
11
12
|
dataFile: z.ZodOptional<z.ZodString>;
|
|
12
13
|
size: z.ZodOptional<z.ZodNumber>;
|
|
13
14
|
strategy: z.ZodOptional<z.ZodString>;
|
|
15
|
+
label: z.ZodOptional<z.ZodString>;
|
|
16
|
+
output: z.ZodOptional<z.ZodString>;
|
|
14
17
|
}, z.core.$strip>;
|
|
15
18
|
export type SampleParams = z.infer<typeof sampleSchema>;
|
|
19
|
+
/** The CLI arguments for one call — the option names `mloop sample <action>` accepts. */
|
|
20
|
+
export declare function sampleArgs(params: SampleParams): string[];
|
|
16
21
|
export declare function sample(params: SampleParams): Promise<{
|
|
17
22
|
content: Array<{
|
|
18
23
|
type: 'text';
|
|
@@ -35,6 +40,10 @@ export declare const sampleTool: {
|
|
|
35
40
|
enum: string[];
|
|
36
41
|
description: string;
|
|
37
42
|
};
|
|
43
|
+
modelName: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
38
47
|
dataFile: {
|
|
39
48
|
type: string;
|
|
40
49
|
description: string;
|
|
@@ -47,6 +56,14 @@ export declare const sampleTool: {
|
|
|
47
56
|
type: string;
|
|
48
57
|
description: string;
|
|
49
58
|
};
|
|
59
|
+
label: {
|
|
60
|
+
type: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
output: {
|
|
64
|
+
type: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
50
67
|
};
|
|
51
68
|
required: string[];
|
|
52
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sample.d.ts","sourceRoot":"","sources":["../../src/tools/sample.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"sample.d.ts","sourceRoot":"","sources":["../../src/tools/sample.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,YAAY;;;;;;;;;;;;iBAWvB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,yFAAyF;AACzF,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,EAAE,CAczD;AAED,wBAAsB,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAoBjI;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CtB,CAAC"}
|
package/build/tools/sample.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* mloop_sample tool -
|
|
2
|
+
* mloop_sample tool - Sample data from CSV files or prediction logs
|
|
3
3
|
*/
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { executeMloop, buildArgsWithPositional } from '../executor.js';
|
|
@@ -8,22 +8,33 @@ import { formatError } from '../utils/errors.js';
|
|
|
8
8
|
export const sampleSchema = z.object({
|
|
9
9
|
projectPath: z.string().describe('Path to MLoop project directory'),
|
|
10
10
|
action: z.enum(['create', 'stats']).describe('Sample action to perform'),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
modelName: z.string().optional().describe('Model whose logged predictions and feedback to sample ("create": a retraining dataset — the feedback under the model\'s label, weighted when feedback carries weights; "stats": default "default")'),
|
|
12
|
+
dataFile: z.string().optional().describe('CSV file to sample from instead of prediction logs ("create" only)'),
|
|
13
|
+
size: z.number().int().positive().optional().describe('Number of rows to sample (default 1000)'),
|
|
14
|
+
strategy: z.string().optional().describe('Sampling strategy — logs: random, recent, feedback-priority, stratified, low-confidence; CSV: random, head, stratified'),
|
|
15
|
+
label: z.string().optional().describe('Label column for stratified CSV sampling'),
|
|
16
|
+
output: z.string().optional().describe('Output CSV path'),
|
|
14
17
|
});
|
|
18
|
+
/** The CLI arguments for one call — the option names `mloop sample <action>` accepts. */
|
|
19
|
+
export function sampleArgs(params) {
|
|
20
|
+
const cliParams = {};
|
|
21
|
+
if (params.action === 'create') {
|
|
22
|
+
cliParams['from'] = params.dataFile;
|
|
23
|
+
cliParams['model'] = params.dataFile ? undefined : (params.modelName ?? 'default');
|
|
24
|
+
cliParams['rows'] = params.size;
|
|
25
|
+
cliParams['strategy'] = params.strategy;
|
|
26
|
+
cliParams['label'] = params.label;
|
|
27
|
+
cliParams['output'] = params.output;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
cliParams['model'] = params.modelName;
|
|
31
|
+
cliParams['json'] = true;
|
|
32
|
+
}
|
|
33
|
+
return buildArgsWithPositional('sample', [params.action], cliParams);
|
|
34
|
+
}
|
|
15
35
|
export async function sample(params) {
|
|
16
36
|
try {
|
|
17
|
-
const
|
|
18
|
-
if (params.dataFile)
|
|
19
|
-
positional.push(params.dataFile);
|
|
20
|
-
const cliParams = {};
|
|
21
|
-
if (params.size)
|
|
22
|
-
cliParams['size'] = params.size;
|
|
23
|
-
if (params.strategy)
|
|
24
|
-
cliParams['strategy'] = params.strategy;
|
|
25
|
-
const args = buildArgsWithPositional('sample', positional, cliParams);
|
|
26
|
-
const result = await executeMloop(args, { cwd: params.projectPath });
|
|
37
|
+
const result = await executeMloop(sampleArgs(params), { cwd: params.projectPath });
|
|
27
38
|
const output = parseCliOutput(result.stdout);
|
|
28
39
|
return {
|
|
29
40
|
content: [{
|
|
@@ -44,7 +55,7 @@ export async function sample(params) {
|
|
|
44
55
|
}
|
|
45
56
|
export const sampleTool = {
|
|
46
57
|
name: 'mloop_sample',
|
|
47
|
-
description: 'Create
|
|
58
|
+
description: 'Create a sampled dataset — from a model\'s logged predictions and feedback (a retraining dataset: feedback under the model\'s label, with a weight column when feedback carries weights) or from a CSV file — or view sampling statistics.',
|
|
48
59
|
inputSchema: {
|
|
49
60
|
type: 'object',
|
|
50
61
|
properties: {
|
|
@@ -57,17 +68,29 @@ export const sampleTool = {
|
|
|
57
68
|
enum: ['create', 'stats'],
|
|
58
69
|
description: 'Sample action: "create" to generate a sample, "stats" to view statistics',
|
|
59
70
|
},
|
|
71
|
+
modelName: {
|
|
72
|
+
type: 'string',
|
|
73
|
+
description: 'Model whose logged predictions and feedback to sample (default: "default")',
|
|
74
|
+
},
|
|
60
75
|
dataFile: {
|
|
61
76
|
type: 'string',
|
|
62
|
-
description: '
|
|
77
|
+
description: 'CSV file to sample from instead of prediction logs ("create" only)',
|
|
63
78
|
},
|
|
64
79
|
size: {
|
|
65
80
|
type: 'number',
|
|
66
|
-
description: '
|
|
81
|
+
description: 'Number of rows to sample (default 1000)',
|
|
67
82
|
},
|
|
68
83
|
strategy: {
|
|
69
84
|
type: 'string',
|
|
70
|
-
description: 'Sampling strategy
|
|
85
|
+
description: 'Sampling strategy — logs: random, recent, feedback-priority, stratified, low-confidence; CSV: random, head, stratified',
|
|
86
|
+
},
|
|
87
|
+
label: {
|
|
88
|
+
type: 'string',
|
|
89
|
+
description: 'Label column for stratified CSV sampling',
|
|
90
|
+
},
|
|
91
|
+
output: {
|
|
92
|
+
type: 'string',
|
|
93
|
+
description: 'Output CSV path',
|
|
71
94
|
},
|
|
72
95
|
},
|
|
73
96
|
required: ['projectPath', 'action'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sample.js","sourceRoot":"","sources":["../../src/tools/sample.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACnE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IACxE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"sample.js","sourceRoot":"","sources":["../../src/tools/sample.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,YAAY,GAAG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,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;aAC/C;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;gBACzB,WAAW,EAAE,0EAA0E;aACxF;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4EAA4E;aAC1F;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oEAAoE;aAClF;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yCAAyC;aACvD;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wHAAwH;aACtI;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0CAA0C;aACxD;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iBAAiB;aAC/B;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC;KACpC;IACD,OAAO,EAAE,MAAM;CAChB,CAAC"}
|
|
@@ -7,6 +7,7 @@ export declare const thresholdSchema: z.ZodObject<{
|
|
|
7
7
|
experimentId: z.ZodOptional<z.ZodString>;
|
|
8
8
|
modelName: z.ZodOptional<z.ZodString>;
|
|
9
9
|
precision: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
precisionOf: z.ZodOptional<z.ZodString>;
|
|
10
11
|
dataFile: z.ZodOptional<z.ZodString>;
|
|
11
12
|
weight: z.ZodOptional<z.ZodString>;
|
|
12
13
|
clear: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -41,6 +42,10 @@ export declare const thresholdTool: {
|
|
|
41
42
|
type: string;
|
|
42
43
|
description: string;
|
|
43
44
|
};
|
|
45
|
+
precisionOf: {
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
44
49
|
dataFile: {
|
|
45
50
|
type: string;
|
|
46
51
|
description: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threshold.d.ts","sourceRoot":"","sources":["../../src/tools/threshold.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"threshold.d.ts","sourceRoot":"","sources":["../../src/tools/threshold.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,eAAe;;;;;;;;;iBAS1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,wBAAsB,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAyBvI;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBzB,CAAC"}
|
package/build/tools/threshold.js
CHANGED
|
@@ -10,13 +10,14 @@ export const thresholdSchema = z.object({
|
|
|
10
10
|
experimentId: z.string().optional().describe('Experiment to set the threshold of (default: the production model)'),
|
|
11
11
|
modelName: z.string().optional().describe('Model name'),
|
|
12
12
|
precision: z.number().optional().describe('Target positive precision (above 0, at most 1): the lowest threshold reaching it on dataFile is chosen'),
|
|
13
|
+
precisionOf: z.string().optional().describe('The class whose precision is targeted, by its label value (default: the positive class) — the negative class too, when a wrong "no" is the costly answer'),
|
|
13
14
|
dataFile: z.string().optional().describe('Labeled evaluation file the threshold is chosen on (required with precision)'),
|
|
14
15
|
weight: z.string().optional().describe('Column that weights the rows'),
|
|
15
16
|
clear: z.boolean().optional().describe('Remove the threshold: the model answers at 0.5 again'),
|
|
16
17
|
});
|
|
17
18
|
export async function threshold(params) {
|
|
18
19
|
try {
|
|
19
|
-
const { projectPath, experimentId, modelName, precision, dataFile, weight, clear } = params;
|
|
20
|
+
const { projectPath, experimentId, modelName, precision, precisionOf, dataFile, weight, clear } = params;
|
|
20
21
|
const args = ['threshold'];
|
|
21
22
|
if (experimentId)
|
|
22
23
|
args.push(experimentId);
|
|
@@ -24,6 +25,8 @@ export async function threshold(params) {
|
|
|
24
25
|
args.push('--name', modelName);
|
|
25
26
|
if (precision !== undefined)
|
|
26
27
|
args.push('--precision', String(precision));
|
|
28
|
+
if (precisionOf)
|
|
29
|
+
args.push('--precision-of', precisionOf);
|
|
27
30
|
if (dataFile)
|
|
28
31
|
args.push('--data', dataFile);
|
|
29
32
|
if (weight)
|
|
@@ -45,7 +48,7 @@ export async function threshold(params) {
|
|
|
45
48
|
}
|
|
46
49
|
export const thresholdTool = {
|
|
47
50
|
name: 'mloop_threshold',
|
|
48
|
-
description: 'A binary classifier\'s decision threshold, as JSON. With precision and dataFile, chooses the
|
|
51
|
+
description: 'A binary classifier\'s decision threshold, as JSON. With precision and dataFile, chooses the probability threshold at which the precision of the positive class — or of precisionOf, the negative one included (mloop >= 0.40) — reaches the target on those labeled rows, keeping the most of that class\'s recall, and writes it beside the model — predict, serve, evaluate and the gate then answer at it, and promote carries it. Without precision, shows the current one; with clear, removes it. Refused for a model that is not binary or gives no probability, or when no threshold reaches the precision (mloop >= 0.39).',
|
|
49
52
|
inputSchema: {
|
|
50
53
|
type: 'object',
|
|
51
54
|
properties: {
|
|
@@ -53,6 +56,7 @@ export const thresholdTool = {
|
|
|
53
56
|
experimentId: { type: 'string', description: 'Experiment (default: production)' },
|
|
54
57
|
modelName: { type: 'string', description: 'Model name for namespacing' },
|
|
55
58
|
precision: { type: 'number', description: 'Target positive precision, above 0 and at most 1' },
|
|
59
|
+
precisionOf: { type: 'string', description: 'Class whose precision is targeted, by label value (default: positive class)' },
|
|
56
60
|
dataFile: { type: 'string', description: 'Labeled evaluation file (required with precision)' },
|
|
57
61
|
weight: { type: 'string', description: 'Column that weights the rows' },
|
|
58
62
|
clear: { type: 'boolean', description: 'Remove the threshold' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threshold.js","sourceRoot":"","sources":["../../src/tools/threshold.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACnE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oEAAoE,CAAC;IAClH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;IACvD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wGAAwG,CAAC;IACnJ,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8EAA8E,CAAC;IACxH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IACtE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;CAC/F,C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E,CAAC;QACf,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;YACrD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,smBAAsmB;IACnnB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iCAAiC,EAAE;YAC/E,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kCAAkC,EAAE;YACjF,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;YACxE,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kDAAkD,EAAE;YAC9F,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6EAA6E,EAAE;YAC3H,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mDAAmD,EAAE;YAC9F,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8BAA8B,EAAE;YACvE,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,sBAAsB,EAAE;SAChE;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;IACD,OAAO,EAAE,SAAS;CACnB,CAAC"}
|
package/build/tools/train.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare const trainSchema: z.ZodObject<{
|
|
|
19
19
|
noPromote: z.ZodOptional<z.ZodBoolean>;
|
|
20
20
|
dropMissingLabels: z.ZodOptional<z.ZodBoolean>;
|
|
21
21
|
weight: z.ZodOptional<z.ZodString>;
|
|
22
|
+
additionalDataFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
23
|
portable: z.ZodOptional<z.ZodBoolean>;
|
|
23
24
|
}, z.core.$strip>;
|
|
24
25
|
export type TrainParams = z.infer<typeof trainSchema>;
|
|
@@ -84,6 +85,13 @@ export declare const trainTool: {
|
|
|
84
85
|
type: string;
|
|
85
86
|
description: string;
|
|
86
87
|
};
|
|
88
|
+
additionalDataFiles: {
|
|
89
|
+
type: string;
|
|
90
|
+
items: {
|
|
91
|
+
type: string;
|
|
92
|
+
};
|
|
93
|
+
description: string;
|
|
94
|
+
};
|
|
87
95
|
portable: {
|
|
88
96
|
type: string;
|
|
89
97
|
description: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"train.d.ts","sourceRoot":"","sources":["../../src/tools/train.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"train.d.ts","sourceRoot":"","sources":["../../src/tools/train.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;iBAkBtB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,wBAAsB,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAiD/H;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoErB,CAAC"}
|
package/build/tools/train.js
CHANGED
|
@@ -20,14 +20,17 @@ export const trainSchema = z.object({
|
|
|
20
20
|
noPromote: z.boolean().optional().describe('Skip automatic promotion to production'),
|
|
21
21
|
dropMissingLabels: z.boolean().optional().describe('Drop rows with missing label values before training'),
|
|
22
22
|
weight: z.string().optional().describe('Column that weights the rows (e.g. 1/π for sampled labels); never a feature'),
|
|
23
|
+
additionalDataFiles: z.array(z.string()).optional().describe('Files merged after dataFile (e.g. a retraining set from mloop_sample create); a file without the weight column counts its rows 1'),
|
|
23
24
|
portable: z.boolean().optional().describe('Train only with steps ONNX can express, so mloop_export_onnx can export the model'),
|
|
24
25
|
});
|
|
25
26
|
export async function train(params) {
|
|
26
27
|
try {
|
|
27
28
|
const { projectPath, dataFile, label, ...options } = params;
|
|
28
29
|
// Build positional arguments
|
|
30
|
+
// More than one file goes through --data, which merges them; one file is the positional argument.
|
|
31
|
+
const more = options.additionalDataFiles ?? [];
|
|
29
32
|
const positional = [];
|
|
30
|
-
if (dataFile)
|
|
33
|
+
if (dataFile && more.length === 0)
|
|
31
34
|
positional.push(dataFile);
|
|
32
35
|
// Map parameters to CLI flags
|
|
33
36
|
const cliParams = {};
|
|
@@ -54,6 +57,8 @@ export async function train(params) {
|
|
|
54
57
|
if (options.portable)
|
|
55
58
|
cliParams['portable'] = true;
|
|
56
59
|
const args = buildArgsWithPositional('train', positional, cliParams);
|
|
60
|
+
if (more.length > 0)
|
|
61
|
+
args.push('--data', dataFile ?? 'datasets/train.csv', ...more);
|
|
57
62
|
const result = await executeMloop(args, {
|
|
58
63
|
cwd: projectPath,
|
|
59
64
|
timeout: 600_000, // 10 minutes for training
|
|
@@ -131,6 +136,11 @@ export const trainTool = {
|
|
|
131
136
|
type: 'string',
|
|
132
137
|
description: 'Column whose values weight the rows — the relative frequency each row should have (1/π for a row sampled with probability π, lower for a less reliable label source). Never used as a feature; the test metrics are weighted too. Binary, multiclass and regression; refused with --balance, on the label, or on another task',
|
|
133
138
|
},
|
|
139
|
+
additionalDataFiles: {
|
|
140
|
+
type: 'array',
|
|
141
|
+
items: { type: 'string' },
|
|
142
|
+
description: 'Files merged after dataFile (e.g. a retraining set from mloop_sample create); a file without the weight column counts its rows 1',
|
|
143
|
+
},
|
|
134
144
|
portable: {
|
|
135
145
|
type: 'boolean',
|
|
136
146
|
description: 'Train only with steps an ONNX runtime computes exactly (text columns as character n-gram counts), so mloop_export_onnx can export the model. Binary, multiclass and regression',
|
package/build/tools/train.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"train.js","sourceRoot":"","sources":["../../src/tools/train.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACnE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;IAC5F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAC1D,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,uBAAuB,EAAE,2BAA2B,EAAE,YAAY,CAAC,CAAC;SAC/E,QAAQ,EAAE;SACV,QAAQ,CAAC,cAAc,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IAC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AAE,SAAS;gBACf,WAAW,EAAE,qDAAqD;aACnE;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+TAA+T;aAC7U;YACD,mBAAmB,EAAE;gBACnB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,kIAAkI;aAChJ;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,gLAAgL;aAC9L;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;IACD,OAAO,EAAE,KAAK;CACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iyulab/mloop-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "MCP server for MLoop CLI - ML.NET MLOps tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"start": "node build/index.js",
|
|
19
19
|
"dev": "npm run build && npm run start",
|
|
20
20
|
"clean": "rimraf build",
|
|
21
|
-
"prepublishOnly": "npm run clean && npm run build"
|
|
21
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
22
|
+
"check:cli": "npm run build && node scripts/check-cli-options.mjs"
|
|
22
23
|
},
|
|
23
24
|
"keywords": [
|
|
24
25
|
"mcp",
|