1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! Display utilities for formatting optional and KNN values.
use ;
use ;
/// Convert an `Option<T>` to a `String` for printing in display mode.
///
/// # Examples
/// ```
/// use automl::utils::display::print_option;
///
/// let value = Some(5);
/// let none: Option<i32> = None;
/// assert_eq!(print_option(value), "5");
/// assert_eq!(print_option(none), "None");
/// ```
/// Convert an `Option<T>` to a `String` for printing in debug mode.
///
/// # Examples
/// ```
/// use automl::utils::display::debug_option;
///
/// let complex_output = debug_option(Some(vec![1, 2]));
/// assert_eq!(complex_output, "[\n 1,\n 2,\n]");
/// let none: Option<i32> = None;
/// assert_eq!(debug_option(none), "None");
/// ```
/// Get the name for a KNN weight function.
///
/// # Examples
/// ```
/// use automl::utils::display::print_knn_weight_function;
/// use smartcore::neighbors::KNNWeightFunction;
///
/// assert_eq!(print_knn_weight_function(&KNNWeightFunction::Uniform), "Uniform");
/// assert_eq!(print_knn_weight_function(&KNNWeightFunction::Distance), "Distance");
/// ```
/// Get the name for a KNN search algorithm.
///
/// # Examples
/// ```
/// use automl::utils::display::print_knn_search_algorithm;
/// use smartcore::algorithm::neighbour::KNNAlgorithmName;
///
/// assert_eq!(
/// print_knn_search_algorithm(&KNNAlgorithmName::LinearSearch),
/// "Linear Search"
/// );
/// assert_eq!(
/// print_knn_search_algorithm(&KNNAlgorithmName::CoverTree),
/// "Cover Tree"
/// );
/// ```