class_docstr: Random Radial Basis Function generator with concept drift.
  
  This class is an extension from the `RandomRBF` generator. Concept drift
  can be introduced in instances of this class.
  
  The drift is created by adding a "speed" to certain centroids. As the
  samples are generated each of the moving centroids' centers is
  changed by an amount determined by its speed.
  
  Parameters
  ----------
  seed_model
      Model's random seed to generate centroids.
  seed_sample
      Sample's random seed.
  n_classes
      The number of class labels to generate.
  n_features
      The number of numerical features to generate.
  n_centroids
      The number of centroids to generate.
  change_speed
      The concept drift speed.
  n_drift_centroids
      The number of centroids that will drift.
  
  Examples
  --------
  >>> from river.datasets import synth
  >>>
  >>> dataset = synth.RandomRBFDrift(seed_model=42, seed_sample=42,
  ...                                n_classes=4, n_features=4, n_centroids=20,
  ...                                change_speed=0.87, n_drift_centroids=10)
  >>>
  >>> for x, y in dataset.take(5):
  ...     print(x, y)
  {0: 1.0989, 1: 0.3840, 2: 0.7759, 3: 0.6592} 2
  {0: 1.1496, 1: 1.9014, 2: 1.5393, 3: 0.3210} 0
  {0: 0.7146, 1: -0.2414, 2: 0.8933, 3: 1.6633} 0
  {0: 0.3797, 1: -0.1027, 2: 0.8717, 3: 1.1635} 0
  {0: 0.1295, 1: 0.5953, 2: 0.1774, 3: 0.6673} 1
class_docstr_tok: ["Random","Radial","Basis","Function","generator","with","concept","drift",".","This","class","is","an","extension","from","the","`","RandomRBF","`","generator",".","Concept","drift","can","be","introduced","in","instances","of","this","class",".","The","drift","is","created","by","adding","a","``","speed","''","to","certain","centroids",".","As","the","samples","are","generated","each","of","the","moving","centroids","'","centers","is","changed","by","an","amount","determined","by","its","speed",".","Parameters","--","--","--","--","--","seed_model","Model","'s","random","seed","to","generate","centroids",".","seed_sample","Sample","'s","random","seed",".","n_classes","The","number","of","class","labels","to","generate",".","n_features","The","number","of","numerical","features","to","generate",".","n_centroids","The","number","of","centroids","to","generate",".","change_speed","The","concept","drift","speed",".","n_drift_centroids","The","number","of","centroids","that","will","drift",".","Examples","--","--","--","--",">",">",">","from","river.datasets","import","synth",">",">",">",">",">",">","dataset","=","synth.RandomRBFDrift","(","seed_model=42",",","seed_sample=42",",","...","n_classes=4",",","n_features=4",",","n_centroids=20",",","...","change_speed=0.87",",","n_drift_centroids=10",")",">",">",">",">",">",">","for","x",",","y","in","dataset.take","(","5",")",":","...","print","(","x",",","y",")","{","0",":","1.0989",",","1",":","0.3840",",","2",":","0.7759",",","3",":","0.6592","}","2","{","0",":","1.1496",",","1",":","1.9014",",","2",":","1.5393",",","3",":","0.3210","}","0","{","0",":","0.7146",",","1",":","-0.2414",",","2",":","0.8933",",","3",":","1.6633","}","0","{","0",":","0.3797",",","1",":","-0.1027",",","2",":","0.8717",",","3",":","1.1635","}","0","{","0",":","0.1295",",","1",":","0.5953",",","2",":","0.1774",",","3",":","0.6673","}","1"]
docstr: Generates centroids
  
  The centroids are generated just as it is done in the parent class,
  an extra step is taken to introduce drift, if there is any.
  
  To configure the drift, random offset speeds are chosen for
  `n_drift_centroids` centroids. Finally, the speed is normalized.
docstr_tok: ["Generates","centroids","The","centroids","are","generated","just","as","it","is","done","in","the","parent","class",",","an","extra","step","is","taken","to","introduce","drift",",","if","there","is","any",".","To","configure","the","drift",",","random","offset","speeds","are","chosen","for","`","n_drift_centroids","`","centroids",".","Finally",",","the","speed","is","normalized","."]
code: def _generate_centroids(self):
      """Generates centroids
  
      The centroids are generated just as it is done in the parent class,
      an extra step is taken to introduce drift, if there is any.
  
      To configure the drift, random offset speeds are chosen for
      `n_drift_centroids` centroids. Finally, the speed is normalized.
  
      """
      super()._generate_centroids()
      rng_model = random.Random(self.seed_model)
      self.centroid_speed = []
  
      for i in range(self.n_drift_centroids):
          rand_speed = [0] * self.n_features
          norm_speed = 0.0
  
          for j in range(self.n_features):
              rand_speed[j] = rng_model.random()
              norm_speed += rand_speed[j] * rand_speed[j]
  
          norm_speed = norm_speed**0.5
  
          for j in range(self.n_features):
              rand_speed[j] /= norm_speed
  
          self.centroid_speed.append(rand_speed)
  
file_path: river/river/datasets/synth/random_rbf.py
imports: from __future__ import annotations
  import random
  import warnings
  from river import datasets
label_desc: Use image node_id 3 for calling the RandomRBFDrift obj's underlying member method code with example usage: obj._generate_centroids() without return types