Package org.data2semantics.proppred.learners

Examples of org.data2semantics.proppred.learners.SparseVector


    }
    return features;
  }

  private SparseVector normalizeFeatures(SparseVector features) {
    SparseVector res = new SparseVector();
    for (int key : features.getIndices()) {
      List<Integer> path = index2path.get(key);
      if (path.size()==0) {
        res.setValue(key, 1.0);
      } else {
        List<Integer> parent = path.subList(0, path.size()-pathLen);
        int parentKey = path2index.get(parent);
        res.setValue(key, features.getValue(key)/features.getValue(parentKey));
      }
    }
    return res;
  }
View Full Code Here


  public SparseVector[] computeFeatureVectors(RDFDataSet dataset,
      List<Resource> instances, List<Statement> blackList) {

    SparseVector[] featureVectors = new SparseVector[instances.size()];
    for (int i = 0; i < featureVectors.length; i++) {
      featureVectors[i] = new SparseVector();
   

    for (RDFFeatureVectorKernel k : kernels) {
      SparseVector[] fv = k.computeFeatureVectors(dataset, instances, blackList);
View Full Code Here


  public SparseVector[] computeFeatureVectors(RDFDataSet dataset, List<Resource> instances, List<Statement> blackList) {
    SparseVector[] featureVectors = new SparseVector[instances.size()];
    for (int i = 0; i < featureVectors.length; i++) {
      featureVectors[i] = new SparseVector();
   

    DirectedGraph<Vertex<Map<Integer,StringBuilder>>,Edge<Map<Integer,StringBuilder>>> graph = createGraphFromRDF(dataset, instances, blackList);
    createInstanceIndexMaps(graph, instances);
    addNegativeDepths(graph);
View Full Code Here

TOP

Related Classes of org.data2semantics.proppred.learners.SparseVector

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.