Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mpastell committed Dec 1, 2017
1 parent 1a7b5d1 commit 68cf7c4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ os:
- linux
notifications:
email: false
matrix:
allow_failures:
- julia: nightly
after_success:
- julia -e 'cd(Pkg.dir("LIBSVM")); Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
- julia -e 'cd(Pkg.dir("LIBSVM")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
7 changes: 7 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ environment:
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"

matrix:
allow_failures:
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"

branches:
only:
- master
Expand Down
6 changes: 3 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ y = Array(whiteside[:Temp])

m = svmtrain(X, y, svmtype = EpsilonSVR, cost = 10., gamma = 1.)
yeps, d = svmpredict(m, X)
@test_approx_eq(sum(yeps - y), 7.455509045783046)
@test sum(yeps - y) 7.455509045783046
skm = fit!(EpsilonSVR(cost = 10., gamma = 1.), X', y)
ysk = predict(skm, X')
@test yeps == ysk

nu1 = svmtrain(X, y, svmtype = NuSVR, cost = 10.,
nu = .7, gamma = 2., tolerance = .001)
ynu1, d = svmpredict(nu1, X)
@test_approx_eq(sum(ynu1 - y), 14.184665717092)
@test sum(ynu1 - y) 14.184665717092
sknu1 = fit!(NuSVR(cost = 10., nu=.7, gamma = 2.), X', y)
ysknu1 = predict(sknu1, X')
@test ysknu1 == ynu1

nu2 = svmtrain(X, y, svmtype = NuSVR, cost = 10., nu = .9)
ynu2, d =svmpredict(nu2, X)
@test_approx_eq(sum(ynu2 - y), 6.686819661799177)
@test sum(ynu2 - y) 6.686819661799177
sknu2 = fit!(NuSVR(cost = 10., nu=.9), X', y)
ysknu2 = predict(sknu2, X')
@test ysknu2 == ynu2

0 comments on commit 68cf7c4

Please sign in to comment.