fix: cargo fmt
This commit is contained in:
+11
-11
@@ -1,34 +1,34 @@
|
||||
pub mod accuracy;
|
||||
pub mod recall;
|
||||
pub mod precision;
|
||||
pub mod recall;
|
||||
|
||||
use crate::math::num::FloatExt;
|
||||
use crate::linalg::BaseVector;
|
||||
use crate::math::num::FloatExt;
|
||||
|
||||
pub struct ClassificationMetrics{}
|
||||
pub struct ClassificationMetrics {}
|
||||
|
||||
impl ClassificationMetrics {
|
||||
pub fn accuracy() -> accuracy::Accuracy{
|
||||
pub fn accuracy() -> accuracy::Accuracy {
|
||||
accuracy::Accuracy {}
|
||||
}
|
||||
|
||||
pub fn recall() -> recall::Recall{
|
||||
|
||||
pub fn recall() -> recall::Recall {
|
||||
recall::Recall {}
|
||||
}
|
||||
|
||||
pub fn precision() -> precision::Precision{
|
||||
pub fn precision() -> precision::Precision {
|
||||
precision::Precision {}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn accuracy<T: FloatExt, V: BaseVector<T>>(y_true: &V, y_prod: &V) -> T{
|
||||
pub fn accuracy<T: FloatExt, V: BaseVector<T>>(y_true: &V, y_prod: &V) -> T {
|
||||
ClassificationMetrics::accuracy().get_score(y_true, y_prod)
|
||||
}
|
||||
|
||||
pub fn recall<T: FloatExt, V: BaseVector<T>>(y_true: &V, y_prod: &V) -> T{
|
||||
pub fn recall<T: FloatExt, V: BaseVector<T>>(y_true: &V, y_prod: &V) -> T {
|
||||
ClassificationMetrics::recall().get_score(y_true, y_prod)
|
||||
}
|
||||
|
||||
pub fn precision<T: FloatExt, V: BaseVector<T>>(y_true: &V, y_prod: &V) -> T{
|
||||
pub fn precision<T: FloatExt, V: BaseVector<T>>(y_true: &V, y_prod: &V) -> T {
|
||||
ClassificationMetrics::precision().get_score(y_true, y_prod)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user