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
14
15
16#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
17pub struct ClassificationInferenceOptions {  /// Specifies the number of top class predictions to return. Defaults to 0.
18    #[serde(rename = "num_top_classes", default, skip_serializing_if = "Option::is_none")]
19    pub num_top_classes: Option<u32>,  /// Specifies the maximum number of feature importance values per document.
20    #[serde(rename = "num_top_feature_importance_values", default, skip_serializing_if = "Option::is_none")]
21    pub num_top_feature_importance_values: Option<u32>,  /// The field that is added to incoming documents to contain the inference prediction. Defaults to `predicted_value`.
22    #[serde(rename = "results_field", default, skip_serializing_if = "Option::is_none")]
23    pub results_field: Option<String>,  /// Specifies the field to which the top classes are written. Defaults to `top_classes`.
24    #[serde(rename = "top_classes_results_field", default, skip_serializing_if = "Option::is_none")]
25    pub top_classes_results_field: Option<String>,  /// 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.
26    #[serde(rename = "prediction_field_type", default, skip_serializing_if = "Option::is_none")]
27    pub prediction_field_type: Option<String>,
28}
29
30impl ClassificationInferenceOptions {
31    
32    pub fn new() -> ClassificationInferenceOptions {
33        ClassificationInferenceOptions {
34            num_top_classes: None,
35            num_top_feature_importance_values: None,
36            results_field: None,
37            top_classes_results_field: None,
38            prediction_field_type: None,
39        }
40    }
41}