Tabnine Logo
EM.logDensityForInstance
Code IndexAdd Tabnine to your IDE (free)

How to use
logDensityForInstance
method
in
weka.clusterers.EM

Best Java code snippets using weka.clusterers.EM.logDensityForInstance (Showing top 4 results out of 315)

origin: Waikato/weka-trunk

 @Override
 public double[] call() {
  double[] llk = new double[2];
  double loglk = 0.0, sOW = 0.0;
  try {
   for (int i = m_lowNum; i < m_highNum; i++) {
    Instance in = m_eData.instance(i);
    loglk += in.weight() * EM.this.logDensityForInstance(in);
    sOW += in.weight();
    if (m_changeWeights) {
     m_weights[i] = distributionForInstance(in);
    }
   }
   // completedETask(loglk, sOW, true);
  } catch (Exception ex) {
   // completedETask(0, 0, false);
  }
  llk[0] = loglk;
  llk[1] = sOW;
  return llk;
 }
}
origin: nz.ac.waikato.cms.weka/weka-stable

 @Override
 public double[] call() {
  double[] llk = new double[2];
  double loglk = 0.0, sOW = 0.0;
  try {
   for (int i = m_lowNum; i < m_highNum; i++) {
    Instance in = m_eData.instance(i);
    loglk += in.weight() * EM.this.logDensityForInstance(in);
    sOW += in.weight();
    if (m_changeWeights) {
     m_weights[i] = distributionForInstance(in);
    }
   }
   // completedETask(loglk, sOW, true);
  } catch (Exception ex) {
   // completedETask(0, 0, false);
  }
  llk[0] = loglk;
  llk[1] = sOW;
  return llk;
 }
}
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * The E step of the EM algorithm. Estimate cluster membership probabilities.
 * 
 * @param inst the training instances
 * @param change_weights whether to change the weights
 * @return the average log likelihood
 * @throws Exception if computation fails
 */
private double E(Instances inst, boolean change_weights) throws Exception {
 double loglk = 0.0, sOW = 0.0;
 for (int l = 0; l < inst.numInstances(); l++) {
  Instance in = inst.instance(l);
  loglk += in.weight() * logDensityForInstance(in);
  sOW += in.weight();
  if (change_weights) {
   m_weights[l] = distributionForInstance(in);
  }
 }
 if (sOW <= 0) { // In case all weights are zero
  return 0;
 }
 
 // reestimate priors
 /*
  * if (change_weights) { estimate_priors(inst); }
  */
 return loglk / sOW;
}
origin: Waikato/weka-trunk

/**
 * The E step of the EM algorithm. Estimate cluster membership probabilities.
 * 
 * @param inst the training instances
 * @param change_weights whether to change the weights
 * @return the average log likelihood
 * @throws Exception if computation fails
 */
private double E(Instances inst, boolean change_weights) throws Exception {
 double loglk = 0.0, sOW = 0.0;
 for (int l = 0; l < inst.numInstances(); l++) {
  Instance in = inst.instance(l);
  loglk += in.weight() * logDensityForInstance(in);
  sOW += in.weight();
  if (change_weights) {
   m_weights[l] = distributionForInstance(in);
  }
 }
 if (sOW <= 0) { // In case all weights are zero
  return 0;
 }
 
 // reestimate priors
 /*
  * if (change_weights) { estimate_priors(inst); }
  */
 return loglk / sOW;
}
weka.clusterersEMlogDensityForInstance

Popular methods of EM

  • <init>
    Constructor.
  • setNumClusters
    Set the number of clusters (-1 to select by CV).
  • CVClusters
    estimate the number of clusters by cross validation on the training data.
  • E
    The E step of the EM algorithm. Estimate cluster membership probabilities.
  • EM_Init
    Initialize the global aggregated estimators and storage.
  • EM_Report
    verbose output for debugging
  • M
    The M step of the EM algorithm.
  • M_reEstimate
  • buildClusterer
    Generates a clusterer. Has to initialize all fields of the clusterer that are not being set via opti
  • distributionForInstance
  • doEM
    Perform the EM algorithm
  • estimate_priors
    calculate prior probabilites for the clusters
  • doEM,
  • estimate_priors,
  • getCapabilities,
  • getMaximumNumberOfClusters,
  • getMinLogLikelihoodImprovementCV,
  • getMinLogLikelihoodImprovementIterating,
  • getMinStdDev,
  • getNumClusters,
  • getNumExecutionSlots,
  • getNumFolds

Popular in Java

  • Creating JSON documents from java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • requestLocationUpdates (LocationManager)
  • getSystemService (Context)
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now