def transform(self, X):
        """Performs predictions blending using the trained weights.

        Args:
            X (array-like): Predictions of different models.
        Returns: dict with blended predictions (key is 'y_pred').
        """
        assert np.shape(X)[0] == len(self._weights), (
            'BlendingOptimizer: Number of models to blend its predictions and weights does not match: '
            'n_models={}, weights_len={}'.format(np.shape(X)[0], len(self._weights)))
        blended_predictions = np.average(np.power(X, self._power),
                                         weights=self._weights,
                                         axis=0) ** (1.0 / self._power)

        return {'y_pred': blended_predictions}