Package de.jungblut.math.named

Examples of de.jungblut.math.named.KeyedDoubleVector


    Iterator<DoubleVector> featIterator = features.iterator();
    Iterator<DoubleVector> outIterator = outcome.iterator();

    int id = 0;
    while (featIterator.hasNext()) {
      featureList.add(new KeyedDoubleVector(id, featIterator.next()));
      featureOutcomeMap.put(id, outIterator.next());
      id++;
    }
    index.build(featureList);
  }
View Full Code Here


    List<VectorDistanceTuple<DoubleVector>> neighbours = new ArrayList<>();
    List<DistanceResult<DoubleVector>> result = index.query(feature, k,
        Double.MAX_VALUE);
    // now we need to join the features with its outcome
    for (DistanceResult<DoubleVector> res : result) {
      KeyedDoubleVector resValue = (KeyedDoubleVector) res.get();
      neighbours.add(new VectorDistanceTuple<>(res.get(), featureOutcomeMap
          .get(resValue.getKey()), res.getDistance()));
    }
    return neighbours;
  }
View Full Code Here

TOP

Related Classes of de.jungblut.math.named.KeyedDoubleVector

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.