Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scores summary on Experiment #1911

Merged
merged 14 commits into from
May 16, 2024
38 changes: 12 additions & 26 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1789,47 +1789,33 @@
"type": "object",
"additionalProperties": false
},
"Record_string.any_": {
"properties": {},
"additionalProperties": {},
"type": "object",
"description": "Construct a type with a set of properties K of type T"
},
"ExperimentScores": {
"properties": {
"dataset": {
"properties": {
"cost": {
"type": "number",
"format": "double"
},
"model": {
"type": "string"
},
"dateCreated": {
"type": "string",
"format": "date-time"
"scores": {
"$ref": "#/components/schemas/Record_string.any_"
}
},
"required": [
"cost",
"model",
"dateCreated"
"scores"
],
"type": "object"
},
"hypothesis": {
"properties": {
"cost": {
"type": "number",
"format": "double"
},
"model": {
"type": "string"
},
"dateCreated": {
"type": "string",
"format": "date-time"
"scores": {
"$ref": "#/components/schemas/Record_string.any_"
}
},
"required": [
"cost",
"model",
"dateCreated"
"scores"
],
"type": "object"
}
Expand Down
26 changes: 12 additions & 14 deletions valhalla/jawn/src/lib/stores/experimentStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,10 @@ export interface Experiment {

export interface ExperimentScores {
dataset: {
dateCreated: Date;
model: string;
cost: number;
//customScores: Record<string, number>;
scores: Record<string, any>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not use any please

};
hypothesis: {
dateCreated: Date;
model: string;
cost: number;
//customScores: Record<string, number>;
scores: Record<string, any>;
};
}

Expand Down Expand Up @@ -422,9 +416,11 @@ function getExperimentHypothesisScores(
);

return ok({
dateCreated: new Date(hypothesis.createdAt),
model: hypothesis.model,
cost: hypothesisCost,
scores: {
dateCreated: new Date(hypothesis.createdAt),
model: hypothesis.model,
cost: hypothesisCost,
},
});
} catch (error) {
console.error("Error calculating hypothesis cost", error);
Expand Down Expand Up @@ -474,9 +470,11 @@ function getExperimentDatasetScores(
const averageCost = validRows.length > 0 ? totalCost / validRows.length : 0;

return ok({
dateCreated: new Date(latest.createdAt),
model: latest.model,
cost: averageCost,
scores: {
ScottMktn marked this conversation as resolved.
Show resolved Hide resolved
dateCreated: new Date(latest.createdAt),
model: latest.model,
cost: averageCost,
},
});
} catch (error) {
console.error("Error calculating dataset cost", error);
Expand Down
9 changes: 7 additions & 2 deletions valhalla/jawn/src/tsoa-build/public/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,11 +675,16 @@ const models: TsoaRoute.Models = {
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"Record_string.any_": {
"dataType": "refAlias",
"type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"dataType":"any"},"validators":{}},
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"ExperimentScores": {
"dataType": "refObject",
"properties": {
"dataset": {"dataType":"nestedObjectLiteral","nestedProperties":{"cost":{"dataType":"double","required":true},"model":{"dataType":"string","required":true},"dateCreated":{"dataType":"datetime","required":true}},"required":true},
"hypothesis": {"dataType":"nestedObjectLiteral","nestedProperties":{"cost":{"dataType":"double","required":true},"model":{"dataType":"string","required":true},"dateCreated":{"dataType":"datetime","required":true}},"required":true},
"dataset": {"dataType":"nestedObjectLiteral","nestedProperties":{"scores":{"ref":"Record_string.any_","required":true}},"required":true},
"hypothesis": {"dataType":"nestedObjectLiteral","nestedProperties":{"scores":{"ref":"Record_string.any_","required":true}},"required":true},
},
"additionalProperties": false,
},
Expand Down
38 changes: 12 additions & 26 deletions valhalla/jawn/src/tsoa-build/public/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1789,47 +1789,33 @@
"type": "object",
"additionalProperties": false
},
"Record_string.any_": {
"properties": {},
"additionalProperties": {},
"type": "object",
"description": "Construct a type with a set of properties K of type T"
},
"ExperimentScores": {
"properties": {
"dataset": {
"properties": {
"cost": {
"type": "number",
"format": "double"
},
"model": {
"type": "string"
},
"dateCreated": {
"type": "string",
"format": "date-time"
"scores": {
"$ref": "#/components/schemas/Record_string.any_"
}
},
"required": [
"cost",
"model",
"dateCreated"
"scores"
],
"type": "object"
},
"hypothesis": {
"properties": {
"cost": {
"type": "number",
"format": "double"
},
"model": {
"type": "string"
},
"dateCreated": {
"type": "string",
"format": "date-time"
"scores": {
"$ref": "#/components/schemas/Record_string.any_"
}
},
"required": [
"cost",
"model",
"dateCreated"
"scores"
],
"type": "object"
}
Expand Down
Loading
Loading