Skip to content

Commit

Permalink
Remove "svd"s in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
appleparan committed Feb 19, 2020
1 parent c3c0dec commit 000d50e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -529,29 +529,24 @@ end
@testset "KNN" begin
# Test a case with few variable
# (e.g., only a few variables, only )
@testset "Data - few variables" begin
@testset "Data with few variables" begin
data = Matrix(dataset("Ecdat", "Electricity"))
X = add_missings(data)

knn_imputed = impute(copy(X), Impute.KNN(; num_nn=3, dist=Euclidean(), context=Context(; limit = 1.0)))
mean_imputed = impute(copy(X), Fill(; context=Context(; limit=1.0)))

# If we don't have enough variables then SVD imputation will probably perform
# about as well as mean imputation.
@test nrmsd(knn_imputed, data) > nrmsd(mean_imputed, data) * 0.9
end

@testset "Data - random variables" begin
@testset "Data with random values" begin
M = rand(100, 200)
data = M * M'
X = add_missings(data)

knn_imputed = impute(copy(X), Impute.KNN(; num_nn=3, dist=Euclidean(), context=Context(; limit = 1.0)))
mean_imputed = impute(copy(X), Fill(; context=Context(; limit=1.0)))

# If most of the variance in the original data can't be explained by a small
# subset of the eigen values in the svd decomposition then our low rank approximations
# won't perform very well.
@test nrmsd(knn_imputed, data) > nrmsd(mean_imputed, data) * 0.9
end
end
Expand Down

0 comments on commit 000d50e

Please sign in to comment.