Implement abstract method to convert a slice to a BaseVector, Implement RealNumberVector over BaseVector instead of over Vec<T>
This commit is contained in:
@@ -58,10 +58,7 @@ impl<T: RealNumber, M: Matrix<T>, D: NBDistribution<T, M>> BaseNaiveBayes<T, M,
|
||||
*prediction
|
||||
})
|
||||
.collect::<Vec<T>>();
|
||||
let mut y_hat = M::RowVector::zeros(rows);
|
||||
for (i, prediction) in predictions.iter().enumerate().take(rows) {
|
||||
y_hat.set(i, *prediction);
|
||||
}
|
||||
let y_hat = M::RowVector::from_slice(&predictions);
|
||||
Ok(y_hat)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user