Documentation Index
Fetch the complete documentation index at: https://wb-21fd5541-john-wbdocs-2044-rename-serverless-products.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
weave / Evaluation
scorer 집합과 데이터셋을 포함하는 Evaluation을 설정합니다.
evaluation.evaluate(model)을 호출하면 데이터셋의 각 행이 모델에 전달되며, 데이터셋의 column 이름이 model.predict의 argument 이름에 맞게 매핑됩니다.
그런 다음 모든 scorer를 호출하고 결과를 weave에 저장합니다.
예시
// 예시를 데이터셋에 수집합니다
const dataset = new weave.Dataset({
id: 'my-dataset',
rows: [
{ question: 'What is the capital of France?', expected: 'Paris' },
{ question: 'Who wrote "To Kill a Mockingbird"?', expected: 'Harper Lee' },
{ question: 'What is the square root of 64?', expected: '8' },
],
});
// 맞춤형 채점 함수를 정의합니다
const scoringFunction = weave.op(function isEqual({ modelOutput, datasetRow }) {
return modelOutput == datasetRow.expected;
});
// 평가할 함수를 정의합니다
const model = weave.op(async function alwaysParisModel({ question }) {
return 'Paris';
});
// 평가를 시작합니다
const evaluation = new weave.Evaluation({
id: 'my-evaluation',
dataset: dataset,
scorers: [scoringFunction],
});
const results = await evaluation.evaluate({ model });
타입 매개변수
| 이름 | 유형 |
|---|
R | extends DatasetRow |
E | extends DatasetRow |
M | M |
생성자
• new Evaluation<R, E, M>(parameters): Evaluation<R, E, M>
| 이름 | 유형 |
|---|
R | extends DatasetRow |
E | extends DatasetRow |
M | M |
| 이름 | 유형 |
|---|
parameters | EvaluationParameters<R, E, M> |
Evaluation<R, E, M>
WeaveObject.constructor
evaluation.ts:148
• 선택 __savedRef: ObjectRef | Promise<ObjectRef>
WeaveObject.__savedRef
weaveObject.ts:73
접근자
• get 설명(): undefined | string
undefined | string
WeaveObject.description
weaveObject.ts:100
• get name(): string
string
WeaveObject.name
weaveObject.ts:96
메서드
▸ evaluate(«destructured»): Promise<Record<string, any>>
| 이름 | 유형 | 기본값 |
|---|
«destructured» | 객체 | undefined |
› maxConcurrency? | number | 5 |
› model | WeaveCallable<(…args: [{ datasetRow: R }]) => Promise<M>> | undefined |
› nTrials? | number | 1 |
Promise<Record<string, any>>
evaluation.ts:163
▸ predictAndScore(«destructured»): Promise<{ model_latency: number = modelLatency; model_output: any = modelOutput; model_success: boolean = !modelError; scores: { [key: string]: any; } }>
| 이름 | 유형 |
|---|
«destructured» | 객체 |
› columnMapping? | ColumnMapping<R, E> |
› example | R |
› model | WeaveCallable<(…args: [{ datasetRow: E }]) => Promise<M>> |
Promise<{ model_latency: number = modelLatency; model_output: any = modelOutput; model_success: boolean = !modelError; scores: { [key: string]: any; } }>
evaluation.ts:231
▸ saveAttrs(): 객체
객체
WeaveObject.saveAttrs
weaveObject.ts:77