Package uk.org.ogsadai.activity.io

Examples of uk.org.ogsadai.activity.io.FullListTupleListIterator


    /**
     * {@inheritDoc}
     */
  protected void processIteration() throws ActivityProcessingException,
      ActivityTerminatedException, ActivityUserException {
    FullListTupleListIterator items = new FullListTupleListIterator(INPUT_ITEMS, mItems);
    TupleListIterator customers = new FullListTupleListIterator(INPUT_TRANSACTIONS, mTransactions);
    Integer keyIndex= getKeyIndex();
   
    TupleMetadata metadata = prepareMetadata(items);
   
   
View Full Code Here


    /**
     * {@inheritDoc}
     */
  protected void processIteration() throws ActivityProcessingException,
      ActivityTerminatedException, ActivityUserException {
    FullListTupleListIterator items = new FullListTupleListIterator(INPUT_ITEM_LIST, mItemList);
    TupleListIterator customers = new FullListTupleListIterator(INPUT_CUSTOMERS_LIST, mCustomerList);
    Integer keyIndex= getKeyIndex();
   
    TupleMetadata metadata = prepareMetadata(items);
    Set<Entry<Integer, String[]>> set = prepareList(customers, metadata, keyIndex, 1);
   
View Full Code Here

        {
            iterativeStageComplete();
            return;
        }
        LOG.debug("Started BuildClassifier");
        TupleListIterator tuples = new FullListTupleListIterator(INPUT_DATA, mDataInput);
        TupleMetadata metadata = (TupleMetadata)tuples.getMetadataWrapper().getMetadata();
        int classIndex = getClassIndex(classIndexBlock, metadata);
        Map<Integer, List<Object>> nominalValues = getNominalValues(metadata);
        Instances dataset = WekaUtilities.createClassificationDataset(tuples, classIndex, nominalValues);
        String options;
        if(mOptionsInput != null)
View Full Code Here

            iterativeStageComplete();
            return;
        }
        LOG.debug("Started BuildIterationalClassifier");
        Map<Integer, List<Object>> nominalValues = getNominalValues();
        TupleListIterator tuples = new FullListTupleListIterator(INPUT_DATA, mDataInput);
        TupleMetadata metadata = (TupleMetadata)tuples.getMetadataWrapper().getMetadata();
      columns = "Trained on: [";
      for(int i=0; i<metadata.getColumnCount();i++)
        columns += metadata.getColumnMetadata(i).getName() + " ";
     
      columns += "]\n";
        Instances dataset = WekaUtilities.createEmptyDataset(metadata, classIndex, nominalValues);
        if(mOptionsInput != null)
          description = TupleUtilities.getString(readBlock(mDescriptionInput), INPUT_DESCRIPTION);
        else
          description = "";
         
       
        HoeffdingTree tree = new HoeffdingTree();
        String options;
        try
        {
        if(mOptionsInput != null)
          options = TupleUtilities.getMoaOptions(readBlock(mOptionsInput));
        else
          options = DEFAULT_OPTIONS;
         
        }
        catch (Exception e)
        {
            throw new ActivityUserException(e);
        }
        try
        {
          Tuple tuple;
       
          tree.getOptions().setViaCLIString(options);
          tree.prepareForUse();
          Calendar cal = Calendar.getInstance();
          this.startTime = cal.getTimeInMillis();
          if(mSummaryOutput != null) {
           
              mSummaryOutput.write(ControlBlock.LIST_BEGIN);
            }
          while((tuple = (Tuple)tuples.nextValue()) != null && tuple != ControlBlock.LIST_END) {
            Instance inst = WekaUtilities.createInstance(dataset, tuple);
            tree.trainOnInstance(inst);
            if(stepCounter == 0) {

                  writeOutput(new TupleClassifier(tree, WekaUtilities.getAttributes(dataset), classIndex));                                        
View Full Code Here

            iterativeStageComplete();
            return;
        }
        LOG.debug("Started BuildIterationalClassifier");
        Map<Integer, List<Object>> nominalValues = getNominalValues();
        TupleListIterator tuples = new FullListTupleListIterator(INPUT_DATA, mDataInput);
        TupleMetadata metadata = (TupleMetadata)tuples.getMetadataWrapper().getMetadata();
      columns = "Trained on: [";
      for(int i=0; i<metadata.getColumnCount();i++)
        columns += metadata.getColumnMetadata(i).getName() + " ";
     
      columns += "]\n";
        Instances dataset = WekaUtilities.createEmptyDataset(metadata, classIndex, nominalValues);
        if(mDescriptionInput != null)
          description = TupleUtilities.getString(readBlock(mDescriptionInput), INPUT_DESCRIPTION);
        else
          description = "";
         
       
        HoeffdingTree tree = new HoeffdingTree();
        String options;
        try
        {
        if(mOptionsInput != null)
          options = TupleUtilities.getMoaOptions(readBlock(mOptionsInput));
        else
          options = DEFAULT_OPTIONS;
         
        }
        catch (Exception e)
        {
            throw new ActivityUserException(e);
        }
        try
        {
          Tuple tuple;
       
          tree.getOptions().setViaCLIString(options);
          tree.prepareForUse();
          Calendar cal = Calendar.getInstance();
          this.startTime = cal.getTimeInMillis();

          while((tuple = (Tuple)tuples.nextValue()) != null && tuple != ControlBlock.LIST_END) {
            Instance inst = WekaUtilities.createInstance(dataset, tuple);
            tree.trainOnInstance(inst);
            if(stepCounter == 0) {

                  writeOutput(new TupleClassifier(tree, WekaUtilities.getAttributes(dataset), classIndex));                                        
View Full Code Here

TOP

Related Classes of uk.org.ogsadai.activity.io.FullListTupleListIterator

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.