public void Predict_PredictionRequestWithoutParameters_Null() { var predictor = new SearchBasedPredictor(null); var model = (HiddenMarkovModelMixtureDistribution)HiddenMarkovModelFactory.GetModel(new ModelCreationParameters <Mixture <IMultivariateDistribution> >() { NumberOfComponents = _NumberOfComponents, NumberOfStates = _NumberOfStates }); var request = new SearchBasedPredictionRequest(); var value = predictor.Predict(model, request); Assert.IsNull(value); }
public void Predict_PredictionRequestWihtoutNumberOfSamplePoints_Null() { var predictor = new SearchBasedPredictor(null); var model = (HiddenMarkovModelMixtureDistribution)HiddenMarkovModelFactory.GetModel(new ModelCreationParameters <Mixture <IMultivariateDistribution> >() { NumberOfComponents = _NumberOfComponents, NumberOfStates = _NumberOfStates }); var request = new SearchBasedPredictionRequest(); request.AlgorithmSpecificParameters = new Dictionary <string, string>(); var value = predictor.Predict(model, request); Assert.IsNull(value); }
public void Predict_ModelAndPredictionRequest_PredictedValue() { var util = new TestDataUtils(); var series = util.GetSvcData(util.FTSEFilePath, new DateTime(2010, 12, 18), new DateTime(2011, 12, 18)); var model = (HiddenMarkovModelMixtureDistribution)HiddenMarkovModelFactory.GetModel(new ModelCreationParameters <Mixture <IMultivariateDistribution> >() { NumberOfComponents = _NumberOfComponents, NumberOfStates = _NumberOfStates }); model.Normalized = true; model.Train(series, _NumberOfIterations, _LikelihoodTolerance); var request = new SearchBasedPredictionRequest(); request.TrainingSet = series; request.NumberOfDays = 1; var predictor = new SearchBasedPredictor(null); var value = predictor.Predict(model, request); Assert.AreEqual(0, value); }