Search in sources :

Example 6 with DefaultDataFrame

use of org.opensearch.ml.common.dataframe.DefaultDataFrame in project ml-commons by opensearch-project.

the class SampleAlgoTest method constructDataFrame.

private DataFrame constructDataFrame(int dataSize) {
    ColumnMeta[] columnMetas = new ColumnMeta[] { new ColumnMeta("value", ColumnType.INTEGER) };
    DataFrame dataFrame = new DefaultDataFrame(columnMetas);
    for (int i = 0; i < dataSize; i++) {
        dataFrame.appendRow(new Object[] { i });
    }
    return dataFrame;
}
Also used : ColumnMeta(org.opensearch.ml.common.dataframe.ColumnMeta) DataFrame(org.opensearch.ml.common.dataframe.DataFrame) DefaultDataFrame(org.opensearch.ml.common.dataframe.DefaultDataFrame) DefaultDataFrame(org.opensearch.ml.common.dataframe.DefaultDataFrame)

Aggregations

ColumnMeta (org.opensearch.ml.common.dataframe.ColumnMeta)6 DataFrame (org.opensearch.ml.common.dataframe.DataFrame)6 DefaultDataFrame (org.opensearch.ml.common.dataframe.DefaultDataFrame)6 ArrayList (java.util.ArrayList)3 ColumnValue (org.opensearch.ml.common.dataframe.ColumnValue)3 Before (org.junit.Before)2 DoubleValue (org.opensearch.ml.common.dataframe.DoubleValue)2 Row (org.opensearch.ml.common.dataframe.Row)2 IntValue (org.opensearch.ml.common.dataframe.IntValue)1 Example (org.tribuo.Example)1 Feature (org.tribuo.Feature)1 Event (org.tribuo.anomaly.Event)1