Package de.lmu.ifi.dbs.elki.data

Examples of de.lmu.ifi.dbs.elki.data.DoubleVector


   *
   * @return Bundle
   */
  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()) {
        DoubleVector dv = new DoubleVector(v);
        bundle.appendSimple(dv, l);
      }
    }
    return bundle;
  }
View Full Code Here


    for(Pair<Double, Pair<Long, Long>> ppair : histogram) {
      final double icof = (inum == 0) ? 0 : ((double) ppair.getSecond().getFirst()) / inum / histogram.getBinsize();
      final double icaf = ((double) ppair.getSecond().getFirst()) / bnum / histogram.getBinsize();
      final double ocof = (onum == 0) ? 0 : ((double) ppair.getSecond().getSecond()) / onum / histogram.getBinsize();
      final double ocaf = ((double) ppair.getSecond().getSecond()) / bnum / histogram.getBinsize();
      DoubleVector row = new DoubleVector(new double[] { ppair.getFirst(), icof, icaf, ocof, ocaf });
      binstat.add(row);
    }
    HistogramResult<DoubleVector> result = new HistogramResult<DoubleVector>("Distance Histogram", "distance-histogram", binstat);

    result.addHeader("Absolute minimum distance (abs): " + gminmax.getMin());
View Full Code Here

    // Collections.sort(results);

    // Transform Histogram into a Double Vector array.
    Collection<DoubleVector> res = new ArrayList<DoubleVector>(relation.size());
    for(Pair<Double, MeanVariance> pair : hist) {
      DoubleVector row = new DoubleVector(new double[] { pair.getFirst(), pair.getSecond().getCount(), pair.getSecond().getMean(), pair.getSecond().getSampleVariance() });
      res.add(row);
    }
    return new HistogramResult<DoubleVector>("Ranking Quality Histogram", "ranking-histogram", res);
  }
View Full Code Here

    }

    // Transform Histogram into a Double Vector array.
    Collection<DoubleVector> res = new ArrayList<DoubleVector>(relation.size());
    for(DoubleObjPair<Double> pair : hist) {
      DoubleVector row = new DoubleVector(new double[] { pair.first, pair.getSecond() });
      res.add(row);
    }
    HistogramResult<DoubleVector> result = new HistogramResult<DoubleVector>("Ranking Quality Histogram", "ranking-histogram", res);
    result.addHeader("Mean: " + mv.getMean() + " Variance: " + mv.getSampleVariance());
    return result;
View Full Code Here

  }

  @Override
  public <A> int[] computeReinserts(A entries, ArrayAdapter<? extends SpatialComparable, ? super A> getter, SpatialComparable page) {
    DoubleIntPair[] order = new DoubleIntPair[getter.size(entries)];
    DoubleVector centroid = new DoubleVector(SpatialUtil.centroid(page));
    for(int i = 0; i < order.length; i++) {
      double distance = distanceFunction.doubleMinDist(new DoubleVector(SpatialUtil.centroid(getter.get(entries, i))), centroid);
      order[i] = new DoubleIntPair(distance, i);
    }
    Arrays.sort(order, Collections.reverseOrder());

    int num = (int) (reinsertAmount * order.length);
 
View Full Code Here

  }

  @Override
  public <A> int[] computeReinserts(A entries, ArrayAdapter<? extends SpatialComparable, ? super A> getter, SpatialComparable page) {
    DoubleIntPair[] order = new DoubleIntPair[getter.size(entries)];
    DoubleVector centroid = new DoubleVector(SpatialUtil.centroid(page));
    for(int i = 0; i < order.length; i++) {
      double distance = distanceFunction.doubleMinDist(new DoubleVector(SpatialUtil.centroid(getter.get(entries, i))), centroid);
      order[i] = new DoubleIntPair(distance, i);
    }
    Arrays.sort(order, Collections.reverseOrder());

    int num = (int) (reinsertAmount * order.length);
 
View Full Code Here

    for(DoubleObjPair<Pair<Long, Long>> ppair : histogram) {
      final double icof = (inum == 0) ? 0 : ((double) ppair.getSecond().getFirst()) / inum / histogram.getBinsize();
      final double icaf = ((double) ppair.getSecond().getFirst()) / bnum / histogram.getBinsize();
      final double ocof = (onum == 0) ? 0 : ((double) ppair.getSecond().getSecond()) / onum / histogram.getBinsize();
      final double ocaf = ((double) ppair.getSecond().getSecond()) / bnum / histogram.getBinsize();
      DoubleVector row = new DoubleVector(new double[] { ppair.first, icof, icaf, ocof, ocaf });
      binstat.add(row);
    }
    HistogramResult<DoubleVector> result = new HistogramResult<DoubleVector>("Distance Histogram", "distance-histogram", binstat);

    result.addHeader("Absolute minimum distance (abs): " + gminmax.getMin());
View Full Code Here

    // turn into Collection

    Collection<DoubleVector> collHist = new ArrayList<DoubleVector>(hist.getNumBins());
    for(DoubleObjPair<DoubleDoublePair> ppair : hist) {
      DoubleDoublePair data = ppair.getSecond();
      DoubleVector row = new DoubleVector(new double[] { ppair.first, data.first, data.second });
      collHist.add(row);
    }
    return new HistogramResult<DoubleVector>("Outlier Score Histogram", "outlier-histogram", collHist);
  }
View Full Code Here

    // Collections.sort(results);

    // Transform Histogram into a Double Vector array.
    Collection<DoubleVector> res = new ArrayList<DoubleVector>(relation.size());
    for(DoubleObjPair<MeanVariance> pair : hist) {
      DoubleVector row = new DoubleVector(new double[] { pair.first, pair.getSecond().getCount(), pair.getSecond().getMean(), pair.getSecond().getSampleVariance() });
      res.add(row);
    }
    return new HistogramResult<DoubleVector>("Ranking Quality Histogram", "ranking-histogram", res);
  }
View Full Code Here

    }

    List<DoubleVector> vectors = new ArrayList<DoubleVector>();
    List<LabelList> lblc = new ArrayList<LabelList>();
    for(int i = 0; i < data.length; i++) {
      DoubleVector featureVector = new DoubleVector(data[i]);
      vectors.add(featureVector);
      lblc.add(labels[i]);
    }
    return MultipleObjectsBundle.makeSimple(getTypeInformation(dimensionality), vectors, TypeUtil.LABELLIST, lblc);
  }
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.data.DoubleVector

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.