Class DocToDoubleVectorUtils
java.lang.Object
org.apache.lucene.classification.utils.DocToDoubleVectorUtils
utility class for converting Lucene
Document
s to Double
vectors.-
Method Summary
Modifier and TypeMethodDescriptionstatic Double[]
toDenseLocalFreqDoubleArray
(Terms docTerms) create a denseDouble
vector given doc and field term vectors using local frequency of the terms in the docstatic Double[]
toSparseLocalFreqDoubleArray
(Terms docTerms, Terms fieldTerms) create a sparseDouble
vector given doc and field term vectors using local frequency of the terms in the doc
-
Method Details
-
toSparseLocalFreqDoubleArray
public static Double[] toSparseLocalFreqDoubleArray(Terms docTerms, Terms fieldTerms) throws IOException create a sparseDouble
vector given doc and field term vectors using local frequency of the terms in the doc- Parameters:
docTerms
- term vectors for a given documentfieldTerms
- field term vectors- Returns:
- a sparse vector of
Double
s as an array - Throws:
IOException
- in case accessing the underlying index fails
-
toDenseLocalFreqDoubleArray
create a denseDouble
vector given doc and field term vectors using local frequency of the terms in the doc- Parameters:
docTerms
- term vectors for a given document- Returns:
- a dense vector of
Double
s as an array - Throws:
IOException
- in case accessing the underlying index fails
-