Prior (original) (raw)
java.lang.Object
- weka.classifiers.bayes.blr.Prior
All Implemented Interfaces:
java.io.Serializable, RevisionHandler
Direct Known Subclasses:
GaussianPriorImpl, LaplacePriorImpl
public abstract class Prior
extends java.lang.Object
implements java.io.Serializable, RevisionHandler
This is an interface to plug various priors into the Bayesian Logistic Regression Model.
Version: Revision:1.2Revision: 1.2 Revision:1.2
Author:
Navendu Garg (gargnav@iit.edu)
See Also:
Serialized Form
Constructor Summary
Constructors
Constructor and Description Prior() Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method and Description void computelogLikelihood(double[] betas,Instances instances) Function computes the log-likelihood value: -sum{1 to n}{ln(1+exp(-Beta*x(i)*y(i))} void computePenalty(double[] betas, double[] hyperparameters) Skeleton function to compute penalty terms. double getLoglikelihood() double getLogPosterior() double getPenalty() double update(int j,Instances instances, double beta, double hyperparameter, double[] r, double deltaV) Interface for the update functions for different types of priors. * ### Methods inherited from class java.lang.Object `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait` * ### Methods inherited from interface weka.core.[RevisionHandler](../../../../weka/core/RevisionHandler.html "interface in weka.core") `[getRevision](../../../../weka/core/RevisionHandler.html#getRevision--)`
Constructor Detail
* #### Prior public Prior()
Method Detail
* #### update public double update(int j, [Instances](../../../../weka/core/Instances.html "class in weka.core") instances, double beta, double hyperparameter, double[] r, double deltaV) Interface for the update functions for different types of priors. * #### computelogLikelihood public void computelogLikelihood(double[] betas, [Instances](../../../../weka/core/Instances.html "class in weka.core") instances) 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.