//private bool[] marked; public DataSet(String filename) { rows = new DataRow[10]; capacity = 10; size = 0; StreamReader reader = new StreamReader(filename); String input = reader.ReadLine(); attribs = new AttributeSet((uint) input.Split(',').Length-1); classes= new ClassificationSet(); //marked = new bool[attribs.getLength()]; //for(uint x=0; x < marked.Length; x++) //{ marked[x] = false; } while(input != null) { if(size == capacity) { growRowsByTen();} rows[size++] = new DataRow(input, attribs, classes); input = reader.ReadLine(); } }
public DataSet(uint attrs) { rows = new DataRow[10]; capacity = 10; size = 0; attribs = new AttributeSet(attrs); classes = new ClassificationSet(); //this.marked = marked; //this.marked[attrs] = true; //mark this }
public DataRow(String a, AttributeSet attrset, ClassificationSet classset) { string[] split = a.Split(','); data = new string[split.Length-1]; for(uint x=0; x < split.Length-1; x++) { data[x] = split[x]; attrset.addAttribute(x,split[x]); } correctclass = split[split.Length-1]; classset.addClassification(correctclass); }