public class ArffDataConvertor extends AbstractDataConvertor
Modifier and Type | Field and Description |
---|---|
SparseMatrix |
oneHotFeatureMatrix |
DenseVector |
oneHotRatingVector |
datetimeMatrix, preferenceMatrix, sparseTensor
PROGRESS_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, getSparseTensor
getJobStatus, progressx, run
public 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()
Progressable
public void oneHotEncoding()
oneHotFeatureMatrix
and oneHotRatingVector
public java.lang.String getRelationName()
relationName
public java.util.ArrayList<ArffInstance> getInstances()
instances
public java.util.ArrayList<ArffAttribute> getAttributes()
attributes
public 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.