source: orange/docs/tutorial/rst/code/sample_adult.py @ 9832:3df88cf3bae1

Revision 9832:3df88cf3bae1, 416 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Do not save sampling results as adult_sample.tab, because other files are using it!

Line 
1# Description: Read 'adult' data set and select 3% of instances (use stratified sampling)
2# Category:    preprocessing
3# Uses:        adult.tab
4# Classes:     ExampleTable, MakeRandomIndices2
5# Referenced:  basic_exploration.htm
6
7import orange
8data = orange.ExampleTable("adult_sample.tab")
9selection = orange.MakeRandomIndices2(data, 0.03)
10sample = data.select(selection, 0)
11sample.save("adult_sample_sampled.tab")
Note: See TracBrowser for help on using the repository browser.