Package weka.core

Examples of weka.core.Instances.sort()


      maxInfoGain = 0;
      value = 0
     
      double fstCover=0, sndCover=0, fstAccu=0, sndAccu=0;
     
      data.sort(att);
      // Find the las instance without missing value
      for(int x=0; x<data.numInstances(); x++){
  Instance inst = data.instance(x);
  if(inst.isMissing(att)){
    total = x;
View Full Code Here


     * @param defInfo the default information for data
     * @return the array of data after split
     */
    public Instances[] splitData(Instances insts, double defInfo){ 
      Instances data = new Instances(insts);
      data.sort(att);
      int total=data.numInstances();// Total number of instances without
      // missing value for att
      maxInfoGain = 0;
      value = 0
     
View Full Code Here

    // Copy data so that it can be sorted
    Instances data = new Instances(getInputFormat());

    // Sort input data
    data.sort(index);

    // Compute weight of instances without missing values
    double sumOfWeights = 0;
    for (int i = 0; i < data.numInstances(); i++) {
      if (data.instance(i).isMissing(index)) {
View Full Code Here

    if (getInputFormat() == null) {
      throw new IllegalStateException("No input instance format defined");
    }

    Instances input = getInputFormat();
    input.sort(0);   // make sure that bagID is sorted
    Instances output = getOutputFormat();
    Instances bagInsts = output.attribute(1).relation();
    Instance inst = new Instance(bagInsts.numAttributes());
    inst.setDataset(bagInsts);
View Full Code Here

     * @param cl the class label to be predicted
     * @return the array of data after split
     */
    public Instances[] splitData(Instances insts, double defAcRt, double cl){
      Instances data = new Instances(insts);
      data.sort(att);
      int total=data.numInstances();// Total number of instances without
      // missing value for att
     
      int split=1;                  // Current split position
      int prev=0;                   // Previous split position
View Full Code Here

     * @param cl the class label to be predicted
     * @return the array of data after split
     */
    public Instances[] splitData(Instances insts, double defAcRt, double cl){
      Instances data = new Instances(insts);
      data.sort(att);
      int total=data.numInstances();// Total number of instances without
      // missing value for att
     
      int split=1;                  // Current split position
      int prev=0;                   // Previous split position
View Full Code Here

      maxInfoGain = 0;
      value = 0
     
      double fstCover=0, sndCover=0, fstAccu=0, sndAccu=0;
     
      data.sort(att);
      // Find the las instance without missing value
      for(int x=0; x<data.numInstances(); x++){
  Instance inst = data.instance(x);
  if(inst.isMissing(att)){
    total = x;
View Full Code Here

     * @param defInfo the default information for data
     * @return the array of data after split
     */
    public Instances[] splitData(Instances insts, double defInfo){ 
      Instances data = new Instances(insts);
      data.sort(att);
      int total=data.numInstances();// Total number of instances without
      // missing value for att
      maxInfoGain = 0;
      value = 0
     
View Full Code Here

     * @param attIndex the index of the attribute
     * @param pq the priority queue of candidtate splits
     */
    private void evaluateNumeric(int attIndex, PriorityQueue<HotTestDetails> pq) {
      Instances tempInsts = m_insts;
      tempInsts.sort(attIndex);
     
      // target sums/counts
      double targetLeft = 0;
      double targetRight = 0;

View Full Code Here

    if (getInputFormat() == null) {
      throw new IllegalStateException("No input instance format defined");
    }

    Instances input = getInputFormat();
    input.sort(0);   // make sure that bagID is sorted
    Instances output = getOutputFormat();
    Instances bagInsts = output.attribute(1).relation();
    Instance inst = new Instance(bagInsts.numAttributes());
    inst.setDataset(bagInsts);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.