def _ml_train_iterative(self, database_matrix, params=[],
                            sliding_window=168, k=1):
        """
            Training method used by Fred 09 paper.
        """

        # Number of dimension/lags/order
        p = database_matrix.shape[1] - 1

        # Amount of training/testing procedures
        number_iterations = database_matrix.shape[0] + p - k - sliding_window + 1
        print("Number of iterations: ", number_iterations)

        # Training set size
        tr_size = sliding_window - p - 1

        # Sum -z_i value to every input pattern, Z = r_t-(p-1)-k
        z = database_matrix[0:-k, 1].reshape(-1, 1) * np.ones((1, p))
        database_matrix[k:, 1:] = z - database_matrix[k:, 1:]

        pr_target = []
        ex_target = []
        for i in range(number_iterations):
            # Train with sliding window training dataset
            self._ml_train(database_matrix[k+i:k+i+tr_size-1, :], params)

            # Predicted target with training_data - z_i ( r_t+1  )
            pr_t = self._ml_predict(horizon=1)

            # Sum z_i value to get r'_t+1 = r_t+1 + z_i
            pr_t = pr_t[0][0] + z[i, 0]
            pr_target.append(pr_t)

            # Expected target
            ex_target.append(database_matrix[k+i+tr_size, 0])

        pr_result = Error(expected=ex_target, predicted=pr_target)

        return pr_result
dataset/ETHPy150Open acba/elm/elm/mltools.py/MLTools._ml_train_iterative/swapped operands of `-`