How to use few files from audioDatastore after reading the whole wav files?

조회 수: 1 (최근 30일)
I am using audioDatastore for reading wav files from a folder then assign lables to each file. Now I want to use only few of those labels to train my model not all. My labels are there in ads.Labels. Could any one tell me how to do that, before splitting using them as:
[adsTrain,adsTest] = splitEachLabel(ads,0.8);
Here ads should have only some selected labels say 1, 2, 3 out of 1,2,3,4,5,6,7.
I am not able to write that conditional statement here for object ads.
Thanks

채택된 답변

jibrahim
jibrahim 2022년 12월 14일
Hi Krishna,
You can use subset for this. Something like:
ads = subset(ads,ads.Labels==1 || ads.Labels==2)
  댓글 수: 12
Walter Roberson
Walter Roberson 2022년 12월 18일
ads = subset(ads,strcmp(ads.Labels,'Happy')|strcmp(ads.Labels,'Sad')|strcmp(ads.Labels,'Angry'));
krishna Chauhan
krishna Chauhan 2022년 12월 19일
편집: krishna Chauhan 2022년 12월 19일
@Walter Roberson Thank you sir, you are awalys a life saver. So finally this is a partial answer with the initial accepted answer of this problem.
@jibrahim Thanks you so much sir.
@Image Analyst Thats a genral question I think, no specific data is needed.
My question was can I use the ads objcet for a specifca set of labels?
these labels are cell sturcture.
Regards

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 AI for Signals에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by