示例#1
0
        public void ShouldThrowNullArgumentException()
        {
            const string text = null;

            var strategy = new NormalizationStrategy();

            Assert.Throws <ArgumentNullException>(() => strategy.Translate(text));
        }
示例#2
0
        public void ShouldNormalize(string value, string expectation)
        {
            var strategy = new NormalizationStrategy();

            var translated = strategy.Translate(value);

            Assert.Equal(expectation, translated);
        }
示例#3
0
        public WLCTool(DataTable dataTable, ToolParameterContainer toolParameterContainer)
        {
            _backupDataTable = dataTable.Copy();

            _workingDataTable = _backupDataTable;

            this._toolParameterContainer = toolParameterContainer;

            _transformationStrategy = Model.NormalizationStrategy.MaximumScoreNormalizationStrategy;
        }
示例#4
0
        public Cluster(int featureId, IList <int> clusterIDs, DataTable dt, ToolParameterContainer toolParameterContainer, NormalizationStrategy transformationStrategy)
        {
            _featureId  = featureId;
            _clusterIDs = clusterIDs;
            _dataTable  = dt;
            _enumerableRowCollection = _dataTable.AsEnumerable();
            _toolParameterContainer  = toolParameterContainer;
            _transformationStrategy  = transformationStrategy;

            //the feature id is also part of the cluster!
            _clusterIDs.Add(featureId);
        }
示例#5
0
        public static INormalizationStrategy GetStrategy(NormalizationStrategy transformationStrategy)
        {
            switch (transformationStrategy)
            {
            case NormalizationStrategy.MaximumScoreNormalizationStrategy:
                return(new MaximumScoreNormalizationStrategy());

            case NormalizationStrategy.ScoreRangeNormalizationStrategy:
                return(new ScoreRangeNormalizationStrategy());

            case NormalizationStrategy.IdentityNormalizationStrategy:
                return(new IdentityNormalizationStrategy());

            case NormalizationStrategy.DefaultNormalizationStrategy:
                return(new MaximumScoreNormalizationStrategy());

            default:
                return(new MaximumScoreNormalizationStrategy());
            }
        }