class_docstr: The numeric encoder takes numbers (float or integer) and converts it into tensors of the form:
  ``[0 if the number is none, otherwise 1, 1 if the number is positive, otherwise 0, natural_log(abs(number)), number/absolute_mean]``
  
  This representation is: ``[1 if the number is positive, otherwise 0, natural_log(abs(number)), number/absolute_mean]]`` if encoding target values, since target values can't be none.
  
  The ``absolute_mean`` is computed in the ``prepare`` method and is just the mean of the absolute values of all numbers feed to prepare (which are not none)
  
  ``none`` stands for any number that is an actual python ``None`` value or any sort of non-numeric value (a string, nan, inf)
class_docstr_tok: ["The","numeric","encoder","takes","numbers","(","float","or","integer",")","and","converts","it","into","tensors","of","the","form",":","``","[","0","if","the","number","is","none",",","otherwise","1",",","1","if","the","number","is","positive",",","otherwise","0",",","natural_log","(","abs","(","number",")",")",",","number\/absolute_mean","]","``","This","representation","is",":","``","[","1","if","the","number","is","positive",",","otherwise","0",",","natural_log","(","abs","(","number",")",")",",","number\/absolute_mean","]","]","``","if","encoding","target","values",",","since","target","values","ca","n't","be","none",".","The","``","absolute_mean","``","is","computed","in","the","``","prepare","``","method","and","is","just","the","mean","of","the","absolute","values","of","all","numbers","feed","to","prepare","(","which","are","not","none",")","``","none","``","stands","for","any","number","that","is","an","actual","python","``","None","``","value","or","any","sort","of","non-numeric","value","(","a","string",",","nan",",","inf",")"]
docstr: "NumericalEncoder" uses a rule-based form to prepare results on training (priming) data. The averages etc. are taken from this distribution.
  
  :param priming_data: an iterable data structure containing numbers numbers which will be used to compute the values used for normalizing the encoded representations
docstr_tok: ["``","NumericalEncoder","''","uses","a","rule-based","form","to","prepare","results","on","training","(","priming",")","data",".","The","averages","etc",".","are","taken","from","this","distribution",".",":","param","priming_data",":","an","iterable","data","structure","containing","numbers","numbers","which","will","be","used","to","compute","the","values","used","for","normalizing","the","encoded","representations"]
code: def prepare(self, priming_data: pd.Series):
      """
      "NumericalEncoder" uses a rule-based form to prepare results on training (priming) data. The averages etc. are taken from this distribution.
  
      :param priming_data: an iterable data structure containing numbers numbers which will be used to compute the values used for normalizing the encoded representations
      """  # noqa
      if self.is_prepared:
          raise Exception(
              'You can only call "prepare" once for a given encoder.'
          )
  
      self._abs_mean = priming_data.abs().mean()
      self.is_prepared = True
  
file_path: lightwood/lightwood/encoder/numeric/numeric.py
imports: import math
  from typing import Union
  import torch
  import numpy
  import pandas
  from type_infer.dtype import dtype
  from lightwood.encoder.base import BaseEncoder
  from lightwood.helpers.general import is_none
label_desc: Use image node_id 2 for calling the NumericEncoder obj's underlying member method code with example usage: obj.prepare(priming_data) without return types