Skip to main content
Solved

Create feature subset


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.

View original
Did this help you find an answer to your question?

3 replies

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

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


takashi
Evangelist
  • August 18, 2019
nielsgerrits wrote:

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
  • August 19, 2019
nielsgerrits wrote:

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.


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