public class FrameUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
FrameUtils.CalculateWeightMeanSTD
This class will calculate the weighted mean and standard deviatioin of a target column of a data frame
with the weights specified in another column.
|
static class |
FrameUtils.CategoricalBinaryEncoder
Helper to convert a categorical variable into a "binary" encoding format.
|
static class |
FrameUtils.CategoricalEigenEncoder
Helper to convert a categorical variable into the first eigenvector of the dummy-expanded matrix.
|
static class |
FrameUtils.CategoricalEnumLimitedEncoder
Helper to convert a categorical variable into the first eigenvector of the dummy-expanded matrix.
|
static class |
FrameUtils.CategoricalLabelEncoder |
static class |
FrameUtils.CategoricalOneHotEncoder |
static class |
FrameUtils.ExpandCatBetaConstraints |
static class |
FrameUtils.ExportTaskDriver |
static class |
FrameUtils.MissingInserter
Helper to insert missing values into a Frame
|
static class |
FrameUtils.Vec2ArryTsk |
static class |
FrameUtils.Vecs2ArryTsk |
static class |
FrameUtils.WeightedMean |
Modifier and Type | Field and Description |
---|---|
static int |
MAX_VEC_NUM_ROWS_FOR_ARRAY_EXPORT |
Constructor and Description |
---|
FrameUtils() |
Modifier and Type | Method and Description |
---|---|
static double[][] |
asDoubles(Frame frame) |
static double[] |
asDoubles(Vec v) |
static int[] |
asInts(Vec v) |
static Frame |
categoricalEncoder(Frame dataset,
java.lang.String[] skipCols,
Model.Parameters.CategoricalEncodingScheme scheme,
ToEigenVec tev,
int maxLevels) |
static ChunkSummary |
chunkSummary(Frame fr)
Compute a chunk summary (how many chunks of each type, relative size, total size)
|
static void |
cleanUp(IcedHashMap<Key,java.lang.String> toDelete) |
static void |
delete(Lockable... frs) |
static Key |
eagerLoadFromHTTP(java.lang.String path) |
static Key<?> |
eagerLoadFromURL(java.lang.String sourceId,
java.net.URL url) |
static Frame |
encodeBetaConstraints(Key key,
java.lang.String[] coefNames,
java.lang.String[] coefOriginalNames,
Frame betaConstraints) |
static Chunk[] |
extractChunks(Frame fr,
int chunkId,
boolean runLocal) |
static Key[] |
generateNumKeys(Key mk,
int num)
Generate given numbers of keys by suffixing key by given numbered suffix.
|
static Key[] |
generateNumKeys(Key mk,
int num,
java.lang.String delim) |
static void |
labelRows(Frame frame,
java.lang.String labelColumnName)
Labels frame's rows with a sequence starting with 1 & sending with total number of rows in the frame.
|
static Frame |
parseFrame(Key okey,
java.io.File... files)
Parse given file(s) into the form of single frame represented by the given key.
|
static Frame |
parseFrame(Key okey,
ParseSetup parseSetup,
java.net.URI... uris) |
static Frame |
parseFrame(Key okey,
java.net.URI... uris)
Parse given set of URIs and produce a frame's key representing output.
|
static void |
printTopCategoricalLevels(Frame fr,
boolean warn,
int topK) |
static void |
shrinkDomainsToObservedSubset(Frame frameToModifyInPlace)
reduce the domains of all categorical columns to the actually observed subset
|
static double |
sparseRatio(Chunk[] chks)
compute fraction of sparse chunks in this array.
|
static double |
sparseRatio(Frame fr) |
public static final int MAX_VEC_NUM_ROWS_FOR_ARRAY_EXPORT
public static Frame parseFrame(Key okey, java.io.File... files) throws java.io.IOException
okey
- destination key for parsed framefiles
- files to parsejava.io.IOException
public static Frame parseFrame(Key okey, java.net.URI... uris) throws java.io.IOException
okey
- key for ouput frame. Can be nulluris
- array of URI (file://, hdfs://, s3n://, s3a://, s3://, http://, https:// ...) to parsejava.io.IOException
- in case of parse error.public static Key eagerLoadFromHTTP(java.lang.String path) throws java.io.IOException
java.io.IOException
public static Key<?> eagerLoadFromURL(java.lang.String sourceId, java.net.URL url) throws java.io.IOException
java.io.IOException
public static Frame parseFrame(Key okey, ParseSetup parseSetup, java.net.URI... uris) throws java.io.IOException
java.io.IOException
public static Frame categoricalEncoder(Frame dataset, java.lang.String[] skipCols, Model.Parameters.CategoricalEncodingScheme scheme, ToEigenVec tev, int maxLevels)
public static void printTopCategoricalLevels(Frame fr, boolean warn, int topK)
public static double[] asDoubles(Vec v)
public static double[][] asDoubles(Frame frame)
public static int[] asInts(Vec v)
public static ChunkSummary chunkSummary(Frame fr)
fr
- public static Key[] generateNumKeys(Key mk, int num)
public static double sparseRatio(Chunk[] chks)
chks
- public static double sparseRatio(Frame fr)
public static void cleanUp(IcedHashMap<Key,java.lang.String> toDelete)
public static void shrinkDomainsToObservedSubset(Frame frameToModifyInPlace)
frameToModifyInPlace
- public static void delete(Lockable... frs)
public static void labelRows(Frame frame, java.lang.String labelColumnName)
frame
- Frame to labellabelColumnName
- Name of the label columnpublic static Frame encodeBetaConstraints(Key key, java.lang.String[] coefNames, java.lang.String[] coefOriginalNames, Frame betaConstraints)