public DataSet copy() { DataSet ds = new DataSet(specification); foreach (Example e in examples) { ds.add(e); } return(ds); }
public DataSet removeExample(Example e) { DataSet ds = new DataSet(specification); foreach (Example eg in examples) { if (!(e.Equals(eg))) { ds.add(eg); } } return ds; }
public DataSet removeExample(Example e) { DataSet ds = new DataSet(specification); foreach (Example eg in examples) { if (!(e.Equals(eg))) { ds.add(eg); } } return(ds); }
public DataSet matchingDataSet(String attributeName, String attributeValue) { DataSet ds = new DataSet(specification); foreach (Example e in examples) { if (e.getAttributeValueAsString(attributeName).Equals( attributeValue)) { ds.add(e); } } return(ds); }
public DataSet fromFile(String filename, DataSetSpecification spec, Char separator) { // assumed file in data directory and ends in .csv DataSet ds = new DataSet(spec); using (StreamReader reader = new StreamReader(typeof(DataSetFactory).Assembly.GetManifestResourceStream("AIMA.Resource." + filename))) { String line; while ((line = reader.ReadLine()) != null) { ds.add(exampleFromString(line, spec, separator)); } } return ds; }
public DataSet fromFile(String filename, DataSetSpecification spec, Char separator) { // assumed file in data directory and ends in .csv DataSet ds = new DataSet(spec); using (StreamReader reader = new StreamReader(typeof(DataSetFactory).Assembly.GetManifestResourceStream("AIMA.Resource." + filename))) { String line; while ((line = reader.ReadLine()) != null) { ds.add(exampleFromString(line, spec, separator)); } } return(ds); }
public Dictionary <String, DataSet> splitByAttribute(String attributeName) { Dictionary <String, DataSet> results = new Dictionary <String, DataSet>(); foreach (Example e in examples) { String val = e.getAttributeValueAsString(attributeName); if (results.ContainsKey(val)) { results[val].add(e); } else { DataSet ds = new DataSet(specification); ds.add(e); results.Add(val, ds); } } return(results); }
public Dictionary<String, DataSet> splitByAttribute(String attributeName) { Dictionary<String, DataSet> results = new Dictionary<String, DataSet>(); foreach (Example e in examples) { String val = e.getAttributeValueAsString(attributeName); if (results.ContainsKey(val)) { results[val].add(e); } else { DataSet ds = new DataSet(specification); ds.add(e); results.Add(val, ds); } } return results; }
public DataSet matchingDataSet(String attributeName, String attributeValue) { DataSet ds = new DataSet(specification); foreach (Example e in examples) { if (e.getAttributeValueAsString(attributeName).Equals( attributeValue)) { ds.add(e); } } return ds; }
public DataSet copy() { DataSet ds = new DataSet(specification); foreach (Example e in examples) { ds.add(e); } return ds; }