Load Signal Data from mat files for Training of neural network
8 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Ruchika
2023-7-31
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 AI for Signals 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!