You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to fit MulticlassLDA on the iris dataset. The predict is throwing an error. I was wondering if you can help me to figure out what mistakes I am making.
using MultivariateStats, RDatasets;
iris =dataset("datasets", "iris");
X =Matrix(iris[1:1:end,1:4])
X_labels =Vector(iris[1:1:end,5])
X1 =Matrix(X')
y =X_labels
labels =repeat([3],length(y))
for (idx,X_labels) inenumerate(y)
if X_labels =="virginica"
labels[idx] =1elseif X_labels =="setosa"
labels[idx] =2endend
y = labels;
y =vec(y')
lda =fit(MulticlassLDA, 3, X1, y);
Up to fitting, everything is perfect. Now I am facing the problem.
predict(lda, X1)
MethodError: no method matching predict(::MulticlassLDA{Float64}, ::Matrix{Float64})
Closest candidates are:predict(::Discriminant, ::AbstractMatrix{T}where T) at /Users/sourishdas/.julia/packages/MultivariateStats/HTpHt/src/lda.jl:26
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
Hi
I am trying to fit
MulticlassLDA
on theiris
dataset. Thepredict
is throwing an error. I was wondering if you can help me to figure out what mistakes I am making.Up to fitting, everything is perfect. Now I am facing the problem.
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: