Package com.proofpoint.stats

Examples of com.proofpoint.stats.BucketedTimeDistribution$Distribution


    m_isLeaf = false;
    m_isEmpty = false;
    m_sons = null;
    indeX = 0;
    sumOfWeights = data.sumOfWeights();
    noSplit = new NoSplit (new Distribution((Instances)data));
    if (leaf)
      m_localModel = noSplit;
    else
      m_localModel = m_toSelectModel.selectModel(data);
    if (m_localModel.numSubsets() > 1) {
View Full Code Here


    m_isLeaf = false;
    m_isEmpty = false;
    m_sons = null;
    indeX = 0;
    sumOfWeights = train.sumOfWeights();
    noSplit = new NoSplit (new Distribution((Instances)train));
    if (leaf)
      m_localModel = noSplit;
    else
      m_localModel = m_toSelectModel.selectModel(train, test);
    m_test = new Distribution(test, m_localModel);
    if (m_localModel.numSubsets() > 1) {
      localTrain = m_localModel.split(train);
      localTest = m_localModel.split(test);
      train = null;
      test = null;
View Full Code Here

  /**
   * Computes error estimate for tree.
   */
  private double errorsForTree() throws Exception {

    Distribution test;

    if (m_isLeaf)
      return errorsForLeaf();
    else {
      double error = 0;
View Full Code Here

    m_isLeaf = false;
    m_isEmpty = false;
    m_sons = null;
    indeX = 0;
    sumOfWeights = data.sumOfWeights();
    noSplit = new NoSplit (new Distribution((Instances)data));
    if (leaf)
      m_localModel = noSplit;
    else
      m_localModel = m_toSelectModel.selectModel(data);
    if (m_localModel.numSubsets() > 1) {
View Full Code Here

    } else {
      getSplitPoint();
      m_numSubsets = 2;
    }
    //create distribution for data
    m_distribution = new Distribution(data, this)
  }
View Full Code Here

      double[][] dataZs, double[][] dataWs) throws Exception{

    int numAttributes = data.numAttributes();

    if (numAttributes < 2) throw new Exception("Can't select Model without non-class attribute");
    if (data.numInstances() < m_minNumInstances) return new NoSplit(new Distribution(data));


    double bestGain = -Double.MAX_VALUE;
    int bestAttribute = -1;

    //try split on every attribute
    for (int i = 0; i < numAttributes; i++) {
      if (i != data.classIndex()) {

  //build split
  ResidualSplit split = new ResidualSplit(i);     
  split.buildClassifier(data, dataZs, dataWs);

  if (split.checkModel(m_minNumInstances)){

    //evaluate split
    double gain = split.entropyGain()
    if (gain > bestGain) {
      bestGain = gain;
      bestAttribute = i;
    }
  }
      }         
    }    

    if (bestGain >= m_minInfoGain){
      //return best split
      ResidualSplit split = new ResidualSplit(bestAttribute);
      split.buildClassifier(data, dataZs, dataWs)
      return split;     
    } else {     
      //could not find any split with enough information gain
      return new NoSplit(new Distribution(data));     
    }
  }
View Full Code Here

    Instances [] localInstances;
    double errors = 0;
    int i;

    if (m_isLeaf)
      return getEstimatedErrorsForDistribution(new Distribution(data));
    else{
      Distribution savedDist = m_localModel.distribution();
      m_localModel.resetDistribution(data);
      localInstances = (Instances[])m_localModel.split(data);
      //m_localModel.m_distribution=savedDist;
      for (i=0;i<m_sons.length;i++)
        errors = errors+
View Full Code Here

TOP

Related Classes of com.proofpoint.stats.BucketedTimeDistribution$Distribution

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.