Skip to main content
Solved

Create feature subset

  • August 18, 2019
  • 3 replies
  • 114 views

whkarto
Contributor
Forum|alt.badge.img+14

Hi everyone,

I'd like to create an arbitrary subset of features and can't find a suiteable way to do this. My features have a unique ID and I'd like to select a sample of n-features of it. How can I get n-individual random numbers to test these numbers against my ID and filter the features this way? Or how can I fetch n indices from a list that might be created from the features?

Here is some sample data:

Best answer by nielsgerrits

I use a Sampler for this, but there are probably better ways to randomize the sample.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2939 replies
  • Best Answer
  • August 18, 2019

I use a Sampler for this, but there are probably better ways to randomize the sample.


takashi
Celebrity
  • 7843 replies
  • August 18, 2019

I use a Sampler for this, but there are probably better ways to randomize the sample.

Agree that the Sampler is the way to go. The modern Sampler has the Randomize Sampling parameter.


whkarto
Contributor
Forum|alt.badge.img+14
  • Author
  • Contributor
  • 58 replies
  • August 19, 2019

I use a Sampler for this, but there are probably better ways to randomize the sample.

Yes, the sampler does the trick, although it is not possible to hand over the sampling rate to an attribute created during runtime. In case the rate exceeds the feature count, the sampler can handle this situation without any problems and routes all input features to the sampled port.