Predict targets for a feature matrix.

        Args:
            X (np.array of float): feature matrix for prediction

        Returns:
            prediction (np.array)
481142
def predict(self, X):
        
        logger.info('predicting ...')
        ps = self.predict_raw(X)

        return sigm(ps[:, 0])
1003463
def _create_labels_for_features(self, X):
        
        if self.labels is None:
            # Use column names if a dataframe
            if is_dataframe(X):
                self.features_ = np.array(X.columns)
            # Otherwise use the column index as the labels
            else:
                _, ncols = X.shape
                self.features_ = np.arange(0, ncols)
        else:
            self.features_ = np.array(self.labels)
1082413
def predict(self,param_dict):
        
        encoder_dict = self._designmatrix_object.encoder
        X, col_names = self._designmatrix_object.run_encoder(param_dict, encoder_dict)
        # compute predictions
        Y_pred = self._compute_prediction(X)
        return Y_pred
96177
def _infer_x_for_line(y):
    
    array_shape = shape(y)

    if len(array_shape) == 0:
        return []
    if len(array_shape) == 1:
        return arange(array_shape[0])
    if len(array_shape) > 1:
        return arange(array_shape[1])
1141369
public Matrix predict(Matrix features) {
        return MLLibUtil.toMatrix(network.output(MLLibUtil.toMatrix(features)));
    }
1129203
@Override
    public int predict(T x) {
        List<Neighbor<T,T>> neighbors = new ArrayList<>();
        nns.range(x, radius, neighbors);
        
        if (neighbors.size() < minPts) {
            return OUTLIER;
        }
        
        int[] label = new int[k + 1];
        for (Neighbor<T,T> neighbor : neighbors) {
            int yi = y[neighbor.index];
            if (yi == OUTLIER) yi = k;
            label[yi]++;
        }
        
        int c = Math.whichMax(label);
        if (c == k) c = OUTLIER;
        return c;
    }
1319065
def set_X(self, X):
        
        assert isinstance(X, np.ndarray)
        state = self.update_model()
        self.update_model(False)
        self.X = ObsAr(X)
        self.update_model(state)
864355
def predict_y(self, xq, sigma=None, k=None, **kwargs):
        
        sigma = sigma or self.sigma
        k = k or self.k
        dists, index = self.dataset.nn_x(xq, k = k)
        w = self._weights(dists, sigma*sigma)
        return np.sum([wi*self.dataset.get_y(idx) for wi, idx in zip(w, index)], axis = 0)
152948
def predict_proba(self, X):
        """"""
        return F.softmax(self.forward(X), dim=1).data.cpu().numpy()
1288928
def predict(self, X):
        
        logprob, responsibilities = self.score_samples(X)
        return responsibilities.argmax(axis=1)
148854
def predict(self, h=5):        
             

        if self.latent_variables.estimated is False:
            raise Exception("No latent variables estimated!")
        else:
            y_holder = self.y.copy() # holds past data and predicted data to create AR matrix
            full_X = self.X.copy()
            full_X = np.append(full_X,np.array([np.append(1.0, y_holder[-self.ar:][::-1])]), axis=0)
            Z = full_X

            for step in range(h):
                a, P = self._forecast_model(self.latent_variables.get_z_values(),Z,step)
                new_value = np.dot(Z[-1,:],a[:,self.y.shape[0]+step])
                y_holder = np.append(y_holder, new_value)
                Z = np.append(Z, np.array([np.append(1.0, y_holder[-self.ar:][::-1])]), axis=0)

            date_index = self.shift_dates(h)

            result = pd.DataFrame(y_holder[-h:])
            result.rename(columns={0:self.y_name}, inplace=True)
            result.index = date_index[-h:]

            return result
552228
def predict_y(self, xq, **kwargs):
        
        _, indexes = self.dataset.nn_x(xq, k = 1)
        return self.dataset.get_y(indexes[0])
426731
def transform(self, X):
        
        if self.mode_ == 'target':
            return np.apply_along_axis(self._target, 1, np.reshape(X, (X.shape[0], X.shape[1] * X.shape[2])))

        if self.mode_ == 'majority':
            return np.apply_along_axis(self._majority, 1, np.reshape(X, (X.shape[0], X.shape[1] * X.shape[2])))

        print('Invalid mode! Set mode to majority or target. Returning input.')
        return X
899839
def predict(self, inputs: np.ndarray) -> np.ndarray:
        """"""
        return self.sess.run(self.out_var, {self.inp_var: inputs})
194842
def predict_withGradients(self, X):
        
        if X.ndim==1: X = X[None,:]
        ps = self.model.param_array.copy()
        means = []
        stds = []
        dmdxs = []
        dsdxs = []
        for s in self.hmc_samples:
            if self.model._fixes_ is None:
                self.model[:] = s
            else:
                self.model[self.model._fixes_] = s
            self.model._trigger_params_changed()
            m, v = self.model.predict(X)
            std = np.sqrt(np.clip(v, 1e-10, np.inf))
            dmdx, dvdx = self.model.predictive_gradients(X)
            dmdx = dmdx[:,:,0]
            dsdx = dvdx / (2*std)
            means.append(m)
            stds.append(std)
            dmdxs.append(dmdx)
            dsdxs.append(dsdx)
        self.model.param_array[:] = ps
        self.model._trigger_params_changed()
        return means, stds, dmdxs, dsdxs
770637
def get_predicted_class(self, x, **kwargs):
    
    return tf.argmax(self.get_logits(x, **kwargs), axis=1)
776741
def predict(self,Xstar):
        
        KV = self._update_cache()
        self.covar.setXstar(Xstar)
        Kstar = self.covar.Kcross()
        Ystar = SP.dot(Kstar,KV['alpha'])
        return Ystar