필터 지우기
필터 지우기

Data format for classification Learner App for time sequence to class prediction

조회 수: 14 (최근 30일)
Subhadip
Subhadip 2024년 1월 14일
편집: Subhadip 2024년 1월 17일
I want to use Classification Learner App for dataset with 400 observations divided into 4 folders: A,B,C,D (100 each).
Folder Names are as per their category/ class: A,B,C,D.
Each observation is stored in CSV file as Var 1,....Var 10 (as col) for 20 time steps (as row).
Is it possible to import these data in Classification Learner App in some way?

답변 (1개)

Binaya
Binaya 2024년 1월 14일
Hi Subhadip
I understand that you want to load your dataset into MATLAB's Classification Learner app.
To load the dataset into Classification Learner app, please follow the below steps:
  1. Read the all CSV files into MATLAB workspace using "readtable" function.
  2. Concatenate all the tables into one using "vertcat".
  3. In Classification Learner app, select the final combined table as the input.
  4. The data from the table should now be loaded into the Classification Learner app.
Please refer to the below documentation for more details:
  1. "classificationLearner": https://www.mathworks.com/help/stats/classificationlearner-app.html
  2. "readtable": https://www.mathworks.com/help/matlab/ref/readtable.html
  3. "vertcat": https://www.mathworks.com/help/matlab/ref/double.vertcat.html
I hope this helps.
Regards
Binaya
  댓글 수: 1
Subhadip
Subhadip 2024년 1월 17일
편집: Subhadip 2024년 1월 17일
Thanks Binaya. I kept all csv in one folder and stored in DataTable datastore, I could have kept the files in separate folder as per the category and store it in sepratae Datastore and then combine them with "vertcat". However both provide the same result. I also have obs_class of same size as DataTable and then combined them in Final_DataTable.
fds = fileDatastore("my path","ReadFcn",@readtable,"FileExtensions",'.csv')
DataTable = readall(fds);
Final_DataTable=table(DataTable, obs_class, 'VariableNames', {'Data', 'Class'});
But the classification learner still did not pick up the predictor sequence from each cell in the table. It took the response from categorical array. Attached the snapshot. I could not find example for Classification Learners with each entry of variable as sequence.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by