Skip to main content

opensearch_client/common/aggregations/
classification_inference_options.rs

1/*
2 * opensearch-client
3 *
4 * Rust Client for OpenSearch
5 *
6 * The version of the OpenAPI document: 3.1.0
7 * Contact: alberto.paro@gmail.com
8 * Generated by Paro OpenAPI Generator
9 */
10
11use serde::{Deserialize, Serialize};
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct ClassificationInferenceOptions {
15    /// Specifies the number of top class predictions to return. Defaults to 0.
16    #[serde(
17        rename = "num_top_classes",
18        default,
19        skip_serializing_if = "Option::is_none"
20    )]
21    pub num_top_classes: Option<u32>,
22    /// Specifies the maximum number of feature importance values per document.
23    #[serde(
24        rename = "num_top_feature_importance_values",
25        default,
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub num_top_feature_importance_values: Option<u32>,
29    /// The field that is added to incoming documents to contain the inference prediction. Defaults to `predicted_value`.
30    #[serde(
31        rename = "results_field",
32        default,
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub results_field: Option<String>,
36    /// Specifies the field to which the top classes are written. Defaults to `top_classes`.
37    #[serde(
38        rename = "top_classes_results_field",
39        default,
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub top_classes_results_field: Option<String>,
43    /// Specifies the type of the predicted field to write. Acceptable values are: string, number, Boolean. When Boolean is provided 1.0 is transformed to true and 0.0 to false.
44    #[serde(
45        rename = "prediction_field_type",
46        default,
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub prediction_field_type: Option<String>,
50}
51
52impl ClassificationInferenceOptions {
53    pub fn new() -> ClassificationInferenceOptions {
54        ClassificationInferenceOptions {
55            num_top_classes: None,
56            num_top_feature_importance_values: None,
57            results_field: None,
58            top_classes_results_field: None,
59            prediction_field_type: None,
60        }
61    }
62}