public class ArffDataConvertor extends AbstractDataConvertor
| Modifier and Type | Field and Description |
|---|---|
SparseMatrix |
oneHotFeatureMatrix |
DenseVector |
oneHotRatingVector |
datetimeMatrix, preferenceMatrix, sparseTensorPROGRESS_INTERVAL| Constructor and Description |
|---|
ArffDataConvertor(java.lang.String path)
Initializes a newly created
ArffDataConvertor object
with the path of the input data file. |
ArffDataConvertor(java.lang.String path,
java.util.ArrayList<com.google.common.collect.BiMap<java.lang.String,java.lang.Integer>> featureMapping) |
| Modifier and Type | Method and Description |
|---|---|
java.util.ArrayList<com.google.common.collect.BiMap<java.lang.String,java.lang.Integer>> |
getAllFeatureIds()
Return user, item, appender {raw id, inner id} mapping
|
java.util.ArrayList<ArffAttribute> |
getAttributes()
Return the attributes the input data.
|
java.util.ArrayList<ArffInstance> |
getInstances()
Return the instances of the input data.
|
com.google.common.collect.BiMap<java.lang.String,java.lang.Integer> |
getItemIds()
Return item {rawid, inner id} mappings
|
java.lang.String |
getRelationName()
Return the relation name of input data.
|
com.google.common.collect.BiMap<java.lang.String,java.lang.Integer> |
getUserIds()
Return user {rawid, inner id} mappings
|
void |
oneHotEncoding()
Build the
oneHotFeatureMatrix
and oneHotRatingVector |
void |
processData()
Process the input data.
|
void |
progress()
Report progress to the Librec framework.
|
void |
readData()
Read data from the data file.
|
getDatetimeMatrix, getPreferenceMatrix, getSparseTensorgetJobStatus, progressx, runpublic SparseMatrix oneHotFeatureMatrix
public DenseVector oneHotRatingVector
public ArffDataConvertor(java.lang.String path)
ArffDataConvertor object
with the path of the input data file.path - path of the input data file.public ArffDataConvertor(java.lang.String path,
java.util.ArrayList<com.google.common.collect.BiMap<java.lang.String,java.lang.Integer>> featureMapping)
public void readData()
throws java.io.IOException
java.io.IOException - if the path is not validpublic void processData()
throws java.io.IOException
java.io.IOException - if the path is not validpublic void progress()
Progressablepublic void oneHotEncoding()
oneHotFeatureMatrix
and oneHotRatingVectorpublic java.lang.String getRelationName()
relationNamepublic java.util.ArrayList<ArffInstance> getInstances()
instancespublic java.util.ArrayList<ArffAttribute> getAttributes()
attributespublic com.google.common.collect.BiMap<java.lang.String,java.lang.Integer> getUserIds()
public com.google.common.collect.BiMap<java.lang.String,java.lang.Integer> getItemIds()
public java.util.ArrayList<com.google.common.collect.BiMap<java.lang.String,java.lang.Integer>> getAllFeatureIds()
Copyright © 2017. All Rights Reserved.