class_docstr: This ensemble will learn an optimal weight vector via Stochastic Gradient Descent on the validation dataset and the respective mixer predictions.
  
  Starting weights for the vector are uniformly set.
  
  Note this mixer is still in experimental phase. Some features in the roadmap are:
    - support for handling faulty mixers
    - support for custom initial vector weights
    - early stopping
    - arbitrarily complex secondary model
class_docstr_tok: ["This","ensemble","will","learn","an","optimal","weight","vector","via","Stochastic","Gradient","Descent","on","the","validation","dataset","and","the","respective","mixer","predictions",".","Starting","weights","for","the","vector","are","uniformly","set",".","Note","this","mixer","is","still","in","experimental","phase",".","Some","features","in","the","roadmap","are",":","-","support","for","handling","faulty","mixers","-","support","for","custom","initial","vector","weights","-","early","stopping","-","arbitrarily","complex","secondary","model"]
code: def __call__(
      self, ds: EncodedDs, args: PredictionArguments
  ) -> pd.DataFrame:
      assert self.prepared
      mixer_weights = (
          torch.tensor(args.mixer_weights)
          if args.mixer_weights
          else self.mixer_weights
      )
      output = pd.DataFrame()
      predictions = (
          torch.tensor(self.predict(ds, args))
          .squeeze()
          .reshape(-1, len(self.mixers))
      )
      predictions = (predictions * mixer_weights).sum(axis=1)
      output["prediction"] = predictions.detach().numpy().tolist()
      return output
  
file_path: lightwood/lightwood/ensemble/stacked_ensemble.py
imports: from typing import List, Optional
  import numpy
  import pandas
  import torch
  from torch import nn
  from torch.optim import SGD
  from lightwood.mixer.base import BaseMixer
  from lightwood.ensemble.mean_ensemble import MeanEnsemble
  from lightwood.api.types import PredictionArguments
  from lightwood.data.encoded_ds import EncodedDs
  from lightwood.helpers.log import log
label_desc: Use image node_id 3 for calling the StackedEnsemble obj's underlying member method code with example usage: obj.__call__(ds, args) and returns: output