use smartcore::linalg::basic::matrix::DenseMatrix;
pub fn classification_testing_data() -> (DenseMatrix<f64>, Vec<u32>) {
let x = DenseMatrix::from_2d_array(&[
&[0.0, 0.0],
&[0.1, 0.0],
&[0.0, 0.1],
&[0.1, 0.1],
&[0.9, 0.9],
&[1.0, 0.9],
&[0.9, 1.0],
&[1.0, 1.0],
&[0.0, 0.2],
&[0.2, 0.0],
&[0.0, 0.3],
&[0.3, 0.0],
&[0.8, 0.7],
&[0.7, 0.8],
&[0.8, 0.8],
&[0.7, 0.7],
])
.unwrap();
let y = vec![0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1];
(x, y)
}
#[cfg(test)]
pub fn bernoulli_binary_classification_data() -> (DenseMatrix<f64>, Vec<u32>) {
let x = DenseMatrix::from_2d_array(&[
&[1.0, 0.0, 1.0],
&[0.0, 1.0, 0.0],
&[1.0, 1.0, 0.0],
&[0.0, 0.0, 1.0],
])
.unwrap();
let y = vec![1, 0, 1, 0];
(x, y)
}
#[cfg(test)]
pub fn bernoulli_threshold_classification_data() -> (DenseMatrix<f64>, Vec<u32>) {
let x =
DenseMatrix::from_2d_array(&[&[0.2, 0.8], &[0.7, 0.3], &[0.9, 0.1], &[0.1, 0.9]]).unwrap();
let y = vec![1, 0, 0, 1];
(x, y)
}