Example #1
0
        /// <summary>
        /// Normalise the data points in this set according to a data normaliser.  If the data
        /// normaliser has not been fit to this set, that will be done automatically.
        /// </summary>
        /// <param name="dataNormaliser"></param>
        public void NormaliseBy(IDataNormaliser dataNormaliser)
        {
            if (!dataNormaliser.HasBeenFit())
            {
                dataNormaliser.Fit(this.GetWholeSet());
            }

            foreach (DataPoint dataPoint in GetWholeSet())
            {
                dataNormaliser.Normalise(dataPoint);
            }
        }
Example #2
0
        /// <summary>
        /// Denormalise the data points in this set according to a data normaliser.  If the data
        /// normaliser has not been fit, this will throw an error; it makes no sense to fit a model
        /// to data, then immediately denormalise them according to it.
        /// </summary>
        /// <param name="dataNormaliser"></param>
        public void DenormaliseBy(IDataNormaliser dataNormaliser)
        {
            if (!dataNormaliser.HasBeenFit())
            {
                throw new OperationCanceledException(
                          "Cannot denormalise data according to a normaliser that has not been fit.");
            }

            foreach (DataPoint dataPoint in GetWholeSet())
            {
                dataNormaliser.Denormalise(dataPoint);
            }
        }