Skip to main content
weave / ScoreLogger ScoreLogger manages scoring for a single prediction. Returned from EvaluationLogger.logPrediction(). Example
const pred = await ev.logPrediction(example, output);
await pred.logScore("accuracy", 0.95);
await pred.logScore("relevance", 0.8);
await pred.finish(); // Finalizes the prediction

Table of contents

Constructors

Methods

Constructors

constructor

new ScoreLogger(predMeta, evalLogger): ScoreLogger

Parameters

NameType
predMetaPredictAndScoreCallMetadata
evalLoggerEvaluationLogger

Returns

ScoreLogger

Defined in

evaluationLogger.ts:317

Methods

finish

finish(): Promise<void> Finish the scoring process for the prediction. Finalizes the predict_and_score call with accumulated scores. Updates incremental aggregates and frees memory.

Returns

Promise<void>

Defined in

evaluationLogger.ts:410

logScore

logScore(scorerName, score): Promise<void> Log a score for this prediction. Creates a scorer call as a child of predict_and_score.

Parameters

NameTypeDescription
scorerNamestringName of the scorer (e.g., “accuracy”, “f1_score”)
scoreanyThe score value

Returns

Promise<void>

Defined in

evaluationLogger.ts:332
I