Examples of KeyedDoubleVector


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

Examples of de.jungblut.math.named.KeyedDoubleVector

    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
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.