-
Notifications
You must be signed in to change notification settings - Fork 25
Use countnz
instead of nnz
#9
base: master
Are you sure you want to change the base?
Conversation
I think this deprecation was already reversed: JuliaLang/julia@8879b88 |
hmm, I'm using following version of Julia, but still getting some warning. julia> versioninfo()
Julia Version 0.3.0-prerelease+3551
Commit 547facf* (2014-06-07 20:57 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin12.5.0)
CPU: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
WORD_SIZE: 64
BLAS: libgfortblas
LAPACK: liblapack
LIBM: libopenlibm julia> model = svm(X[:,train], Y[train])
Fitted linear SVM
WARNING: nnz(A::StridedArray) is deprecated, use countnz(A) instead.
in show at /Users/mic/.julia/v0.3/SVM/src/SVM.jl:15
in anonymous at show.jl:1045
in with_output_limit at show.jl:1022
in showlimited at show.jl:1044
in writemime at replutil.jl:2
in display at REPL.jl:114
in display at REPL.jl:117
in display at multimedia.jl:149
in print_response at REPL.jl:133
in print_response at REPL.jl:121
in anonymous at REPL.jl:521
in anonymous at REPL.jl:687
in anonymous at LineEdit.jl:1121
* Non-zero weights: 4
* Accuracy: 1.000000
* Iterations: 100
* Converged: true |
I have the same , julia> Pkg.update() julia> using SVM julia> using RDatasets julia> iris = data("datasets", "iris") julia> iris = datasets("datasets", "iris") julia> iris = dataset("datasets", "iris") julia> X = array(iris[:, 1:4])' julia> p, n = size(X) julia> Y = [species == "setosa" ? 1.0 : -1.0 for species in iris[:, "Species"]] julia> train = randbool(n) julia> model = svm(X[:,train], Y[train])
julia> accuracy = nnz(predict(model, X[:,~train]) .== Y[~train])/nnz(~train) julia> model = svm(X, Y, k = 150)
julia> model = svm(X, Y, lambda = 0.1)
julia> model = svm(X, Y, T = 1000)
julia> Paul |
@paulanalyst I've pull requested about Readme's example. see also #10 |
I reproduce same warning on following version.
|
In
Base.show
function, there is deprecated functionnnz
.It is preffered to use
countnz
instead ofnnz
.