Using gpuArray in Matlab function predict

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)

Asked:

on 27 Jan 2016

Edited:

on 27 Jan 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!