()
| 80 | |
| 81 | #[test] |
| 82 | fn test_knn_classify() { |
| 83 | |
| 84 | let m = mat![ |
| 85 | 1.0, 2.0; |
| 86 | 1.1, 2.1; |
| 87 | 2.0, 3.0; |
| 88 | 0.9, 1.9; |
| 89 | 2.1, 2.9 |
| 90 | ]; |
| 91 | |
| 92 | let labels = vec![1, 2, 2, 1, 2]; |
| 93 | let target = classify(&m, &labels, &[1.3, 2.0], 3, |x, y| Euclid::compute(x, y).unwrap()); |
| 94 | assert_eq!(target, 1); |
| 95 | } |
| 96 | |
| 97 | #[test] |
| 98 | fn test_scan() { |
nothing calls this directly
no test coverage detected