Package uk.org.ogsadai.tuple

Examples of uk.org.ogsadai.tuple.TupleMetadata


        for (int i=0; i<columnCount; i++)
        {
            ColumnMetadata col = new SimpleColumnMetadata("", TupleTypes._DOUBLE, 0,0,0);
            columns.add(col);
        }
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
        return new MetadataWrapper(metadata);
      
    }
View Full Code Here


    }
   
    public void testSimple() throws Exception
    {
        ColumnMetadata col = new SimpleColumnMetadata("class", TupleTypes._STRING, 0,0,0);
        TupleMetadata metadata = new SimpleTupleMetadata(Collections.singletonList(col));
        MockInputPipe inputExpected = new MockInputPipe(new Object[] {
            ControlBlock.LIST_BEGIN,
            new MetadataWrapper(metadata),
            new SimpleTuple(Arrays.asList("yes")),
            new SimpleTuple(Arrays.asList("no")),
View Full Code Here

    }

    public void testUnmatched() throws Exception
    {
        ColumnMetadata col = new SimpleColumnMetadata("class", TupleTypes._STRING, 0,0,0);
        TupleMetadata metadata = new SimpleTupleMetadata(Collections.singletonList(col));
        MockInputPipe inputExpected = new MockInputPipe(new Object[] {
            ControlBlock.LIST_BEGIN,
            new MetadataWrapper(metadata),
            new SimpleTuple(Arrays.asList("yes")),
            new SimpleTuple(Arrays.asList("no")),
View Full Code Here

        columns.add(col);
        col = new SimpleColumnMetadata("D", TupleTypes._DOUBLE, 0,0,0);
        columns.add(col);
        col = new SimpleColumnMetadata("E", TupleTypes._DOUBLE, 0,0,0);
        columns.add(col);
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
        return metadata;
    }
View Full Code Here

    //}
    //String fileName = file;
     
    TupleListIterator tupleListIterator = (TupleListIterator) iterationData[1];
      MetadataWrapper metadataWrapper = tupleListIterator.getMetadataWrapper();
      TupleMetadata tupleMetadata = (TupleMetadata) metadataWrapper.getMetadata();
      Tuple tuple;
    try {
     
     mOutputBlockWriter = getOutput(OUTPUT_DATA);
       BlockWriter meanOut = getOutput(MEAN);
View Full Code Here

      {
        try{
          mOutput.write(ControlBlock.LIST_BEGIN);
          ColumnMetadata columnMetadata = new SimpleColumnMetadata
          (columnName, TupleTypes._INT, 0, ColumnMetadata.COLUMN_NO_NULLS, 0);
          TupleMetadata tupleMetadata =
            new SimpleTupleMetadata(Collections.singletonList(columnMetadata));
          MetadataWrapper metadataWrapper = new MetadataWrapper(tupleMetadata);
          mOutput.write(metadataWrapper);
        }
        catch (PipeClosedException e)
View Full Code Here

         
          try{
              mOutput.write(ControlBlock.LIST_BEGIN);
              ColumnMetadata columnMetadata = new SimpleColumnMetadata
                  (name, type, 0, ColumnMetadata.COLUMN_NO_NULLS, 0);
              TupleMetadata tupleMetadata =
                  new SimpleTupleMetadata(Collections.singletonList(columnMetadata));
              MetadataWrapper metadataWrapper = new MetadataWrapper(tupleMetadata);
              mOutput.write(metadataWrapper);
          }   catch (PipeClosedException e)
            {
View Full Code Here

        LOG.debug("Sample repeate = " + sampleRepeat);
       
       
        MetadataWrapper metadataWrapper = tuples.getMetadataWrapper();
       
        TupleMetadata metadata =
            (TupleMetadata)metadataWrapper.getMetadata();
       
        Tuple[] sampleTuples = new Tuple[sampleSize];
       
View Full Code Here

        throws ColumnNotFoundException,
               IOException,
               UnsupportedTupleTypeException,
               UndefinedTupleTypeException
    {
        TupleMetadata metadata;
        if (type == null || type == AnySType.INSTANCE)
        {
            metadata = constructMetadataFromValue(literals);
        }
        else
        {
            metadata = constructMetadataFromType(type);
        }
        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
        TupleOutputStream output = new TupleOutputStream(bytes);
        output.writeMetadata(metadata);
        for (int i=1; i<literals.size()-1; i++)
        {
            Map<String, Object> map = (Map<String, Object>) literals.get(i);
            List<Object> elements = new ArrayList<Object>(map.size());
            for (int c=0; c<metadata.getColumnCount(); c++)
            {
                Object value = map.get(metadata.getColumnMetadata(c).getName());
                if (value == null)
                {
                    value = Null.VALUE;
                }
                elements.add(value);
View Full Code Here

            throws ActivityProcessingException, ActivityTerminatedException,
            ActivityUserException
    {

        TupleListIterator tuples = (TupleListIterator)iterationInputs[0];
        TupleMetadata metadata = (TupleMetadata)tuples.getMetadataWrapper().getMetadata();
        Map<Integer, List<Object>> nominalValues =
            getNominalValues(iterationInputs, metadata);
        Instances dataset = WekaUtilities.createAssociationDataset(tuples, nominalValues);
        String options = TupleUtilities.getAsString(iterationInputs[1], INPUT_OPTIONS);
        String algorithmClass = TupleUtilities.getAsString(iterationInputs[2], INPUT_ALGORITHM_CLASS);
View Full Code Here

TOP

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

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.