Skip to content

Commit

Permalink
Use fixed dimension in error tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GBathie committed Mar 1, 2024
1 parent a5f1ad3 commit 151900a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion algorithms/linfa-reduction/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ pub enum ReductionError {
InvalidPrecision,
#[error("Target dimension of the projection must be positive")]
NonPositiveEmbeddingSize,
#[error("Target dimension {0} is larger than the number of features {1}. ")]
#[error("Target dimension {0} is larger than the number of features {1}.")]
DimensionIncrease(usize, usize),
}
4 changes: 2 additions & 2 deletions algorithms/linfa-reduction/src/random_projection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ mod tests {
let records = array![[10., 10.], [1., 12.], [20., 30.], [-20., 30.],];
let dataset = Dataset::from(records);
let res = GaussianRandomProjection::<f32>::params()
.eps(0.1)
.target_dim(10)
.fit(&dataset);
assert!(res.is_err())
}
Expand All @@ -76,7 +76,7 @@ mod tests {
let records = array![[10., 10.], [1., 12.], [20., 30.], [-20., 30.],];
let dataset = Dataset::from(records);
let res = SparseRandomProjection::<f32>::params()
.eps(0.1)
.target_dim(10)
.fit(&dataset);
assert!(res.is_err())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,3 @@ impl<F: Float> SparseRandomProjection<F> {
}

impl_proj! {SparseRandomProjection<F>}

0 comments on commit 151900a

Please sign in to comment.