Package weka.classifiers.bayes.blr
Class LaplacePriorImpl
- java.lang.Object
-
- weka.classifiers.bayes.blr.Prior
-
- weka.classifiers.bayes.blr.LaplacePriorImpl
-
- All Implemented Interfaces:
java.io.Serializable
,RevisionHandler
public class LaplacePriorImpl extends Prior
Implementation of the Gaussian Prior update function based on modified CLG Algorithm (CLG-Lasso) with a certain Trust Region Update based on Laplace Priors.- Version:
- $Revision: 1.2 $
- Author:
- Navendu Garg(gargnav@iit.edu)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LaplacePriorImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
computeLogLikelihood(double[] betas, Instances instances)
Computes the log-likelihood values using the implementation in the Prior class.void
computePenalty(double[] betas, double[] hyperparameters)
This function computes the penalty term specific to Laplacian distribution.java.lang.String
getRevision()
Returns the revision string.double
laplaceUpdate(int j, double sign)
This is the CLG-lasso update function described in thedouble
update(int j, Instances instances, double beta, double hyperparameter, double[] r, double deltaV)
Update function specific to Laplace Prior.-
Methods inherited from class weka.classifiers.bayes.blr.Prior
computelogLikelihood, getLoglikelihood, getLogPosterior, getPenalty
-
-
-
-
Method Detail
-
update
public double update(int j, Instances instances, double beta, double hyperparameter, double[] r, double deltaV)
Update function specific to Laplace Prior.
-
laplaceUpdate
public double laplaceUpdate(int j, double sign)
This is the CLG-lasso update function described in the@TechReport{blrtext04, author = {Alexander Genkin and David D. Lewis and David Madigan}, title = {Large-scale bayesian logistic regression for text categorization}, institution = {DIMACS}, year = {2004}, url = "http://www.stat.rutgers.edu/~madigan/PAPERS/shortFat-v3a.pdf", OPTannote = {} }
- Parameters:
j
-- Returns:
- double value
-
computeLogLikelihood
public void computeLogLikelihood(double[] betas, Instances instances)
Computes the log-likelihood values using the implementation in the Prior class.- Parameters:
betas
-instances
-hyperparameter
-
-
computePenalty
public void computePenalty(double[] betas, double[] hyperparameters)
This function computes the penalty term specific to Laplacian distribution.- Overrides:
computePenalty
in classPrior
- Parameters:
betas
-hyperparameters
-
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Returns:
- the revision
-
-