MCPcopy Create free account
hub / github.com/daniel-e/rustml / test_dbscan

Function test_dbscan

src/dbscan.rs:113–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

111
112 #[test]
113 fn test_dbscan() {
114
115 let data = vec![
116 Point2D::new(1.0, 2.0),
117 Point2D::new(5.0, 3.0),
118 Point2D::new(2.0, 4.0),
119 Point2D::new(3.0, 1.0),
120 Point2D::new(2.0, 2.0),
121 Point2D::new(4.0, 3.0),
122 Point2D::new(1.0, 2.0),
123 Point2D::new(2.0, 5.0),
124 Point2D::new(14.0, 13.0),
125 Point2D::new(11.0, 12.0),
126 Point2D::new(12.0, 15.0),
127 Point2D::new(32.0, 25.0),
128 ];
129
130 let r = dbscan(&data, 5.0, 3);
131 assert_eq!(r, vec![0,0,0,0,0,0,0,0,1,1,1,-1]);
132 }
133}
134

Callers

nothing calls this directly

Calls 1

dbscanFunction · 0.85

Tested by

no test coverage detected