class_docstr: Adds an 'age' feature to the data_entry.
  
  The age feature starts with a small value at the start of the time series
  and grows over time.
  
  If `is_train=True` the age feature has the same length as the `target`
  field.
  If `is_train=False` the age feature has length len(target) + pred_length
  
  Parameters
  ----------
  target_field
      Field with target values (array) of time series
  output_field
      Field name to use for the output.
  pred_length
      Prediction length
  log_scale
      If set to true the age feature grows logarithmically otherwise linearly
      over time.
class_docstr_tok: ["Adds","an","'age","'","feature","to","the","data_entry",".","The","age","feature","starts","with","a","small","value","at","the","start","of","the","time","series","and","grows","over","time",".","If","`","is_train=True","`","the","age","feature","has","the","same","length","as","the","`","target","`","field",".","If","`","is_train=False","`","the","age","feature","has","length","len","(","target",")","+","pred_length","Parameters","--","--","--","--","--","target_field","Field","with","target","values","(","array",")","of","time","series","output_field","Field","name","to","use","for","the","output",".","pred_length","Prediction","length","log_scale","If","set","to","true","the","age","feature","grows","logarithmically","otherwise","linearly","over","time","."]
code: def map_transform(self, data: DataEntry, is_train: bool) -> DataEntry:
      length = target_transformation_length(
          data[self.target_field], self.pred_length, is_train=is_train
      )
  
      if self.log_scale:
          age = np.log10(2.0 + np.arange(length, dtype=self.dtype))
      else:
          age = np.arange(length, dtype=self.dtype)
  
      data[self.feature_name] = age.reshape((1, length))
  
      return data
  
imports: from typing import List, Optional, Union, Type
  import numpy
  import pandas
  from gluonts.core.component import validated
  from gluonts.dataset.common import DataEntry
  from gluonts.dataset.field_names import FieldName
  from gluonts.time_feature import TimeFeature
  from ._base import MapTransformation, SimpleTransformation
label_desc: Use image node_id 2 for calling the AddAgeFeature obj's underlying member method code with example usage: obj.map_transform(data, is_train) and returns: data