public class ModelHandler
extends java.lang.Object
Constructor and Description |
---|
ModelHandler() |
Modifier and Type | Method and Description |
---|---|
static Vector |
convert2Weights(java.util.ArrayList<java.util.ArrayList<java.lang.String>> data)
Converts an array list of strings into a vector of double
this function can be used after reading a vector from a file
|
static java.util.HashMap<java.lang.Integer,java.lang.Double> |
printMul(Vector v1,
Vector v2) |
static InstancesContainer |
randomShuffle(InstancesContainer instances)
preforming random shuffle on the data instances
|
static Vector |
setWeights(int type,
java.lang.String path)
Set weights for a model from a given file
This function either sets the new vector to be zeros or reads the data from a given path
|
static java.util.TreeMap<java.lang.Integer,java.lang.Double> |
sortMul(Vector v1,
Vector v2) |
public static Vector setWeights(int type, java.lang.String path)
type
- - if this parameter is set to be 0 than the returned vector will be zeros, if 1 than it will populate the vector with the file's datapath
- - the path to the file that contains the vecotr's datapublic static Vector convert2Weights(java.util.ArrayList<java.util.ArrayList<java.lang.String>> data) throws java.text.ParseException
data
- the data 2D array but we treat tim as a 1D arrayjava.text.ParseException
public static InstancesContainer randomShuffle(InstancesContainer instances)
instances
- public static java.util.HashMap<java.lang.Integer,java.lang.Double> printMul(Vector v1, Vector v2)