Beispiel #1
0
        // FIXED LENGTH
        private void CreateFixedLengthOptions(string[][] data, List <RecordFormatInfo> res)
        {
            var format = new RecordFormatInfo();
            var stats  = Indicators.CalculateAsFixedSize(data);

            format.mConfidence = (int)(Math.Max(0, 1 - stats.Deviation / stats.Avg) * 100);

            var builder = new FixedLengthClassBuilder("AutoDetectedClass");

            CreateFixedLengthFields(data, builder);

            format.mClassBuilder = builder;

            res.Add(format);
        }
Beispiel #2
0
        // UNKNOWN
        private void CreateMixedOptions(string[][] data, List <RecordFormatInfo> res)
        {
            var stats = Indicators.CalculateAsFixedSize(data);

            if (stats.Deviation / stats.Avg <= FixedLengthDeviationTolerance * Math.Min(1, NumberOfLines(data) / MinSampleData))
            {
                CreateFixedLengthOptions(data, res);
            }

            CreateDelimiterOptions(data, res);

            //if (deviation > average * 0.01 &&
            //    deviation < average * 0.05)
            //    CreateFixedLengthOptions(data, res);
        }