How to generate an artificial dataset??...

10 views (last 30 days)
sani ars
sani ars on 29 May 2012
How we can create an artificial dataset??.... Actually, I need to evaluate the performance of Adaboost.M1 on artificial dataset.....
Tell me the proper syntax for it....

Answers (1)

Jason Ross
Jason Ross on 29 May 2012
This depends on what you need in your data set. You could use functions like ones, zeros, rand, magic, etc to generate things. If you are looking for test cases specific for your code you would have to populate the data set yourself -- for example, if you know you need to test your code with inputs of 0, -1, 1, 22 and 55 (as a simple example), only you know that since you write the code.
Ideally you should write your code so that you can switch from the artificial data to the actual data without changing anything in the actual code. You can do this using importing files (e.g you keep the artificial data set around and use it as input), use a conditional flag to run your program in diagnostic mode where it generates the data, etc
Note that there's not one "right" way to do this -- the design of the test code is usually tightly coupled with the actual code being tested to make sure that the output of the program is as expected. For performance testing, it's generally good practice to keep the machine busy enough that you can get meaningful numbers to compare against each other -- meaning test times at least in the "seconds" range, maybe longer depending on what you are doing. But if you go too quickly, it becomes harder and harder to know how much of a performance change comes from code changes versus the ability of the machine to actually keep time.

Categories

Find more on Holidays / Seasons in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!