RotationForest.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:RotationForest 作者: borjaayerdi 项目源码 文件源码
def predict(self, X):
        """
        Predict values using the model

        Parameters
        ----------
        X : {array-like, sparse matrix} of shape [n_samples, n_features]

        Returns
        -------
        C : numpy array of shape [n_samples, n_outputs]
            Predicted values.
        """
        dim = len(self._classifiers)
        ensemble_output = np.zeros((len(X),dim))

        # Z-score
        X = (X-self._med)/(self._std+self._noise)

        for i in range(0,dim):
            xrot_z = X.dot(self._inforotar[i])
            ensemble_output[:,i] = self._classifiers[i].predict(xrot_z)

        y_pred = mode(ensemble_output, axis=1)[0]

        return y_pred
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号