congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • runOnUiThread (Activity)
  • startActivity (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • 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