class_docstr: This encoder produces an encoded representation for timestamps.
  
  The approach consists on decomposing the timestamp objects into its constituent units (e.g. month, year, etc), and describing each of those with a single value that represents the magnitude in a sensible cycle length.
class_docstr_tok: ["This","encoder","produces","an","encoded","representation","for","timestamps",".","The","approach","consists","on","decomposing","the","timestamp","objects","into","its","constituent","units","(","e.g",".","month",",","year",",","etc",")",",","and","describing","each","of","those","with","a","single","value","that","represents","the","magnitude","in","a","sensible","cycle","length","."]
code: def __init__(self, is_target: bool = False):
      super().__init__(is_target)
      self.constant_keys = [
          "year",
          "month",
          "day",
          "hour",
          "minute",
          "second",
      ]
      self.constant_vals = torch.Tensor(
          [3000.0, 12.0, 31.0, 24.0, 60.0, 60.0]
      )  # cycle length
      self.constant_map = {
          k: v.item()
          for k, v in zip(self.constant_keys, self.constant_vals)
      }
  
      self.output_size = len(self.constant_keys)
      self.empty_vector = np.zeros((self.output_size,))
  
      self.max_vals = torch.Tensor(
          [pd.Timestamp.max.year - 1, 12, 31, 23, 59, 59]
      )
      self.min_vals = torch.Tensor(
          [pd.Timestamp.min.year + 1, 1, 1, 0, 0, 0]
      )
  
file_path: lightwood/lightwood/encoder/datetime/datetime.py
imports: from typing import Union
  import torch
  import numpy
  import pandas
  from lightwood.encoder.base import BaseEncoder
  from lightwood.helpers.log import log
label_desc: Use image node_id 1 to create a new DatetimeEncoder object from inherited base classes: BaseEncoder with example: obj = DatetimeEncoder(is_target)