Hello, I am trying to divide my dataset(iris dataset) into training and test sets randomly. My dataset contains 150 patterns. And I need to divide 90 patterns to test set, and the rest to training set. How can I do this? Help me with the C code. Thank you

You aren't providing enough information to really help you. That said, put the data set structures (you are using structures aren't you?) or strings, or whatever, into an array. They use a random number generator to randomly select items for the test set, and put the rest into the training set.

Yes sir, I am using structures. And how can I use the random number generator to randomly select the items for test and training set paterns? Help me please, thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.