Package org.apache.mahout.math

Examples of org.apache.mahout.math.Vector.asFormatString()


        Vector theVec = point.getVector();
        line.append(',');
        if (theVec instanceof NamedVector) {
          line.append(((NamedVector)theVec).getName());
        } else {
          String vecStr = theVec.asFormatString();
          //do some basic manipulations for display
          vecStr = VEC_PATTERN.matcher(vecStr).replaceAll("_");
          line.append(vecStr);
        }
      }
View Full Code Here


        float targetX = x + (float) (distance * Math.cos(angleRads));
        float targetY = y + (float) (distance * Math.sin(angleRads));
        if (theVec instanceof NamedVector) {
          vecStr = ((NamedVector) theVec).getName();
        } else {
          vecStr = theVec.asFormatString();
          //do some basic manipulations for display
          vecStr = VEC_PATTERN.matcher(vecStr).replaceAll("_");
        }
        if (subString > 0 && vecStr.length() > subString) {
          vecStr = vecStr.substring(0, subString);
View Full Code Here

        float targetX = x + (float) (distance * Math.cos(angleRads));
        float targetY = y + (float) (distance * Math.sin(angleRads));
        if (theVec instanceof NamedVector) {
          vecStr = ((NamedVector) theVec).getName();
        } else {
          vecStr = theVec.asFormatString();
          //do some basic manipulations for display
          vecStr = VEC_PATTERN.matcher(vecStr).replaceAll("_");
        }
        if (subString > 0 && vecStr.length() > subString) {
          vecStr = vecStr.substring(0, subString);
View Full Code Here

        Vector theVec = point.getVector();
        line.append(',');
        if (theVec instanceof NamedVector) {
          line.append(((NamedVector)theVec).getName());
        } else {
          String vecStr = theVec.asFormatString();
          //do some basic manipulations for display
          vecStr = VEC_PATTERN.matcher(vecStr).replaceAll("_");
          line.append(vecStr);
        }
      }
View Full Code Here

        Map<String, Object> entry = Maps.newHashMap();
        Vector theVec = point.getVector();
        if (theVec instanceof NamedVector) {
          entry.put("vector_name", ((NamedVector) theVec).getName());
        } else {
          String vecStr = theVec.asFormatString();
          // do some basic manipulations for display
          vecStr = VEC_PATTERN.matcher(vecStr).replaceAll("_");
          entry.put("vector_name", vecStr);
        }
        entry.put("weight", String.valueOf(point.getWeight()));
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.