class_docstr: Gaussian random projector.
  
  This transformer reduces the dimensionality of inputs through Gaussian random projection.
  
  The components of the random projections matrix are drawn from `N(0, 1 / n_components)`.
  
  Parameters
  ----------
  n_components
      Number of components to project the data onto.
  seed
      Random seed for reproducibility.
  
  Examples
  --------
  
  >>> from river import datasets
  >>> from river import evaluate
  >>> from river import linear_model
  >>> from river import metrics
  >>> from river import preprocessing
  
  >>> dataset = datasets.TrumpApproval()
  >>> model = preprocessing.GaussianRandomProjector(
  ...     n_components=3,
  ...     seed=42
  ... )
  
  >>> for x, y in dataset:
  ...     x = model.transform_one(x)
  ...     print(x)
  ...     break
  {0: -61289.371..., 1: 141312.510..., 2: 279165.993...}
  
  >>> model = (
  ...     preprocessing.GaussianRandomProjector(
  ...         n_components=5,
  ...         seed=42
  ...     ) |
  ...     preprocessing.StandardScaler() |
  ...     linear_model.LinearRegression()
  ... )
  >>> evaluate.progressive_val_score(dataset, model, metrics.MAE())
  MAE: 0.933...
  
  References
  ----------
  [^1]: [Gaussian random projection](https://www.wikiwand.com/en/Gaussian_random_projection#Gaussian_random_projection)
  [^2]: [scikit-learn random projections module](https://scikit-learn.org/stable/modules/random_projection.html)
class_docstr_tok: ["Gaussian","random","projector",".","This","transformer","reduces","the","dimensionality","of","inputs","through","Gaussian","random","projection",".","The","components","of","the","random","projections","matrix","are","drawn","from","`","N","(","0",",","1","\/","n_components",")","`",".","Parameters","--","--","--","--","--","n_components","Number","of","components","to","project","the","data","onto",".","seed","Random","seed","for","reproducibility",".","Examples","--","--","--","--",">",">",">","from","river","import","datasets",">",">",">","from","river","import","evaluate",">",">",">","from","river","import","linear_model",">",">",">","from","river","import","metrics",">",">",">","from","river","import","preprocessing",">",">",">","dataset","=","datasets.TrumpApproval","(",")",">",">",">","model","=","preprocessing.GaussianRandomProjector","(","...","n_components=3",",","...","seed=42","...",")",">",">",">","for","x",",","y","in","dataset",":","...","x","=","model.transform_one","(","x",")","...","print","(","x",")","...","break","{","0",":","-61289.371","...",",","1",":","141312.510","...",",","2",":","279165.993","...","}",">",">",">","model","=","(","...","preprocessing.GaussianRandomProjector","(","...","n_components=5",",","...","seed=42","...",")","|","...","preprocessing.StandardScaler","(",")","|","...","linear_model.LinearRegression","(",")","...",")",">",">",">","evaluate.progressive_val_score","(","dataset",",","model",",","metrics.MAE","(",")",")","MAE",":","0.933","...","References","--","--","--","--","--","[","^1","]",":","[","Gaussian","random","projection","]","(","https",":","\/\/www.wikiwand.com\/en\/Gaussian_random_projection","#","Gaussian_random_projection",")","[","^2","]",":","[","scikit-learn","random","projections","module","]","(","https",":","\/\/scikit-learn.org\/stable\/modules\/random_projection.html",")"]
code: def transform_one(self, x):
      return {
          i: sum(self._projection_matrix[(i, j)] * x[j] for j in x)
          for i in range(self.n_components)
      }
  
file_path: river/river/preprocessing/random_projection.py
imports: from __future__ import annotations
  import collections
  import random
  from river import base
label_desc: Use image node_id 3 for calling the GaussianRandomProjector obj's underlying member method code with example usage: obj.transform_one(x) and returns: unknown