Class DefaultDataFrame
java.lang.Object
org.opensearch.ml.common.dataframe.AbstractDataFrame
org.opensearch.ml.common.dataframe.DefaultDataFrame
- All Implemented Interfaces:
Iterable<Row>,org.opensearch.core.common.io.stream.Writeable,org.opensearch.core.xcontent.ToXContent,org.opensearch.core.xcontent.ToXContentObject,DataFrame
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
org.opensearch.core.xcontent.ToXContent.DelegatingMapParams, org.opensearch.core.xcontent.ToXContent.MapParams, org.opensearch.core.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.opensearch.core.common.io.stream.Writeable
org.opensearch.core.common.io.stream.Writeable.Reader<V>, org.opensearch.core.common.io.stream.Writeable.WriteableRegistry, org.opensearch.core.common.io.stream.Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionDefaultDataFrame(org.opensearch.core.common.io.stream.StreamInput streamInput) DefaultDataFrame(ColumnMeta[] columnMetas) DefaultDataFrame(ColumnMeta[] columnMetas, List<Row> rows) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new row given values array.voidAdd a new row given a Row dataGet the array of column metaintgetColumnIndex(String target) Find the index of the target in columnMetasgetRow(int index) Get Row data given index valueiterator()static DefaultDataFrameparse(org.opensearch.core.xcontent.XContentParser parser) remove(int columnIndex) Build a new DataFrame by removing one column based on indexselect(int[] columns) Build a new DataFrame given the input columnsintsize()Get the size of the data frame.toString()org.opensearch.core.xcontent.XContentBuildertoXContent(org.opensearch.core.xcontent.XContentBuilder builder) org.opensearch.core.xcontent.XContentBuildertoXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) voidwriteTo(org.opensearch.core.common.io.stream.StreamOutput out) Methods inherited from class org.opensearch.ml.common.dataframe.AbstractDataFrame
getDataFrameTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.opensearch.core.xcontent.ToXContentObject
isFragment
-
Constructor Details
-
DefaultDataFrame
-
DefaultDataFrame
-
DefaultDataFrame
public DefaultDataFrame(org.opensearch.core.common.io.stream.StreamInput streamInput) throws IOException - Throws:
IOException
-
-
Method Details
-
appendRow
Description copied from interface:DataFrameAdd a new row given values array.- Parameters:
values- input values
-
appendRow
Description copied from interface:DataFrameAdd a new row given a Row data- Parameters:
row- input row data
-
getRow
Description copied from interface:DataFrameGet Row data given index value- Parameters:
index- index value- Returns:
- row data
-
size
public int size()Description copied from interface:DataFrameGet the size of the data frame. This is the row size actually.- Returns:
- the size
-
columnMetas
Description copied from interface:DataFrameGet the array of column meta- Returns:
- array of ColumnMeta
-
remove
Description copied from interface:DataFrameBuild a new DataFrame by removing one column based on index- Parameters:
columnIndex- the index of column- Returns:
- new DataFrame
-
select
Description copied from interface:DataFrameBuild a new DataFrame given the input columns- Parameters:
columns- the indices of column- Returns:
- new DataFrame
-
getColumnIndex
Description copied from interface:DataFrameFind the index of the target in columnMetas- Parameters:
target- the string value of the target- Returns:
- column index of the target in the list of columnMetas
-
iterator
-
writeTo
- Specified by:
writeToin interfaceorg.opensearch.core.common.io.stream.Writeable- Overrides:
writeToin classAbstractDataFrame- Throws:
IOException
-
parse
public static DefaultDataFrame parse(org.opensearch.core.xcontent.XContentParser parser) throws IOException - Throws:
IOException
-
toXContent
public org.opensearch.core.xcontent.XContentBuilder toXContent(org.opensearch.core.xcontent.XContentBuilder builder) throws IOException - Throws:
IOException
-
toXContent
public org.opensearch.core.xcontent.XContentBuilder toXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException - Throws:
IOException
-
toString
-