Skip to main content
Question

Get random features from a dataset

  • September 7, 2021
  • 4 replies
  • 292 views

boubcher
Contributor
Forum|alt.badge.img+11

hello there w want to extract some features from the dataset randomly

ex:

we have 300 features coming in we want to get only 160 from them randomly

we trayed to use the sample, but it did work since its working base on the N rate

Any suggestion

Thanks

 

4 replies

ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • September 7, 2021

You can change the sampling type to the first N features, set N to 160 and select Yes for Randomize sampling. Note that this will select 160 features out of the 300 at random but they will be in the original order.

 

If you want a random order, you can use a random number generator, sort by the random number then use the sampler to get the first 160


boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • September 7, 2021

Thanks

Great


boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • September 7, 2021

is there a way we could assign the sampling value to an attribute value , its taking only parameter , since this value will depend on count of the coming features

Thanks


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • September 7, 2021
boubcher wrote:

is there a way we could assign the sampling value to an attribute value , its taking only parameter , since this value will depend on count of the coming features

Thanks

I don't think it's possible in the sampler. An alternative would be after sorting to use a counter, followed by a tester and only pass features where count < sample size


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings