메인 콘텐츠로 건너뛰기
weave / EvaluationLogger EvaluationLogger 는 prediction 과 점수의 점진적인 로그 기록을 가능하게 합니다. 사전에 데이터셋 정의와 배치 처리가 필요한 전통적인 Evaluation 클래스와 달리, EvaluationLogger 를 사용하면 prediction 이 발생하는 즉시 유연한 스코어링과 함께 로그를 남길 수 있습니다. Example
const ev = new EvaluationLogger({name: 'my-eval', dataset: 'my-dataset'});

for (const example of streamingData) {
  const output = await myModel.predict(example);
  const pred = ev.logPrediction(example, output);

  if (shouldScore(output)) {
    pred.logScore("accuracy", calculateAccuracy(output));
  }
  pred.finish();
}

await ev.logSummary();

목차

Constructors

Methods

Constructors

constructor

new EvaluationLogger(options): EvaluationLogger

파라미터

이름타입
optionsEvaluationLoggerOptions

Returns

EvaluationLogger

정의 위치

evaluationLogger.ts:554

Methods

logPrediction

logPrediction(inputs, output): ScoreLogger 입력과 출력을 포함한 prediction 을 로그에 기록합니다 (동기 버전). predict_and_score 호출을 생성합니다 (자식 predict 호출 포함). 점수 추가를 위해 ScoreLogger 를 즉시 반환합니다. 이 메소드는 ScoreLogger 를 동기적으로 반환합니다. ScoreLogger 에 대한 작업 (logScore, finish) 은 대기열에 추가되어 초기화가 완료된 후 실행됩니다.

파라미터

이름타입
inputsRecord<string, any>
outputany

Returns

ScoreLogger Example
// 실행 후 대기하지 않는 방식 (Fire-and-forget style)
const scoreLogger = evalLogger.logPrediction({input: 'test'}, 'output');
scoreLogger.logScore('accuracy', 0.95);
scoreLogger.finish();
await evalLogger.logSummary(); // 모든 작업이 완료될 때까지 대기

정의 위치

evaluationLogger.ts:641

logPredictionAsync

logPredictionAsync(inputs, output): Promise<ScoreLogger> 입력과 출력을 포함한 prediction 을 로그에 기록합니다 (비동기 버전). logPrediction() 과 유사하지만, prediction 호출이 완전히 초기화되었을 때 resolve 되는 Promise 를 반환합니다. 다음 단계로 진행하기 전에 초기화 완료를 기다려야 하는 경우에 사용하세요.

파라미터

이름타입
inputsRecord<string, any>
outputany

Returns

Promise<ScoreLogger> Example
// 대기 가능한 방식 (Awaitable style)
const scoreLogger = await evalLogger.logPredictionAsync({input: 'test'}, 'output');
await scoreLogger.logScore('accuracy', 0.95);
await scoreLogger.finish();

정의 위치

evaluationLogger.ts:666

logSummary

logSummary(summary?): Promise<void> 요약을 로그에 기록하고 평가를 종료합니다. summarize 호출을 생성하고 evaluate 호출을 마무리합니다. 이 메소드는 await 없이 호출할 수 있지만 (fire-and-forget), 내부적으로는 모든 보류 중인 작업이 완료될 때까지 기다립니다.

파라미터

이름타입
summary?Record<string, any>

Returns

Promise<void>

정의 위치

evaluationLogger.ts:767