Load Signal Data from mat files for Training of neural network
8 views (last 30 days)
Show older comments
I have a dataset of signals with n*2 dimension. I want to make a datastore for it by assigning the labels from the sources. I have used fileDatastore but it does not support LabelSource argument as it is supported in imageDatastore.
Any help will be appreciated.
0 Comments
Answers (1)
Ruchika
on 31 Jul 2023
Hi, based on my understanding, you have a dataset of signals with dimensions n*2, and you want to create a datastore for this dataset by assigning labels from the sources. To clarify, fileDatastore is normally used to read collections of files, but imageDatastore is made to handle image data and has features like the LabelSource argument for giving the photos labels. In your situation, you may need to take a different route to establish a datastore with labels as your dataset consists of signals rather than images. Use MATLAB's datastore function to build a custom datastore by supplying the read and write routines as well as the labels for each signal as one option.
If you have a dataset of signals with n*2 dimensions and you want to create a datastore with corresponding labels from the sources, you can use the matlab.io.datastore.DsFileSet object to achieve this.
% Create a DsFileSet object with the signal files and labels
fileSet = matlab.io.datastore.DsFileSet(dataPath, 'FileExtensions', '.mat', 'Labels', labels);
% Replace dataPath with the actual path to your signals dataset
% Replace labels with the array that stores the labels extracted from the signal files in the dataset.
% Create a datastore using the DsFileSet object
datastore = matlab.io.datastore.FileDatastore(fileSet);
To learn more about collection of files in datastore, please check out the MathWorks documentation links below:
0 Comments
See Also
Categories
Find more on AI for Signals in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!