congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
EM.distributionForInstance
Code IndexAdd Tabnine to your IDE (free)

How to use
distributionForInstance
method
in
weka.clusterers.EM

Best Java code snippets using weka.clusterers.EM.distributionForInstance (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.clusterersEMdistributionForInstance

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
  • doEM
    Perform the EM algorithm
  • estimate_priors
    calculate prior probabilites for the clusters
  • getCapabilities
    Returns default capabilities of the clusterer (i.e., the ones of SimpleKMeans).
  • estimate_priors,
  • getCapabilities,
  • getMaximumNumberOfClusters,
  • getMinLogLikelihoodImprovementCV,
  • getMinLogLikelihoodImprovementIterating,
  • getMinStdDev,
  • getNumClusters,
  • getNumExecutionSlots,
  • getNumFolds

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top Vim 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