class_docstr: Binarizes the data to 0 or 1 according to a threshold.
  
  Parameters
  ----------
  threshold
      Values above this are replaced by 1 and the others by 0.
  dtype
      The desired data type to apply.
  
  Examples
  --------
  
  >>> import river
  >>> import numpy as np
  
  >>> rng = np.random.RandomState(42)
  >>> X = [{'x1': v, 'x2': int(v)} for v in rng.uniform(low=-4, high=4, size=6)]
  
  >>> binarizer = river.preprocessing.Binarizer()
  >>> for x in X:
  ...     binarizer.learn_one(x)
  ...     print(binarizer.transform_one(x))
  {'x1': False, 'x2': False}
  {'x1': True, 'x2': True}
  {'x1': True, 'x2': True}
  {'x1': True, 'x2': False}
  {'x1': False, 'x2': False}
  {'x1': False, 'x2': False}
class_docstr_tok: ["Binarizes","the","data","to","0","or","1","according","to","a","threshold",".","Parameters","--","--","--","--","--","threshold","Values","above","this","are","replaced","by","1","and","the","others","by","0.","dtype","The","desired","data","type","to","apply",".","Examples","--","--","--","--",">",">",">","import","river",">",">",">","import","numpy","as","np",">",">",">","rng","=","np.random.RandomState","(","42",")",">",">",">","X","=","[","{","'x1","'",":","v",",","'x2","'",":","int","(","v",")","}","for","v","in","rng.uniform","(","low=-4",",","high=4",",","size=6",")","]",">",">",">","binarizer","=","river.preprocessing.Binarizer","(",")",">",">",">","for","x","in","X",":","...","binarizer.learn_one","(","x",")","...","print","(","binarizer.transform_one","(","x",")",")","{","'x1","'",":","False",",","'x2","'",":","False","}","{","'x1","'",":","True",",","'x2","'",":","True","}","{","'x1","'",":","True",",","'x2","'",":","True","}","{","'x1","'",":","True",",","'x2","'",":","False","}","{","'x1","'",":","False",",","'x2","'",":","False","}","{","'x1","'",":","False",",","'x2","'",":","False","}"]
code: def __init__(self, threshold=0.0, dtype=bool):
      self.threshold = threshold
      self.dtype = dtype
  
imports: from __future__ import annotations
  import collections
  import functools
  import itertools
  import numbers
  import numpy
  import pandas
  from river import base, stats, utils
label_desc: Use image node_id 1 to create a new Binarizer object from inherited base classes: base with example: obj = Binarizer(threshold, dtype)