Пример #1
0
        public void PopulateDescriptiveStatistics(PlottableProperty plottableProperty)
        {
            var plottableValues = Array.ConvertAll(SampleInstances[plottableProperty.PropertyName].ToArray(), input => Convert.ToDouble(input));

            if (plottableValues.Count() != 0)
            {
                PopulateBins(plottableValues, _numberBins, plottableProperty.PropertyName);
                Descriptive descriptiveStats = new Descriptive(plottableValues);
                descriptiveStats.Analyze();
                Statistics     = descriptiveStats.Result;
                StatisticsList = new ObservableCollection <KeyValuePair <string, string> >(PlottingUtilities.GetFieldAndPropertyValueList(descriptiveStats.Result));
            }
        }
        public void PopulateDescriptiveStatistics(PlottableProperty plottableProperty)
        {
            var plottableValues = SampleInstances.Select(i => new PlottableValue <T> {
                X = SampleInstances.IndexOf(i), Value = i
            }).ToList();
            var plottablePoints = PlottingUtilities.ToPlottable <T>(plottableValues, plottableProperty).Select(p => p.Y).ToArray();

            if (plottablePoints.Count() != 0)
            {
                PopulateBins(plottablePoints, _numberBins, plottableProperty.PropertyName);
                Descriptive descriptiveStats = new Descriptive(plottablePoints);
                descriptiveStats.Analyze();
                Statistics     = descriptiveStats.Result;
                StatisticsList = new ObservableCollection <KeyValuePair <string, string> >(PlottingUtilities.GetFieldAndPropertyValueList(descriptiveStats.Result));
            }
        }