predict on Xstar
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
1146930
def predict(self, testing_features):
        """"""
        # print("best_inds:",self._best_inds)
        # print("best estimator size:",self._best_estimator.coef_.shape)
        if self.clean:
            testing_features = self.impute_data(testing_features)

        if self._best_inds:
            X_transform = self.transform(testing_features)
            try:
                return self._best_estimator.predict(self.transform(testing_features))
            except ValueError as detail:
                # pdb.set_trace()
                print('shape of X:',testing_features.shape)
                print('shape of X_transform:',X_transform.transpose().shape)
                print('best inds:',self.stacks_2_eqns(self._best_inds))
                print('valid locs:',self.valid_loc(self._best_inds))
                raise ValueError(detail)
        else:
            return self._best_estimator.predict(testing_features)
1130269
def predict(self, X, raw_score=False, num_iteration=None,
                pred_leaf=False, pred_contrib=False, **kwargs):
        """"""
        result = self.predict_proba(X, raw_score, num_iteration,
                                    pred_leaf, pred_contrib, **kwargs)
        if raw_score or pred_leaf or pred_contrib:
            return result
        else:
            class_index = np.argmax(result, axis=1)
            return self._le.inverse_transform(class_index)
384844
def fit(self, X):
        
        self.centers_, self.labels_, self.sse_arr_, self.n_iter_ = \
              _kmeans(X, self.n_clusters, self.max_iter, self.n_trials, self.tol)
1050734
def predict(self, X):
        
        X_ = self._check_array(X)
        return exp(dot(X_, self._coef))
128305
def predict(self, X):
        
        check_is_fitted(self, 'estimators_')

        X = check_array(X, dtype=DTYPE, order="C")
        score = self._decision_function(X)
        if score.shape[1] == 1:
            score = score.ravel()

        return score
402390
def predict(self, x):
        
        if isinstance(x, RDD):
            return x.map(lambda v: self.predict(v))

        x = _convert_to_vector(x)
        margin = self.weights.dot(x) + self.intercept
        if self._threshold is None:
            return margin
        else:
            return 1 if margin > self._threshold else 0
1191386
def predict(self, parameters, viterbi):
        
        x_dot_parameters = np.einsum('ijk,kl->ijl', self.x, parameters)

        if not viterbi:
            alpha = forward_predict(self._lattice, x_dot_parameters,
                                    self.state_machine.n_states)
        else:
            alpha = forward_max_predict(self._lattice, x_dot_parameters,
                                        self.state_machine.n_states)

        I, J, _ = self.x.shape

        class_Z = {}
        Z = -np.inf

        for state, predicted_class in self.states_to_classes.items():
            weight = alpha[I - 1, J - 1, state]
            class_Z[self.states_to_classes[state]] = weight
            Z = np.logaddexp(Z, weight)

        return {label: np.exp(class_z - Z) for label, class_z in class_Z.items()}
325327
function guessEra(jdn, JD_AM = JD_EPOCH_OFFSET_AMETE_MIHRET, JD_AA = JD_EPOCH_OFFSET_AMETE_ALEM) {
  return (jdn >= (JD_AM + 365)) ? JD_AM : JD_AA;
}
916507
def predict(self, x):
        
        y = np.dot(self.w, x)
        return y
406967
def predict(self, h=5):      
             

        if self.latent_variables.estimated is False:
            raise Exception("No latent variables estimated!")
        else:
            # Retrieve data, dates and (transformed) latent variables        
            date_index = self.shift_dates(h)
            forecasted_values = np.ones(h)*self.states[-1]
            t_params = self.transform_z()

            if self.model_name2 == 'Skewt':
                forecasted_values = forecasted_values + ((t_params[-3] - (1.0/t_params[-3]))*t_params[-2]*gas.SkewtScore.tv_variate_exp(t_params[-1]))

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

            return result
495748
def predict(self, dataframe):
        """"""
        if self.mean > 0.5:
            return numpy.ones(dataframe.shape[0])
        else:
            return numpy.zeros(dataframe.shape[0])
1002774
def predict(self, X, y):
        
        y_pred = self.model.predict_on_batch(X)

        # reduce dimension.
        y_true = np.argmax(y, -1)
        y_pred = np.argmax(y_pred, -1)

        lens = self.get_length(y_true)

        y_true = self.convert_idx_to_name(y_true, lens)
        y_pred = self.convert_idx_to_name(y_pred, lens)

        return y_true, y_pred
1319506
def predict_maxprob(self, x, **kwargs):
        
        return self.base_estimator_.predict(x.values, **kwargs)
505166
def predict(self, X_test, y=None):
        
        if not hasattr(self, 'geom_'):
            raise RuntimeError('the .fit() function must be called before the .predict() function')
        if self.geom_.X is None:
            raise NotImplementedError('method only implemented when X passed as data')
        # Complete the adjacency matrix
        adjacency_kwds = self.geom_.adjacency_kwds
        if self.geom_.adjacency_method == 'cyflann':
            if 'cyflann_kwds' in adjacency_kwds.keys():
                cyflann_kwds = adjacency_kwds['cyflann_kwds']
            else:
                cyflann_kwds = {}
        total_adjacency_matrix = complete_adjacency_matrix(self.geom_.adjacency_matrix,
                                                           self.geom_.X,
                                                           X_test,adjacency_kwds)
        # Compute the affinity matrix, check method and kwds
        if self.geom_.affinity_kwds is not None:
            affinity_kwds = self.geom_.affinity_kwds
        else:
            affinity_kwds = {}
        if self.geom_.affinity_method is not None:
            affinity_method = self.geom_.affinity_method
        else:
            affinity_method = 'auto'
        total_affinity_matrix = compute_affinity_matrix(total_adjacency_matrix, affinity_method,
                                                       **affinity_kwds)
        # Compute the affinity matrix, check method and kwds
        if self.geom_.laplacian_kwds is not None:
            laplacian_kwds = self.geom_.laplacian_kwds
        else:
            laplacian_kwds = {}
        if self.geom_.laplacian_method is not None:
            laplacian_method = self.geom_.laplacian_method
        else:
            self.laplacian_method = 'auto'
        total_laplacian_matrix = compute_laplacian_matrix(total_affinity_matrix, laplacian_method,
                                                       **laplacian_kwds)
        # Take the columns of Laplacian and existing embedding and pass to Nystrom Extension
        (n_sample_train) = self.geom_.adjacency_matrix.shape[0]
        total_laplacian_matrix = total_laplacian_matrix.tocsr()
        C = total_laplacian_matrix[:, :n_sample_train]
        # warnings.warn(str(C.shape))
        eigenvalues, eigenvectors = nystrom_extension(C, self.eigenvectors_, self.eigenvalues_)
        # If diffusion maps compute diffusion time etc
        if self.diffusion_maps:
            embedding = compute_diffusion_maps(laplacian_method, eigenvectors, eigenvalues, self.diffusion_time)
        else:
            embedding = eigenvectors
        (n_sample_test) = X_test.shape[0]
        embedding_test=embedding[-n_sample_test:, :]
        return embedding_test, embedding
591861
def _predict_in_session(self, sess, other_var, X_feat, X_seq, variable="y_pred"):
        
        # other_var["tf_X_seq"]: X_seq, tf_y: y,
        feed_dict = {other_var["tf_X_feat"]: X_feat,
                     other_var["tf_X_seq"]: X_seq}

        y_pred = sess.run(other_var[variable], feed_dict=feed_dict)
        return y_pred
30264
def score(self, X, y):
        """"""

        from sklearn.metrics import accuracy_score
        return accuracy_score(y, self.predict(X))