Example #1
0
 /// <summary>
 /// Obtains all instances available in the ARFF file asynchronously
 /// </summary>
 /// <returns>An enumeration of all <see cref="Instance"/> elements</returns>
 public override async Task <IEnumerable <Instance> > DeserializeInstancesAsync()
 {
     if (await ReadFromPathAsync())
     {
         using ARFFReader reader = new ARFFReader(Content);
         return(reader.ReadAllInstances());
     }
     else
     {
         return(new Instance[0]);
     }
 }
Example #2
0
 /// <summary>
 /// Obtains a definition for a <see cref="Dataset"/> from an ARFF file asynchronously
 /// </summary>
 /// <returns>A <see cref="Dataset"/> definition (may include all <see cref="Instance"/> elements)</returns>
 public override async Task <Dataset> DeserializeDatasetAsync()
 {
     if (await ReadFromPathAsync())
     {
         using ARFFReader reader = new ARFFReader(Content);
         return(reader.ReadDataset());
     }
     else
     {
         return(new Dataset(new Header("Unknown", new Feature[0]), new Instance[0]));
     }
 }
Example #3
0
 /// <summary>
 /// Obtains all instances available in the ARFF file
 /// </summary>
 /// <returns>An enumeration of all <see cref="Instance"/> elements</returns>
 public override IEnumerable <Instance> DeserializeInstances()
 {
     if (ReadFromPath())
     {
         using ARFFReader reader = new ARFFReader(Content);
         return(reader.ReadAllInstances());
     }
     else
     {
         return(new Instance[0]);
     }
 }
Example #4
0
 /// <summary>
 /// Obtains a definition for a <see cref="Dataset"/> from an ARFF file
 /// </summary>
 /// <returns>A <see cref="Dataset"/> definition (may include all <see cref="Instance"/> elements)</returns>
 public override Dataset DeserializeDataset()
 {
     if (ReadFromPath())
     {
         using ARFFReader reader = new ARFFReader(Content);
         return(reader.ReadDataset());
     }
     else
     {
         return(new Dataset(new Header("Unknown", new Feature[0]), new Instance[0]));
     }
 }