- Hands-On Neural Network Programming with C#
- Matt R. Cole
- 58字
- 2025-02-24 05:32:27
Importing datasets
The following is how we our datasets:
public static List<DataSet>ImportDatasets()
{
var dialog = new OpenFileDialog
{
Multiselect = false,
Title = "Open Dataset File",
Filter = "Text File|*.txt;"
};
using (dialog)
{
if (dialog.ShowDialog() != DialogResult.OK)
return null;
using (var file = File.OpenText(dialog.FileName))
{
Deserialize the data and return it:
return JsonConvert.DeserializeObject<List<DataSet>>(file.ReadToEnd());
}
}
}