Esempio n. 1
0
        void _Add(IColumn column, int index)
        {
            var type = column.Type;

            if (!_invalidColumnType.Contains(type))
            {
                if (ColumnTypeClassifier.IsNumeric(column))
                {
                    _column.Add(new NumberCollector(index));
                }
                else if (type == ColumnType.String)
                {
                    _column.Add(new StringCollector(index));
                }
                else if (type == ColumnType.IndexList || type == ColumnType.WeightedIndexList)
                {
                    _column.Add(new IndexCollector(index));
                }
                else if (type == ColumnType.Date)
                {
                    _column.Add(new DateCollector(index));
                }
                else if (type == ColumnType.Vector || type == ColumnType.Matrix || type == ColumnType.Tensor)
                {
                    _column.Add(new DimensionCollector(index));
                }
                else if (ColumnTypeClassifier.IsCategorical(column))
                {
                    _column.Add(new FrequencyCollector(index));
                }
            }
        }
Esempio n. 2
0
 public TableInfo(IDataTable table)
 {
     _classColumnIndex = table.TargetColumnIndex;
     for (int i = 0, len = table.ColumnCount; i < len; i++) {
         if (i != _classColumnIndex) {
             var column = table.Columns[i];
             if (column.IsContinuous)
                 _continuous.Add(i);
             else if (ColumnTypeClassifier.IsCategorical(column))
                 _categorical.Add(i);
         }
     }
     table.ForEach(row => _data.Add(new InMemoryRow(row, _categorical, _continuous, _classColumnIndex)));
 }
Esempio n. 3
0
            public FrequencyAnalysis(IDataTable table, int ignoreColumnIndex = -1)
            {
                int index = 0;

                foreach (var item in table.Columns)
                {
                    if (index != ignoreColumnIndex)
                    {
                        if (item.IsContinuous)
                        {
                            _column.Add(new NumberCollector(index));
                        }
                        else if (ColumnTypeClassifier.IsCategorical(item))
                        {
                            _column.Add(new FrequencyCollector(index));
                        }
                    }
                    ++index;
                }
            }