Package com.clearnlp.classification.vector

Examples of com.clearnlp.classification.vector.SparseFeatureVector.addFeature()


      value = vector.getValue(i);
     
      if ((map = m_features.get(type)) != null && (index = map.get(value)) > 0)
      {
        if (sparse.hasWeight())
          sparse.addFeature(index, vector.getWeight(i));
        else
          sparse.addFeature(index);
      }
    }
   
View Full Code Here


      if ((map = m_features.get(type)) != null && (index = map.get(value)) > 0)
      {
        if (sparse.hasWeight())
          sparse.addFeature(index, vector.getWeight(i));
        else
          sparse.addFeature(index);
      }
    }
   
    sparse.trimToSize();
    return sparse;
View Full Code Here

   
    SparseFeatureVector vector = new SparseFeatureVector(hasWeight);
    int i, size = tmp.length;
   
    for (i=1; i<size; i++)
      vector.addFeature(tmp[i]);
   
    return new Pair<String,SparseFeatureVector>(label, vector);
  }
}
View Full Code Here

      value = vector.getValue(i);
     
      if ((map = m_features.get(type)) != null && (index = map.get(value)) > 0)
      {
        if (sparse.hasWeight())
          sparse.addFeature(index, vector.getWeight(i));
        else
          sparse.addFeature(index);
      }
    }
   
View Full Code Here

      if ((map = m_features.get(type)) != null && (index = map.get(value)) > 0)
      {
        if (sparse.hasWeight())
          sparse.addFeature(index, vector.getWeight(i));
        else
          sparse.addFeature(index);
      }
    }
   
    sparse.trimToSize();
    return sparse;
View Full Code Here

      value = vector.getValue(i);
     
      if ((map = m_features.get(type)) != null && (index = map.get(value)) > 0)
      {
        if (sparse.hasWeight())
          sparse.addFeature(index, vector.getWeight(i));
        else
          sparse.addFeature(index);
      }
    }
   
View Full Code Here

      if ((map = m_features.get(type)) != null && (index = map.get(value)) > 0)
      {
        if (sparse.hasWeight())
          sparse.addFeature(index, vector.getWeight(i));
        else
          sparse.addFeature(index);
      }
    }
   
    sparse.trimToSize();
    return sparse;
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.