The following three functions are used for the prediction
769552
protected double[] firstHitNB(Instance inst) {
		int countFired = 0;
		boolean fired = false;
		double[] votes = new double[this.numClass];
		for (int j = 0; j < this.ruleSet.size(); j++) {
			if (this.ruleSet.get(j).ruleEvaluate(inst) == true) {
				countFired = countFired + 1;
				if (this.ruleSet.get(j).obserClassDistrib.sumOfValues() >= this.nbThresholdOption.getValue()) {
					votes = NaiveBayes.doNaiveBayesPredictionLog(inst, this.ruleSet.get(j).obserClassDistrib, this.ruleSet.get(j).observers, this.ruleSet.get(j).observersGauss);
		    	    votes = exponential(votes);
		    	    votes = normalize(votes);
		    	    } else {
		    	    	for (int z = 0; z < this.numClass; z++) {
		    	    		votes[z] = this.ruleSet.get(j).obserClassDistrib.getValue(z) 
		    	    				/ this.ruleSet.get(j).obserClassDistrib.sumOfValues();
		    	    		}
		    	    	}
				break;
				}
			}
		if (countFired > 0) {
			fired = true;
			} else {
				fired = false;
				}
		if (fired == false) {
			if (super.getWeightSeen() >= this.nbThresholdOption.getValue()) {
				votes = NaiveBayes.doNaiveBayesPredictionLog(inst, this.observedClassDistribution, this.attributeObservers, this.attributeObserversGauss);
				votes = exponential(votes);
				votes = normalize(votes);
				} else {
					votes = super.oberversDistribProb(inst, this.observedClassDistribution);
					}
			}
		return votes;
		}
670785
def _build_predict(self, Xnew, full_cov=False):
        
        num_inducing = len(self.feature)
        err = self.Y - self.mean_function(self.X)
        Kuf = features.Kuf(self.feature, self.kern, self.X)
        Kuu = features.Kuu(self.feature, self.kern, jitter=settings.numerics.jitter_level)
        Kus = features.Kuf(self.feature, self.kern, Xnew)
        sigma = tf.sqrt(self.likelihood.variance)
        L = tf.cholesky(Kuu)
        A = tf.matrix_triangular_solve(L, Kuf, lower=True) / sigma
        B = tf.matmul(A, A, transpose_b=True) + tf.eye(num_inducing, dtype=settings.float_type)
        LB = tf.cholesky(B)
        Aerr = tf.matmul(A, err)
        c = tf.matrix_triangular_solve(LB, Aerr, lower=True) / sigma
        tmp1 = tf.matrix_triangular_solve(L, Kus, lower=True)
        tmp2 = tf.matrix_triangular_solve(LB, tmp1, lower=True)
        mean = tf.matmul(tmp2, c, transpose_a=True)
        if full_cov:
            var = self.kern.K(Xnew) + tf.matmul(tmp2, tmp2, transpose_a=True) \
                  - tf.matmul(tmp1, tmp1, transpose_a=True)
            var = tf.tile(var[None, ...], [self.num_latent, 1, 1])  # P x N x N
        else:
            var = self.kern.Kdiag(Xnew) + tf.reduce_sum(tf.square(tmp2), 0) \
                  - tf.reduce_sum(tf.square(tmp1), 0)
            var = tf.tile(var[:, None], [1, self.num_latent])
        return mean + self.mean_function(Xnew), var
494632
function predict(face) {
      return getNet().computeFaceDescriptorAsync(face)
        .then(inputDescriptor =>
          getDescriptorsByClass().map(ds => ({
            className: ds.className,
            distance: computeMeanDistance(ds.faceDescriptors, inputDescriptor)
          }))
        )
    }
1171054
private Metric predictAnomalies() {
        Metric predictions = new Metric(getResultScopeName(), getResultMetricName());
        Map<Long, Double> predictionDatapoints = new HashMap<>();

        double[][] noiseMatrix = rpca.getE().getData();
        double[] noiseVector = matrixToVector(noiseMatrix);

        for (int i = 0; i < noiseVector.length; i++) {
            Long timestamp = timestamps[i];
            double noiseValue = noiseVector[i];
            double anomalyScore = calculateAnomalyScore(noiseValue);
            predictionDatapoints.put(timestamp, anomalyScore);
        }

        predictions.setDatapoints(predictionDatapoints);
        return predictions;
    }
475319
def initial_guesses(self):
        
        return np.array([param.value for param in self.model.params])
576540
def predict(self, Xnew=None, filteronly=False, include_likelihood=True, balance=None, **kw):
        
        
        if balance is None:
            p_balance = self.balance
        else:
            p_balance = balance
            
        # Run the Kalman filter to get the state
        (m, V) = self._raw_predict(Xnew,filteronly=filteronly, p_balance=p_balance)

        # Add the noise variance to the state variance
        if include_likelihood:
            V += float(self.likelihood.variance)

        # Lower and upper bounds
        #lower = m - 2*np.sqrt(V)
        #upper = m + 2*np.sqrt(V)

        # Return mean and variance
        return m, V
652401
def predictions(self):
        
        preds = javabridge.get_collection_wrapper(
            javabridge.call(self.jobject, "predictions", "()Ljava/util/ArrayList;"))
        if self.discard_predictions:
            result = None
        else:
            result = []
            for pred in preds:
                if is_instance_of(pred, "weka.classifiers.evaluation.NominalPrediction"):
                    result.append(NominalPrediction(pred))
                elif is_instance_of(pred, "weka.classifiers.evaluation.NumericPrediction"):
                    result.append(NumericPrediction(pred))
                else:
                    result.append(Prediction(pred))
        return result
28777
def predict(self, X):
        

        if X.ndim==1: X = X[None,:]
        ps = self.model.param_array.copy()
        means = []
        stds = []
        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)
            means.append(m)
            stds.append(np.sqrt(np.clip(v, 1e-10, np.inf)))
        self.model.param_array[:] = ps
        self.model._trigger_params_changed()
        return means, stds
1080397
function correctionFactor() {
    var args = Array.prototype.slice.call(arguments);
    return args.reduce(function (prev, next) {
      var mp = multiplier(prev),
        mn = multiplier(next);
      return mp > mn ? mp : mn;
    }, -Infinity);
  }
985450
@Override
    public int predict(double[] x, double[] posteriori) {
        Arrays.fill(posteriori, 0.0);

        for (int i = 0; i < trees.length; i++) {
            posteriori[trees[i].predict(x)] += alpha[i];
        }

        double sum = Math.sum(posteriori);
        for (int i = 0; i < k; i++) {
            posteriori[i] /= sum;
        }

        return Math.whichMax(posteriori);
    }
1144248
def predict(self):
        
        RV = np.zeros((self.N,self.P))
        for term_i in range(self.n_terms):
            RV+=np.dot(self.Fstar()[term_i],np.dot(self.B()[term_i],self.Astar()[term_i]))
        return RV
443307
def _build_predict(self, Xnew, full_cov=False):
        
        mu, var = conditional(Xnew, self.X, self.kern, self.V,
                              full_cov=full_cov,
                              q_sqrt=None, white=True)
        return mu + self.mean_function(Xnew), var
481142
def predict(self, X):
        
        logger.info('predicting ...')
        ps = self.predict_raw(X)

        return sigm(ps[:, 0])
586554
def _xval_choose_funcs(self, fit_spectra, reject_outliers, fit_lb, fit_ub,
                           fitters=[ana.fit_gaussian,ana.fit_two_gaussian],
                           funcs = [ut.gaussian, ut.two_gaussian]):
        

        set1 = fit_spectra[::2]
        set2 = fit_spectra[1::2]

        errs = []
        signal_select = [] 
        # We can loop over functions and try each one out, checking the
        # error in each:
        for fitter in fitters:
            models = []
            signals = []
            for this_set in [set1, set2]:
                choose_transients, model, signal, params, this_idx =\
                    self._fit_helper(this_set, reject_outliers,
                                    fit_lb, fit_ub, fitter)
                models.append(np.nanmean(model[choose_transients], 0))
                signals.append(np.nanmean(signal[choose_transients], 0))

                signal_select.append(signal[choose_transients])
                
            #Cross-validate!
            errs.append(np.mean([ut.rmse(models[0], signals[1]),
                                 ut.rmse(models[1], signals[0])]))
        # We really only need to look at the first two:
        signal_err = ut.rmse(np.nanmean(signal_select[0], 0),
                             np.nanmean(signal_select[1], 0))
        # Based on the errors, choose a function. Also report errors:
        return (fitters[np.argmin(errs)], funcs[np.argmin(errs)], np.min(errs),
                signal_err)
707982
def F_t(X, Y, S, M_E, E, m0, rho):
    '''  '''
    r = X.shape[1]
    out1 = (((np.dot(np.dot(X, S), Y.T) - M_E) * E)**2).sum() / 2
    out2 = rho * G(Y, m0, r)
    out3 = rho * G(X, m0, r)

    return out1 + out2 + out3
884983
def _build_predict(self, Xnew, full_cov=False):
        
        _, _, Luu, L, _, _, gamma = self._build_common_terms()
        Kus = features.Kuf(self.feature, self.kern, Xnew)  # size  M x Xnew

        w = tf.matrix_triangular_solve(Luu, Kus, lower=True)  # size M x Xnew

        tmp = tf.matrix_triangular_solve(tf.transpose(L), gamma, lower=False)
        mean = tf.matmul(w, tmp, transpose_a=True) + self.mean_function(Xnew)
        intermediateA = tf.matrix_triangular_solve(L, w, lower=True)

        if full_cov:
            var = self.kern.K(Xnew) - tf.matmul(w, w, transpose_a=True) \
                  + tf.matmul(intermediateA, intermediateA, transpose_a=True)
            var = tf.tile(var[None, ...], [self.num_latent, 1, 1])  # P x N x N
        else:
            var = self.kern.Kdiag(Xnew) - tf.reduce_sum(tf.square(w), 0) \
                  + tf.reduce_sum(tf.square(intermediateA), 0)  # size Xnew,
            var = tf.tile(var[:, None], [1, self.num_latent])

        return mean, var
432145
def _compute_prediction(self,X):
        
        A_pred = np.dot(X,self._Bhat)
        Y_pred = self._basis_object.inverse_transform(A_pred)
        return Y_pred