AForge.Genetic.TimeSeriesPredictionFitness.TimeSeriesPredictionFitness C# (CSharp) Метод

TimeSeriesPredictionFitness() публичный Метод

Initializes a new instance of the TimeSeriesPredictionFitness class.

The data parameter is a one dimensional array, which defines times series to predict. The amount of learning samples is equal to the number of samples in the provided time series, minus window size, minus prediction size.

The predictionSize parameter specifies the amount of samples, which should be excluded from training set. This set of samples may be used for future verification of the prediction model.

The constants parameter is an array of constants, which can be used as additional variables for a genetic expression. The actual amount of variables for genetic expression equals to the amount of constants plus the window size.

public TimeSeriesPredictionFitness ( double data, int windowSize, int predictionSize, double constants ) : System
data double Time series to be predicted.
windowSize int Window size - number of past samples used /// to predict future value.
predictionSize int Prediction size - number of values to be predicted. These /// values are excluded from training set.
constants double Array of constants to be used as additional /// paramters for genetic expression.
Результат System
		public TimeSeriesPredictionFitness( double[] data, int windowSize, int predictionSize, double[] constants )
		{
			// check for correct parameters
			if ( windowSize >= data.Length )
				throw new ArgumentException( "Window size should be less then data amount" );
			if ( data.Length - windowSize - predictionSize < 1 )
				throw new ArgumentException( "Data size should be enough for window and prediction" );
			// save parameters
			this.data			= data;
			this.windowSize		= windowSize;
			this.predictionSize	= predictionSize;
			// copy constants
			variables = new double[constants.Length + windowSize];
			Array.Copy( constants, 0, variables, windowSize, constants.Length );
		}