class_docstr: Rescale and quantize the target variable.
  
  Requires
    past_target and future_target fields.
  
  The mean absolute value of the past_target is used to rescale past_target
  and future_target. Then the bin_edges are used to quantize the rescaled
  target.
  
  The calculated scale is included as a new field "scale"
class_docstr_tok: ["Rescale","and","quantize","the","target","variable",".","Requires","past_target","and","future_target","fields",".","The","mean","absolute","value","of","the","past_target","is","used","to","rescale","past_target","and","future_target",".","Then","the","bin_edges","are","used","to","quantize","the","rescaled","target",".","The","calculated","scale","is","included","as","a","new","field","``","scale","''"]
code: def __init__(
      self,
      bin_edges: List[float],
      past_target: str,
      future_target: str,
      scale: str = "scale",
  ):
      self.bin_edges = np.array(bin_edges)
      self.future_target = future_target
      self.past_target = past_target
      self.scale = scale
  
imports: import logging
  from functools import partial
  from typing import List, Optional
  import mxnet
  import numpy
  from gluonts import transform
  from gluonts.core.component import validated
  from gluonts.dataset.common import DataEntry, Dataset
  from gluonts.dataset.field_names import FieldName
  from gluonts.dataset.loader import DataLoader, TrainDataLoader, ValidationDataLoader
  from gluonts.model.predictor import Predictor
  from gluonts.mx.batchify import batchify
  from gluonts.mx.model.estimator import GluonEstimator
  from gluonts.mx.model.predictor import RepresentableBlockPredictor
  from gluonts.mx.trainer import Trainer
  from gluonts.mx.util import copy_parameters, get_hybrid_forward_input_names
  from gluonts.time_feature import get_seasonality, time_features_from_frequency_str
  from gluonts.transform import AddAgeFeature, AddObservedValuesIndicator, AddTimeFeatures, AsNumpyArray, Chain, ExpectedNumInstanceSampler, InstanceSampler, InstanceSplitter, SelectFields, SetFieldIfNotPresent, SimpleTransformation, TestSplitSampler, ValidationSplitSampler, VstackFeatures
  from ._network import WaveNet, WaveNetSampler, WaveNetTraining
label_desc: Use image node_id 1 to create a new QuantizeScaled object from inherited base classes: SimpleTransformation with example: obj = QuantizeScaled(bin_edges, past_target, future_target, scale)