94 vues (au cours des 30 derniers jours)
Jacob Ebilane
Jacob Ebilane le 11 Mar 2022
Commenté : Jacob Ebilane le 13 Mar 2022
I am new to OCRs and am trying to use the MNIST dataset in matlab. I found a csv version of the data set which is usable in MATLAB then stored it as a .mat file (Somehow loads faster, I'm not so sure why if you do know do tell me). I wanted to try it on the fitcknn command as such
clc, clear
close all;
load 'mnist_train.mat'
knnmodel = fitcknn(mnist_train,"Var1")
I tried the Onramp course and tried to mimic how they did it but I get these error messages. I wanted to know if I can make this work and how.
Error using classreg.learning.FullClassificationRegressionModel.prepareDataCR (line 234)
X and Y do not have the same number of observations.
Error in classreg.learning.classif.FullClassificationModel.prepareData (line 821)
Error in ClassificationKNN.prepareData (line 926)
Error in classreg.learning.FitTemplate/fit (line 233)
Error in (line 911)
this = fit(temp,X,Y);
Error in fitcknn (line 264)
this =,Y,RemainingArgs{:});
Error in OCR (line 6)
knnmodel = fitcknn(mnist_train,"Var1");

Réponse acceptée

larasupernovae le 11 Mar 2022
So here is book, check out Chapter 6 if you are begining the MNIST in MatLab this is the best way to understand it all, hope this helps :) I also included my code from the book, a while a back when I was starting out with MNIST.
  3 commentaires
Jacob Ebilane
Jacob Ebilane le 13 Mar 2022
I guess it has something to do with the algorithm I have for separating each digit. I think it has something to do with the data reaching the top of the image itself.

Connectez-vous pour commenter.

Plus de réponses (0)


En savoir plus sur Image Data Workflows dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by