Examples of Sample


Examples of edu.uci.jforestsx.sample.Sample

  protected Sample getSubLearnerSample() {
    for (int i = 0; i < curTrainSet.size; i++) {
      residuals[i] = curTrainSet.targets[i] - trainPredictions[i];
    }
    Sample subLearnerSample = curTrainSet.getClone();
    subLearnerSample.targets = residuals;
    subLearnerSample = subLearnerSample.getRandomSubSample(samplingRate, rnd);
    return subLearnerSample;
  }
View Full Code Here

Examples of edu.uci.jforestsx.sample.Sample

    /*
     * Load the data set
     */
    InputStream in = new IOUtils().getInputStream((String) options.valueOf("test-file"));
    Sample sample;
    if (options.has("ranking")) {
      RankingDataset dataset = new RankingDataset();
      RankingDatasetLoader.load(in, dataset);
      sample = new RankingSample(dataset);
    } else {
      Dataset dataset = new Dataset();
      DatasetLoader.load(in, dataset);
      sample = new Sample(dataset);
    }
    in.close();

    double[] predictions = new double[sample.size];
    LearningUtils.updateScores(sample, predictions, ensemble);
View Full Code Here

Examples of edu.uci.jforestsx.sample.Sample

  protected void initDataset(Dataset dataset) throws Exception {
    // Will be overridden by subclasses
  }

  protected Sample createSample(Dataset dataset, boolean trainSample) {
    return new Sample(dataset);
  }
View Full Code Here

Examples of edu.uci.jforestsx.sample.Sample

      }
      System.out.println("Finished loading datasets.");

      Constants.init(maxInstances);

      Sample allTrainSample = createSample(trainDataset, true);
      trainSet = allTrainSample.getRandomSubSample(trainingConfig.trainFraction, rnd);

      if (validDataset != null) {
        validSet = createSample(validDataset, false);
        if (trainingConfig.validFraction < 1.0) {
          validSet = validSet.getRandomSubSample(trainingConfig.validFraction, rnd);
        }
      } else if (trainingConfig.validOutOfTrain) {
        validSet = allTrainSample.getOutOfSample(trainSet);
      }

      init();

      evaluationMetric = getEvaluationMetric(trainingConfig.evaluationMetric);
View Full Code Here

Examples of fr.soleil.bean.samplesbean.model.Sample

    }

    public DefaultMutableTreeTableNode generateTreeTableModel() {
        List<Cell> cellList = rack.getCellList();

        DefaultMutableTreeTableNode aRoot = new DefaultMutableTreeTableNode(new Sample());
        for (Iterator<Cell> iterator = cellList.iterator(); iterator.hasNext();) {
            Cell cell = iterator.next();
            cell.addObserver(this);
            if (!cell.hasChildren()) {
                aRoot.add(new DefaultMutableTreeTableNode(cell));
View Full Code Here

Examples of fr.soleil.bean.samplesbean.model.Sample

        Object value = null;
        if (node instanceof DefaultMutableTreeTableNode) {
            DefaultMutableTreeTableNode mutableNode = (DefaultMutableTreeTableNode) node;
            if (mutableNode.getUserObject() instanceof Cell) {
                Cell cell = (Cell) mutableNode.getUserObject();
                Sample sample = cell.getSample();
                if (column < FIXED_COLUMN_NUMBER) {
                    switch (column) {
                        case CELL_NUMBER_INDEX:
                            if (cell instanceof SubCell) {
                                value = sample.getCellPosition();
                            } else {
                                value = cell.getNumberCell();
                            }
                            break;
                        case SAMPLE_NAME_INDEX:
                            value = sample;
                            break;
                        case ORDER_INDEX:
                            value = sample.getStringFormattedOrderList();
                            break;
                    }
                } else {
                    value = sample.getFormattedPositionAt(getColumnName(column));
                }
            }
        }
        return value;
    }
View Full Code Here

Examples of fr.soleil.bean.samplesbean.model.Sample

    public void setValueAt(Object value, Object node, int column) {
        if (node instanceof DefaultMutableTreeTableNode) {
            DefaultMutableTreeTableNode mutableNode = (DefaultMutableTreeTableNode) node;
            if (mutableNode.getUserObject() instanceof Cell) {
                Cell cell = (Cell) mutableNode.getUserObject();
                Sample sample = cell.getSample();
                if (column <= FIXED_COLUMN_NUMBER) {
                    switch (column) {
                        case SAMPLE_NAME_INDEX:
                            sample.setSampleName(value.toString());
                            break;

                        case ORDER_INDEX:
                            String order = value.toString();
                            sample.initOrderList();
                            if (!order.equals("")) {
                                String[] orderTable = order.split(",");
                                if (orderTable != null) {
                                    sample.initOrderList();
                                    for (int i = 0; i < orderTable.length; i++) {
                                        sample.addOrder(Integer.valueOf(orderTable[i]));
                                    }
                                }
                            }
                            break;
                    }
                } else {
                    // Whoohoo ColumnName is ActuatorName
                    // This is not a very strong matching
                    String actuator = getColumnName(column);
                    if (value instanceof Double){
                        Double dblValue = (Double)value;
                        sample.setPosition(actuator,dblValue);
                    }
                }
            }
        }
    }
View Full Code Here

Examples of fr.soleil.bean.samplesbean.model.Sample

            for (String actuator : actuators) {
                positions.put(actuator, SampleBeanController.getFacadeService().getActuatorPosition(actuator));
            }
            DefaultMutableTreeTableNode cellNode = ((DefaultMutableTreeTableNode) treePath.getLastPathComponent());
            Cell cell = (Cell) cellNode.getUserObject();
            Sample sample = cell.getSample();
            sample.setPositions(positions);
            // NOTIFY TABLE
            treeTableModel.firePathChanged(treePath);
    }
View Full Code Here

Examples of fr.soleil.bean.samplesbean.model.Sample

    super.actionPerformed(e);
    if (userObject instanceof SubCell) {
      SubCell subCell = (SubCell) userObject;
      if (subCell != null) {
        CellPosition oldPosition = subCell.getPosition();
        Sample sample = subCell.getSample();
        Cell parent = subCell.getParent();
        parent.removeChildrenForMove(oldPosition);
        parent.addChildren(cellPosition, sample);
      }
    } else if (userObject instanceof Cell) {
      Cell cell = (Cell) userObject;
      if (cell != null) {
        Sample sample = cell.getSample();
        cell.initSample();
        cell.addChildren(cellPosition, sample);
      }
    }
  }
View Full Code Here

Examples of fr.soleil.bean.samplesbean.model.Sample

      SampleBeanController.getFacadeService()
          .cleanCurrentConfiguration();

      for (Iterator<Sample> iterator = sampleSet.iterator(); iterator
          .hasNext();) {
        Sample sample = iterator.next();
        SampleBeanController.getFacadeService().addSample(sample);
      }
                      

    } catch (DevFailed df) {
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.