how to split a dataset for training and testing in matlab?

35 views (last 30 days)
i have a dataset in .mat format with variables having different dimensions. i want to used this dataset to train the machine learning algorithm. Before training , first i need to split the data into two- one for training and one for testing. Can someone please help me out with this problem?
Bidyarani on 22 Jan 2023
@Sargondjani i have a dataset in .mat format . I have gone through many tutorial for data splitting but found that most of the tutorial are using dataset in csv file format. Since my dataset is in mat format and every variables have different dimensions , i am not able to understand it. Can you please help me splitting this data for training machine learning model . i am not able attached the file since the file is too big. i will attached the link below.

Sign in to comment.

Accepted Answer

the cyclist
the cyclist on 22 Jan 2023
randsample, cvpartition, and randperm can all be useful for creating training/test splits. As @Sargondjani mentions, we need more info to give a more specific solution.
the cyclist
the cyclist on 22 Jan 2023
I did look at the data on the github repo. (For the sake of anyone else here, I have attached a screenshot of what the variable workspace looks like.)
Please think about this from our perspective. You have 27 variables, we have no idea what they all mean. (Of course, we can guess a little bit from the variable names and the github repo name.)
Unless you can be a lot more specific about exactly what you are trying to do, there is no chance that we can help you. We don't know what you are trying to predict. We don't know what the features are. (This would sometimes be called the response and explanatory variables.)
It is unusual that some of the variables are close -- but not exactly -- the same dimension. We can't figure that out for you.
If you just have one specific variable that you are trying to split into training and test sets, that is easy. But it seems you need more help than just that.

Sign in to comment.

More Answers (0)




Community Treasure Hunt

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

Start Hunting!