Ejemplo n.º 1
0
        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));
            }
        }
Ejemplo n.º 2
0
        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));
            }
        }
Ejemplo n.º 3
0
 public double getDataByAttribute(FuzzyAttributeLabel attributeLabel, int row)
 {
     return((double)this.table.Rows[row][attributeLabel.Id]);
 }