Using gpuArray in Matlab function predict
Show older comments
I'm trying to create a classifier and taking advantage of my Gtx 960. My code is as follows,
nxtr = gpuArray(nxtr);
ytr = gpuArray(ytr);
mdl = fitcsvm(nxtr, ytr);
newy = predict(mdl, nxte);
and I got the error,
Error using pdist2mex X and Y inputs to PDIST2MEX must both be double, or both be single.
Error in pdist2 (line 345) [D,I] = pdist2mex(X',Y',dist,additionalArg,smallestLargestFlag,radius);
Error in ExhaustiveSearcher/knnsearch (line 207) [dist,idx] = pdist2(obj.X,Y, distMetric, arg{:}, 'smallest',numNN);
Error in ClassificationKNN/score (line 425) [CIDX,dist] = knnsearch(this.NS, X,'k',this.ModelParams.NumNeighbors,...
Error in ClassificationKNN/predict (line 696) posteriors = score(this,X);
Error in pilot_v4_first (line 114) newy = predict(mdl, nxte);
How come fitcsvm does not return an error but predict does?
Answers (0)
Categories
Find more on Classification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!