MOA 12.03
Real Time Analytics for Data Streams
MultilabelArffFileStream.java
Go to the documentation of this file.
00001 /*
00002  *    MultilabelArffFileStream.java
00003  *    Copyright (C) 2010 University of Waikato, Hamilton, New Zealand
00004  *    @author Jesse Read (jmr30@cs.waikato.ac.nz)
00005  *
00006  *    This program is free software; you can redistribute it and/or modify
00007  *    it under the terms of the GNU General Public License as published by
00008  *    the Free Software Foundation; either version 3 of the License, or
00009  *    (at your option) any later version.
00010  *
00011  *    This program is distributed in the hope that it will be useful,
00012  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *    GNU General Public License for more details.
00015  *
00016  *    You should have received a copy of the GNU General Public License
00017  *    along with this program. If not, see <http://www.gnu.org/licenses/>.
00018  *    
00019  */
00020 package moa.streams.generators.multilabel;
00021 
00022 import moa.streams.ArffFileStream;
00023 import moa.core.InstancesHeader;
00024 import moa.core.MultilabelInstancesHeader;
00025 import moa.options.IntOption;
00026 
00033 public class MultilabelArffFileStream extends ArffFileStream {
00034 
00035     @Override
00036     public String getPurposeString() {
00037         return "A stream read from an ARFF file.";
00038     }
00039 
00040     private static final long serialVersionUID = 1L;
00041 
00042     public IntOption numLabelsOption = new IntOption("numLabels", 'l',
00043             "The number of labels. e.g. n = 10 : the first 10 binary attributes are the labels; n = -10 the last 10 binary attributes are the labels.", -1, -1, Integer.MAX_VALUE);
00044 
00045     public MultilabelArffFileStream() {
00046     }
00047 
00048     public MultilabelArffFileStream(String arffFileName, int numLabels) {
00049         this.arffFileOption.setValue(arffFileName);
00050         this.numLabelsOption.setValue(numLabels);
00051         restart();
00052     }
00053 
00054     @Override
00055     public InstancesHeader getHeader() {
00056         return new MultilabelInstancesHeader(this.instances, numLabelsOption.getValue());
00057     }
00058 }
 All Classes Namespaces Files Functions Variables Enumerations