public void Training_CreateModel_SaveToFile() { var modelFile = new DataFile(Path.Combine(Path.GetTempPath(), "model.dat")); Model model = CreateModel("trainingModel"); var client = new Client { Model = model, Measurement = new Measurement() }; client.Init(); var addMessageToHistory = new UserDefinedCommand(client, "message_to_history", "Add message to model history", "message=training"); var saveModelToFile = new UserDefinedCommand(client, "save_model_to_file", "Save model to file", String.Format("file={0}", modelFile.File)); model.Algorithm.AddCommand(addMessageToHistory); model.Algorithm.AddCommand(saveModelToFile); var algorithmExecutor = new AlgorithmExecuter(model); algorithmExecutor.Run(); Assert.AreEqual("training", model.History); }
public void AddPluginsBinary(DataFile pluginFile) { pluginCatalogs.Add(new DirectoryCatalog(Path.GetDirectoryName(pluginFile.File), Path.GetFileName(pluginFile.File))); }