Package weka.classifiers.bayes.blr

# Class LaplacePriorImpl

java.lang.Object
weka.classifiers.bayes.blr.Prior
weka.classifiers.bayes.blr.LaplacePriorImpl

All Implemented Interfaces:
  `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

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.
`String`
`getRevision()`
Returns the revision string.
`double`
`laplaceUpdate(int j, double sign)`
This is the CLG-lasso update function described in the
`double`
`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`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### LaplacePriorImpl

public LaplacePriorImpl()

## Method Details

### update

public double update(int j, Instances instances, double beta, double hyperparameter, double[] r, double deltaV)
Update function specific to Laplace Prior.

Overrides:
  `update` in class `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 class `Prior`
Parameters:
  `betas` -
  `hyperparameters` -

### getRevision

public String getRevision()
Returns the revision string.

Returns:
  the revision