Package uk.org.ogsadai.tuple

Examples of uk.org.ogsadai.tuple.ColumnMetadata


            (TupleMetadata)mTupleList.getMetadataWrapper().getMetadata();
        columnCount = metadata.getColumnCount();
        colInfo = new ColInfo[columnCount];
        for(int i=0; i<columnCount; i++)
        {
            ColumnMetadata column = metadata.getColumnMetadata(i);
            colInfo[i] = new ColInfo();
            colInfo[i].setName(column.getName());
            colInfo[i].setDisplayName("");
            colInfo[i].setOpType("");
            colInfo[i].setDataType(
                    mapSQLTypeToPMMLType(column.getType()));
        }
       
        //init statistics values
        totalFreq = new int[columnCount];
        missingData = new int[columnCount];               
View Full Code Here


  }

  private MetadataWrapper prepareMetadata(TupleListIterator tuples) throws ActivityUserException, ActivityProcessingException, ActivityTerminatedException {
        TupleMetadata prevMetadata = (TupleMetadata)tuples.getMetadataWrapper().getMetadata();
        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
        ColumnMetadata column = new SimpleColumnMetadata(prevMetadata.getColumnMetadata(0).getName(), TupleTypes._STRING, 0, 0, 0);
        columns.add(column);
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
    return new MetadataWrapper(metadata);
  }
View Full Code Here

            (TupleMetadata)tuples.getMetadataWrapper().getMetadata();
        try
        {
          boolean isNumeric = classifiers.get(0).classifier.classIsNumeric();
            mOutput.write(ControlBlock.LIST_BEGIN);
            ColumnMetadata column;
            if (isNumeric)
            {
                column = new SimpleColumnMetadata("class", TupleTypes._DOUBLE, 0, 0, 0);               
            }
            else
View Full Code Here

    public void testSimple() throws Exception
    {
       
        MockInputPipe inputSize = new MockInputPipe(2);
       
        ColumnMetadata colA = new SimpleColumnMetadata("A", TupleTypes._STRING, 0, 0, 0);
        ColumnMetadata colB = new SimpleColumnMetadata("B", TupleTypes._DOUBLE, 0, 0, 0);
        TupleMetadata metadata = new SimpleTupleMetadata(Arrays.asList(colA, colB));
        Tuple tuple1 = new SimpleTuple(Arrays.<Object>asList("Amy", 0));
        Tuple tuple2 = new SimpleTuple(Arrays.<Object>asList("Ally", 1.0));
        Tuple tuple3 = new SimpleTuple(Arrays.<Object>asList("Radek", 2.0));
        Tuple tuple4 = new SimpleTuple(Arrays.<Object>asList("Adrian", 3.0));
View Full Code Here

    public void testSimple() throws Exception
    {
       
        MockInputPipe inputTemplate = new MockInputPipe("Hello $REPLACE(A)$, hello $REPLACE(B)$!");
       
        ColumnMetadata colA = new SimpleColumnMetadata("A", TupleTypes._STRING, 0, 0, 0);
        ColumnMetadata colB = new SimpleColumnMetadata("B", TupleTypes._DOUBLE, 0, 0, 0);
        TupleMetadata metadata = new SimpleTupleMetadata(Arrays.asList(colA, colB));
        Tuple tuple1 = new SimpleTuple(Arrays.<Object>asList("Amy", 0));
        Tuple tuple2 = new SimpleTuple(Arrays.<Object>asList("Ally", 1.0));
        Tuple tuple3 = new SimpleTuple(Arrays.<Object>asList("Radek", 2.0));
        MockInputPipe inputData = new MockInputPipe(new Object[] {
View Full Code Here

    public void testUnknownColumn() throws Exception
    {
       
        MockInputPipe inputTemplate = new MockInputPipe("Hello $REPLACE(A)$, hello $REPLACE(B)$!");
       
        ColumnMetadata colA = new SimpleColumnMetadata("A", TupleTypes._STRING, 0, 0, 0);
        TupleMetadata metadata = new SimpleTupleMetadata(Arrays.asList(colA));
        Tuple tuple1 = new SimpleTuple(Arrays.<Object>asList("Amy", 0));
        Tuple tuple2 = new SimpleTuple(Arrays.<Object>asList("Ally", 1.0));
        Tuple tuple3 = new SimpleTuple(Arrays.<Object>asList("Radek", 2.0));
        MockInputPipe inputData = new MockInputPipe(new Object[] {
View Full Code Here

    public void configure(TupleMetadata metadata)
            throws UnsupportedOperandTypeException
    {
        mChild1.configure(metadata);
        mChild2.configure(metadata);
        ColumnMetadata col1 = mChild1.getMetadata();
        ColumnMetadata col2 = mChild2.getMetadata();
        int type = BinaryExpressionHelper.getType(col1.getType(), col2.getType());
        mType = new SimpleColumnMetadata(
                null,
                type,
                getPrecision(col1.getPrecision(), col2.getPrecision()),
                isNullable(col1.isNullable(), col2.isNullable()),
                0);
        mEval = NumericEvaluators.getEvaluator(type);
    }
View Full Code Here

    private TupleMetadata getMeanMetadata(Mean[] calc)
    {
        List<ColumnMetadata> cols = new ArrayList<ColumnMetadata>();
        for (int i = 0; i < calc.length; i++)
        {
            ColumnMetadata column =
                new SimpleColumnMetadata(
                        calc[i].getName(),
                        calc[i].getType(),
                        0,
                        ColumnMetadata.COLUMN_NULLABLE,
View Full Code Here

   
    public void testClassifyDates() throws Exception
    {
        // create simple table
        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
        ColumnMetadata column = new SimpleColumnMetadata("class", TupleTypes._STRING, 0, 0, 0);
        columns.add(column);
        column = new SimpleColumnMetadata("date", TupleTypes._DATE, 0, 0, 0);
        columns.add(column);
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
        List<Object> table = new ArrayList<Object>();
View Full Code Here

   
    public void testClassifyNumericClass() throws Exception
    {
        // create simple table
        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
        ColumnMetadata column = new SimpleColumnMetadata("class", TupleTypes._DOUBLE, 0, 0, 0);
        columns.add(column);
        column = new SimpleColumnMetadata("attribute", TupleTypes._INT, 0, 0, 0);
        columns.add(column);
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
        List<Object> table = new ArrayList<Object>();
View Full Code Here

TOP

Related Classes of uk.org.ogsadai.tuple.ColumnMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.