windmill_api/models/experiment_score.rs
1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.796.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ExperimentScore : One scorer's headline for one run: the two numbers a column reports, over that run's cells.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ExperimentScore {
17 #[serde(rename = "scorer_id")]
18 pub scorer_id: String,
19 /// What the column is called in the dataset that ran it, resolved server-side because a list of runs spanning datasets cannot hold every dataset's scorers to look it up.
20 #[serde(rename = "name")]
21 pub name: String,
22 #[serde(rename = "kind")]
23 pub kind: Kind,
24 #[serde(rename = "mean", skip_serializing_if = "Option::is_none")]
25 pub mean: Option<f64>,
26 /// The share of scored cells at or above the column's threshold, for a column that has one. Absent where the column has no threshold and the mean is the whole headline.
27 #[serde(rename = "pass_rate", skip_serializing_if = "Option::is_none")]
28 pub pass_rate: Option<f64>,
29 #[serde(rename = "scored")]
30 pub scored: i32,
31 /// How many of the run's cells the column failed on. A column that failed on all of them has no number to report and is still one of the columns that ran.
32 #[serde(rename = "failed")]
33 pub failed: i32,
34}
35
36impl ExperimentScore {
37 /// One scorer's headline for one run: the two numbers a column reports, over that run's cells.
38 pub fn new(scorer_id: String, name: String, kind: Kind, scored: i32, failed: i32) -> ExperimentScore {
39 ExperimentScore {
40 scorer_id,
41 name,
42 kind,
43 mean: None,
44 pass_rate: None,
45 scored,
46 failed,
47 }
48 }
49}
50///
51#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
52pub enum Kind {
53 #[serde(rename = "agent")]
54 Agent,
55 #[serde(rename = "script")]
56 Script,
57}
58
59impl Default for Kind {
60 fn default() -> Kind {
61 Self::Agent
62 }
63}
64