Package de.lmu.ifi.dbs.elki.datasource.bundle

Examples of de.lmu.ifi.dbs.elki.datasource.bundle.MultipleObjectsBundle.appendColumn()


      logger.debug("Filtering the data set");
    }

    MultipleObjectsBundle bundle = new MultipleObjectsBundle();
    for(int j = 0; j < objects.metaLength(); j++) {
      bundle.appendColumn(objects.meta(j), new ArrayList<Object>());
    }
    for(int i = 0; i < objects.dataLength(); i++) {
      boolean good = true;
      for(int j = 0; j < objects.metaLength(); j++) {
        if(objects.data(i, j) == null) {
View Full Code Here


      @SuppressWarnings("unchecked")
      SimpleTypeInformation<Object> type = (SimpleTypeInformation<Object>) objects.meta(r);
      @SuppressWarnings("unchecked")
      final List<Object> column = (List<Object>) objects.getColumn(r);
      if(!getInputTypeRestriction().isAssignableFromType(type)) {
        bundle.appendColumn(type, column);
        continue;
      }
      // Should be a vector type after above test.
      @SuppressWarnings("unchecked")
      final VectorFieldTypeInformation<V> vtype = VectorFieldTypeInformation.class.cast(type);
View Full Code Here

      // Get the replacement type informations
      VectorFieldTypeInformation<V> type1 = new VectorFieldTypeInformation<V>(type.getRestrictionClass(), dims.length, dims.length);
      VectorFieldTypeInformation<V> type2 = new VectorFieldTypeInformation<V>(type.getRestrictionClass(), vtype.dimensionality() - dims.length, vtype.dimensionality() - dims.length);
      final List<V> col1 = new ArrayList<V>(column.size());
      final List<V> col2 = new ArrayList<V>(column.size());
      bundle.appendColumn(type1, col1);
      bundle.appendColumn(type2, col2);

      // Build other dimensions array.
      int[] odims = new int[vtype.dimensionality() - dims.length];
      {
View Full Code Here

      VectorFieldTypeInformation<V> type1 = new VectorFieldTypeInformation<V>(type.getRestrictionClass(), dims.length, dims.length);
      VectorFieldTypeInformation<V> type2 = new VectorFieldTypeInformation<V>(type.getRestrictionClass(), vtype.dimensionality() - dims.length, vtype.dimensionality() - dims.length);
      final List<V> col1 = new ArrayList<V>(column.size());
      final List<V> col2 = new ArrayList<V>(column.size());
      bundle.appendColumn(type1, col1);
      bundle.appendColumn(type2, col2);

      // Build other dimensions array.
      int[] odims = new int[vtype.dimensionality() - dims.length];
      {
        int i = 0;
View Full Code Here

  public MultipleObjectsBundle getBundle() {
    final int dim = generators.get(0).getDim();
    final DoubleVector factory = new DoubleVector(new double[dim]);
    MultipleObjectsBundle bundle = new MultipleObjectsBundle();
    VectorFieldTypeInformation<DoubleVector> type = new VectorFieldTypeInformation<DoubleVector>(DoubleVector.class, dim, factory);
    bundle.appendColumn(type, new ArrayList<Object>());
    bundle.appendColumn(TypeUtil.CLASSLABEL, new ArrayList<Object>());

    for(GeneratorInterface generator : generators) {
      ClassLabel l = new SimpleClassLabel(generator.getName());
      for(Vector v : generator.getPoints()) {
View Full Code Here

    final int dim = generators.get(0).getDim();
    final DoubleVector factory = new DoubleVector(new double[dim]);
    MultipleObjectsBundle bundle = new MultipleObjectsBundle();
    VectorFieldTypeInformation<DoubleVector> type = new VectorFieldTypeInformation<DoubleVector>(DoubleVector.class, dim, factory);
    bundle.appendColumn(type, new ArrayList<Object>());
    bundle.appendColumn(TypeUtil.CLASSLABEL, new ArrayList<Object>());

    for(GeneratorInterface generator : generators) {
      ClassLabel l = new SimpleClassLabel(generator.getName());
      for(Vector v : generator.getPoints()) {
        DoubleVector dv = new DoubleVector(v);
View Full Code Here

    for(int r = 0; r < objects.metaLength(); r++) {
      final SimpleTypeInformation<?> type = objects.meta(r);
      final List<?> column = objects.getColumn(r);
      if(!TypeUtil.NUMBER_VECTOR_FIELD.isAssignableFromType(type)) {
        bundle.appendColumn(type, column);
        continue;
      }
      @SuppressWarnings("unchecked")
      final List<? extends NumberVector<?, ?>> castColumn = (List<? extends NumberVector<?, ?>>) column;
      // Get the replacement type information
View Full Code Here

      // Prepare output data
      final List<IntegerVector> outColumn = new ArrayList<IntegerVector>(len);
      for(int i = 0; i < len; i++) {
        outColumn.add(new IntegerVector(posvecs[i]));
      }
      bundle.appendColumn(outType, outColumn);
    }
    return bundle;
  }
}
View Full Code Here

    boolean keeplabelcol = false;
    for(int i = 0; i < objects.metaLength(); i++) {
      SimpleTypeInformation<?> meta = objects.meta(i);
      // Skip non-labellist columns - or if we already had a labellist
      if(done || meta.getRestrictionClass() != LabelList.class) {
        bundle.appendColumn(meta, objects.getColumn(i));
        continue;
      }
      done = true;

      // We split the label column into two parts
View Full Code Here

        else {
          clscol.add(null);
          lblcol.add(null);
        }
      }
      bundle.appendColumn(TypeUtil.CLASSLABEL, clscol);
      // Only add the label column when it's not empty.
      if(keeplabelcol) {
        bundle.appendColumn(meta, lblcol);
      }
    }
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.