예제 #1
0
        protected override void PerformScaling()
        {
            _workingDataTable = _backupDataTable.Copy();

            foreach (var currentToolParameter in _toolParameterContainer.ToolParameter)
            {
                NormalizationStrategyFactory.GetStrategy(_transformationStrategy).Transform(_workingDataTable.Columns[currentToolParameter.ColumnName], currentToolParameter.IsBenefitCriterion);
            }
        }
예제 #2
0
        private IList <Tuple <IToolParameter, double?> > Scale(ToolParameterContainer toolParameterContainer, IList <Tuple <IToolParameter, double> > localRangeList)
        {
            IList <Tuple <IToolParameter, double?> > listOfScaledTuple = new List <Tuple <IToolParameter, double?> >();

            var oidColumnIndex = GetOIDColumnIndex();
            var clusterIDsRows = _enumerableRowCollection.Where(x => _clusterIDs.Contains(x.Field <FieldTypeOID>(oidColumnIndex).OID));
            var featureIDRow   = _enumerableRowCollection.Where(x => x.Field <FieldTypeOID>(oidColumnIndex).OID == _featureId);

            foreach (var currentToolParameter in toolParameterContainer.ToolParameter)
            {
                var currentLocalRange = localRangeList.FirstOrDefault(x => x.Item1 == currentToolParameter);

                IList <double> data = clusterIDsRows.Select(x => x.Field <double>(currentToolParameter.ColumnName)).Distinct().ToList();

                var actualValue = featureIDRow.Select(x => x.Field <double>(currentToolParameter.ColumnName)).FirstOrDefault();

                var result = NormalizationStrategyFactory.GetStrategy(_transformationStrategy).Transform(data, actualValue, currentToolParameter.IsBenefitCriterion);

                listOfScaledTuple.Add(Tuple.Create(currentToolParameter, result));
            }

            return(listOfScaledTuple);
        }