public void ShouldConvertAlleLettersToAppropriateValues() { var input = Helpers.GenerateAllNumberValuesForLetters(); var output = OutputConverter.Convert(input); Assert.AreEqual(Helpers.GenerateAllLetters(), output); }
public void ShouldConvertUpperCaseAToAppropriateValue() { var input = new[] { 27 }; var output = OutputConverter.Convert(input); Assert.AreEqual("A", output); }
public void ShouldConvertNumberToProperValue() { var input = new [] { 1 }; var output = OutputConverter.Convert(input); Assert.AreEqual("a", output); }
private void showDataComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (showItemComboBox != null) { String selectedValue = (String)showDataComboBox.SelectedValue; DataItem.DataTypes selectedDataType = DataItem.DataTypes.None; switch (selectedValue) { case "Uczące": selectedDataType = DataItem.DataTypes.Learning; break; case "Walidujące": selectedDataType = DataItem.DataTypes.Validate; break; case "Testowe": selectedDataType = DataItem.DataTypes.Testing; break; } showItemComboBox.Items.Clear(); for (int i = 0; i < dataHolder.Items.Count; i++) { if (dataHolder.Items[i].dataType == selectedDataType) { showItemComboBox.Items.Add( new ComboBoxItem() { Content = outputConverter.Convert(dataHolder.Items[i].Outputs).ToString(), Tag = i } ); } } showItemComboBox.SelectedIndex = 0; } }
public void Test(DataItem dataItem) { PatternOutputs = dataItem.Outputs; neuralNetwork.SetInputs(dataItem.Inputs); neuralNetwork.Propagate(); NetworkOutputs = neuralNetwork.GetOutputs(); ExpectedValue = outputConverter.Convert(PatternOutputs); ReceivedValue = outputConverter.GetMostProbablyValue(NetworkOutputs); Probability = outputConverter.GetProbability(NetworkOutputs, PatternOutputs); }
public void ShouldThrowErrorForInvalidInput() { var input = new[] { 0 }; Assert.Throws <ArgumentException>(() => OutputConverter.Convert(input)); }