Package weka.classifiers.bayes.blr
Class Prior
java.lang.Object
weka.classifiers.bayes.blr.Prior
- All Implemented Interfaces:
Serializable,RevisionHandler
- Direct Known Subclasses:
GaussianPriorImpl,LaplacePriorImpl
This is an interface to plug various priors into
the Bayesian Logistic Regression Model.
- Version:
- $Revision: 1.2 $
- Author:
- Navendu Garg (gargnav@iit.edu)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcomputelogLikelihood(double[] betas, Instances instances) Function computes the log-likelihood value: -sum{1 to n}{ln(1+exp(-Beta*x(i)*y(i))}voidcomputePenalty(double[] betas, double[] hyperparameters) Skeleton function to compute penalty terms.doubledoubledoubledoubleInterface for the update functions for different types of priors.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface weka.core.RevisionHandler
getRevision
-
Constructor Details
-
Prior
public Prior()
-
-
Method Details
-
update
public double update(int j, Instances instances, double beta, double hyperparameter, double[] r, double deltaV) Interface for the update functions for different types of priors. -
computelogLikelihood
Function computes the log-likelihood value: -sum{1 to n}{ln(1+exp(-Beta*x(i)*y(i))}- Parameters:
betas-instances-
-
computePenalty
public void computePenalty(double[] betas, double[] hyperparameters) Skeleton function to compute penalty terms.- Parameters:
betas-hyperparameters-
-
getLoglikelihood
public double getLoglikelihood()- Returns:
- log-likelihood value.
-
getLogPosterior
public double getLogPosterior()- Returns:
- regularized log posterior value.
-
getPenalty
public double getPenalty()- Returns:
- penalty term.
-