-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What wrong in model = knn(X, y, metric = Euclidean()) #12
Comments
Looks like you're working with an older version of the package. |
kNN 0.0.0 julia> Pkg.checkout("kNN") julia> Pkg.add("NearestNeighbors") any package NearestNeighbors on available list W dniu 2014-06-06 17:27, John Myles White pisze:
|
last error was on Win7. Now Updated Ubuntu 13,10 julia> Pkg.update() julia> using kNN julia> using DataArrays julia> using DataFrames julia> using RDatasets julia> using Distance julia> Pkg.status()
julia> Pkg.build("kNN") julia> Pkg.checkout("kNN") julia> Paul |
New Julia , kNN updated and stiil the same bug: ERROR: unknown package NearestNeighbors required by kNN julia> Pkg.update() julia> Pkg.checkout("kNN") julia> Pkg.rm("kNN") julia> |
I would suggest you not use this package for a few months. |
It's sad :/ Paul W dniu 2014-06-13 16:51, John Myles White pisze:
|
I would like to use this package in a Chapter for an upcoming book about Machine Learning and Julia, can kNN be made usable without too much effort? Thanks! |
What wrong in model = knn(X, y, metric = Euclidean()) ERROR: function knn does not accept keyword arguments ?
_
_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: http://docs.julialang.org
_ _ | | __ _ | Type "help()" to list help topics
| | | | | | |/ ` | |
| | || | | | (| | | Version 0.3.0-prerelease+3431 (2014-06-03 20:06 UTC)
/ |_'|||__'| | Commit 1769118* (2 days old master)
|__/ | x86_64-w64-mingw32
julia> Pkg.update()
INFO: Updating METADATA...
INFO: Updating Distributions...
INFO: Computing changes...
INFO: No packages to install, update or remove
julia> using kNN
julia> using DataArrays
julia> using DataFrames
julia> using RDatasets
julia> using Distance
julia>
julia> iris = data("datasets", "iris")
ERROR: no method data(ASCIIString, ASCIIString)
julia> X = array(iris[:, 1:4])'
ERROR: iris not defined
julia> iris = ("datasets", "iris")
("datasets","iris")
julia> iris = ("datasets", "iris")
("datasets","iris")
julia> iris =dataset("datasets", "iris")
150x5 DataFrame
|-------|-------------|------------|-------------|------------|-------------|
| Row # | SepalLength | SepalWidth | PetalLength | PetalWidth | Species |
| 1 | 5.1 | 3.5 | 1.4 | 0.2 | "setosa" |
| 2 | 4.9 | 3.0 | 1.4 | 0.2 | "setosa" |
| 3 | 4.7 | 3.2 | 1.3 | 0.2 | "setosa" |
| 4 | 4.6 | 3.1 | 1.5 | 0.2 | "setosa" |
| 5 | 5.0 | 3.6 | 1.4 | 0.2 | "setosa" |
| 6 | 5.4 | 3.9 | 1.7 | 0.4 | "setosa" |
| 7 | 4.6 | 3.4 | 1.4 | 0.3 | "setosa" |
| 8 | 5.0 | 3.4 | 1.5 | 0.2 | "setosa" |
| 9 | 4.4 | 2.9 | 1.4 | 0.2 | "setosa" |
?
| 141 | 6.7 | 3.1 | 5.6 | 2.4 | "virginica" |
| 142 | 6.9 | 3.1 | 5.1 | 2.3 | "virginica" |
| 143 | 5.8 | 2.7 | 5.1 | 1.9 | "virginica" |
| 144 | 6.8 | 3.2 | 5.9 | 2.3 | "virginica" |
| 145 | 6.7 | 3.3 | 5.7 | 2.5 | "virginica" |
| 146 | 6.7 | 3.0 | 5.2 | 2.3 | "virginica" |
| 147 | 6.3 | 2.5 | 5.0 | 1.9 | "virginica" |
| 148 | 6.5 | 3.0 | 5.2 | 2.0 | "virginica" |
| 149 | 6.2 | 3.4 | 5.4 | 2.3 | "virginica" |
| 150 | 5.9 | 3.0 | 5.1 | 1.8 | "virginica" |
julia> X = array(iris[:, 1:4])'
4x150 Array{Float64,2}:
5.1 4.9 4.7 4.6 5.0 5.4 4.6 5.0 6.8 6.7 6.7 6.3 6.5 6.2 5.9
3.5 3.0 3.2 3.1 3.6 3.9 3.4 3.4 3.2 3.3 3.0 2.5 3.0 3.4 3.0
1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 5.9 5.7 5.2 5.0 5.2 5.4 5.1
0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 2.3 2.5 2.3 1.9 2.0 2.3 1.8
julia> y = array(iris[:, 5])
150-element Array{ASCIIString,1}:
"setosa"
"setosa"
"setosa"
"setosa"
"setosa"
"setosa"
"setosa"
"setosa"
"setosa"
"setosa"
?
"virginica"
"virginica"
"virginica"
"virginica"
"virginica"
"virginica"
"virginica"
"virginica"
"virginica"
"virginica"
julia> model = knn(X, y, metric = Euclidean())
ERROR: function knn does not accept keyword arguments
julia> model = kNN(X, y, metric = Euclidean())
ERROR: type: apply: expected Function, got Module
julia> model = kNN(X, y,Euclidean())
ERROR: type: apply: expected Function, got Module
julia> model = kNN(X, y, Euclidean()(X,y))
ERROR: type: apply: expected Function, got Module
julia> model = kNN(Euclidean()(X,y))
ERROR: type: apply: expected Function, got Module
julia> Euclidean(X,y)
ERROR: no method Euclidean(Array{Float64,2}, Array{ASCIIString,1})
julia> Euclidean(()X,y)
ERROR: no method *((), Array{Float64,2})
julia> (Euclidean().X,y)
ERROR: type Euclidean has no field X
julia> (Euclidean(),X,y)
(Euclidean(),
4x150 Array{Float64,2}:
5.1 4.9 4.7 4.6 5.0 5.4 4.6 5.0 6.8 6.7 6.7 6.3 6.5 6.2 5.9
3.5 3.0 3.2 3.1 3.6 3.9 3.4 3.4 3.2 3.3 3.0 2.5 3.0 3.4 3.0
1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 5.9 5.7 5.2 5.0 5.2 5.4 5.1
0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 2.3 2.5 2.3 1.9 2.0 2.3 1.8,
ASCIIString["setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa
" "virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica"
,"virginica","virginica"])
julia> model=kNN(Euclidean(),X,y)
ERROR: type: apply: expected Function, got Module
julia>
The text was updated successfully, but these errors were encountered: