Random Samplers

Ver. 1.0.0 (2023-04-14)

This module provides a ready-to-use stream sampler class SamplerRND.

class mlpro.bf.streams.samplers.random.SamplerRND(p_num_instances: int = 0, p_max_step_rate: int = 5, p_seed: int = 0)

Bases: Sampler

A ready-to-use class for data streams with random sampler. This object can be used in Stream.

Parameters:
  • p_num_instances (int) – Number of instances. This parameter has no affect in this sampler method. Default = 0.

  • p_max_step_rate (int) – Maximum step rate parameter for non time series data streams. Default = 5.

  • p_seed (int) – Random seeding. Default = 0.

C_TYPE = 'Random Sampler'
reset()

A method to reset the sampler’s settings.

_omit_instance(p_inst: Instance) bool

A custom method to filter any incoming instances, which is being called by omit_instance() method.

Parameters:

p_inst (Instance) – An input instance to be filtered.

Returns:

False means the input instance is not omitted, otherwise True.

Return type:

bool