public void addClassAttribute(dynamic item, string positiveAttribute, string negativeAttribute) { // convert jsonmvalues to string var labels = new FuzzyAttributeLabel[item.labels.Count]; var idIndex = this.table.Columns.Count; for (int i = 0; i < item.labels.Count; i++) { labels[i] = new FuzzyAttributeLabel(item.labels[i].ToString(), (idIndex + i).ToString()); } var attr = new FuzzyAttribute(item.name.ToString(), labels); foreach (var label in labels) { if (label.Name == positiveAttribute) { this.PositiveColumn = label; } if (label.Name == negativeAttribute) { this.NegativeColumn = label; } } this.classAttribute = attr; foreach (var label in labels) { this.table.Columns.Add(label.Id.ToString(), typeof(double)); } }
public void addAttribute(dynamic item) { // convert jsonmvalues to string var labels = new FuzzyAttributeLabel[item.labels.Count]; var idIndex = this.table.Columns.Count; for (int i = 0; i < item.labels.Count; i++) { labels[i] = new FuzzyAttributeLabel(item.labels[i].ToString(), (idIndex + i).ToString()); } var attr = new FuzzyAttribute(item.name.ToString(), labels); this.attributes.Add(item.name.ToString(), attr); foreach (var label in labels) { this.table.Columns.Add(label.Id.ToString(), typeof(double)); } }
public FuzzyTable() { this.table = new DataTable(); this.attributes = new Dictionary <string, FuzzyAttribute>(); this.classAttribute = null; }