How to use excel datastore to in a classification problem
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ernest Modise - Kgamane
el 11 de Abr. de 2024
Comentada: Walter Roberson
el 17 de Abr. de 2024
In have 5 excel spreadsheet, named, material1.xlsx, ...material5.xlsx. Each of these spreadsheet is placed in a folder called Material1 ... Material5.
Each spreadsheet has 200 rows, with each rows having 100 columns. Meaning each spreadsheet has 200 samples, and each sample has 100 measurements against it,
E.g. if I use readtable
T = xlsread('C:\Users\ernes\OneDrive\Documents\MATLAB\Material1\Material1.xlsx');
So sample 170 is
TM = T(170,:);
as an example, the size(TM) = 1 x 100;
Thus in a nutshell, I want to classify these 5 materials. I first want to train a network that can do this classification task, the foldernames are also labels.
How do I do this using spreadsheetdatastores?
I have only trained networks using imageDatastore, for example in the MNIST images, here is how the loading of the images into the datastore is done
path = fullfile(matlabroot,'toolbox','nnet/nndemos/nndatasets/DigitDataset/');
imds = imageDatastore(path,'IncludeSubfolders',true,'LabelSource','foldernames');
0 comentarios
Respuesta aceptada
Drew
el 12 de Abr. de 2024
As listed in the doc at https://www.mathworks.com/help/matlab/ref/matlab.io.datastore.spreadsheetdatastore.html, the purpose of spreadsheetDatastore is as follows: "Use a spreadsheetDatastore object to manage large collections of spreadsheet files where the collection does not necessarily fit in memory. You can create a spreadsheetDatastore object using the spreadsheetDatastore function, specify its properties, and then import the data using object functions."
Since you have only 5 spreadsheets which are each 200x100 in size, all of the data from all 5 spreadsheets can fit easily in memory. So, you might just want to load all of the data into a single table, and then do classification experiments with the Classification Learner app from the Statistics and Machine Learning Toolbox. Classification Learner includes the ability to train many types of machine learning models, including neural networks. You could also train neural networks using the Deep Learning Toolbox.
Even though your data is small enough to fit in memory, if you still want to use spreadsheetDatastore, the doc page https://www.mathworks.com/help/matlab/ref/matlab.io.datastore.spreadsheetdatastore.html should provide the info that you need.
If this answer helps you, please remember to accept the answer.
5 comentarios
Walter Roberson
el 17 de Abr. de 2024
@ernest modise comments:
I really this help. I have searched YouTube, I only see meaningful application of image based problems
Más respuestas (0)
Ver también
Categorías
Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!