|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.utils.vectors.VectorHelper
public final class VectorHelper
Static utility methods related to vectors.
Method Summary | |
---|---|
static String |
buildJson(Iterable<Pair<String,Double>> iterable)
|
static String |
buildJson(Iterable<Pair<String,Double>> iterable,
StringBuilder bldr)
|
static List<Pair<Integer,Double>> |
firstEntries(Vector vector,
int maxEntries)
|
static String[] |
loadTermDictionary(org.apache.hadoop.conf.Configuration conf,
String filePattern)
Read a dictionary in SequenceFile generated by
DictionaryVectorizer |
static String[] |
loadTermDictionary(File dictFile)
Read in a dictionary file. |
static List<Pair<Integer,Double>> |
topEntries(Vector vector,
int maxEntries)
|
static List<Pair<String,Double>> |
toWeightedTerms(Collection<Pair<Integer,Double>> entries,
String[] dictionary)
|
static String |
vectorToCSVString(Vector vector,
boolean namesAsComments)
|
static void |
vectorToCSVString(Vector vector,
boolean namesAsComments,
Appendable bldr)
|
static String |
vectorToJson(Vector vector,
String[] dictionary,
int maxEntries,
boolean sort)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String vectorToCSVString(Vector vector, boolean namesAsComments) throws IOException
IOException
public static String buildJson(Iterable<Pair<String,Double>> iterable)
public static String buildJson(Iterable<Pair<String,Double>> iterable, StringBuilder bldr)
public static List<Pair<Integer,Double>> topEntries(Vector vector, int maxEntries)
public static List<Pair<Integer,Double>> firstEntries(Vector vector, int maxEntries)
public static List<Pair<String,Double>> toWeightedTerms(Collection<Pair<Integer,Double>> entries, String[] dictionary)
public static String vectorToJson(Vector vector, String[] dictionary, int maxEntries, boolean sort)
public static void vectorToCSVString(Vector vector, boolean namesAsComments, Appendable bldr) throws IOException
IOException
public static String[] loadTermDictionary(File dictFile) throws IOException
term DocFreq Index
IOException
public static String[] loadTermDictionary(org.apache.hadoop.conf.Configuration conf, String filePattern)
SequenceFile
generated by
DictionaryVectorizer
filePattern
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |