docs: @Override
      public void trainOnInstanceImpl(Instance inst) {
          this.epochs++;
          double[] Pr = new double[inst.numClasses()];
          double maxWeight = 0.0;
          double weakestExpertWeight = 1.0;
          int weakestExpertIndex = -1;
          // Loop over experts
          for (int i = 0; i < this.experts.size(); i++) {
              double[] pr = this.experts.get(i).getVotesForInstance(inst);
              int yHat = Utils.maxIndex(pr);
              if ((yHat != (int) inst.classValue())
                      && this.epochs % this.periodOption.getValue() == 0) {
                  this.weights.set(i,
                          this.weights.get(i) * this.betaOption.getValue());
              }
              Pr[yHat] += this.weights.get(i);
              maxWeight = Math.max(maxWeight, this.weights.get(i));
              if (this.weights.get(i) < weakestExpertWeight) {
                  weakestExpertIndex = i;
                  weakestExpertWeight = weights.get(i);
              }
          }
          int yHat = Utils.maxIndex(Pr);
          if (this.epochs % this.periodOption.getValue() == 0) {
              scaleWeights(maxWeight);
              removeExperts();
              if (yHat != (int) inst.classValue()) {
                  if (experts.size() == this.maxExpertsOption.getValue()) {
                      removeWeakestExpert(weakestExpertIndex);
                  }
                  Classifier classifier = ((Classifier) getPreparedClassOption(this.baseLearnerOption)).copy();
                  classifier.resetLearning();
                  this.experts.add(classifier);
                  this.weights.add(1.0);
              }
          }
          // train experts
          for (Classifier expert : this.experts) {
              expert.trainOnInstance(inst);
          }
      }