コード例 #1
0
        public string GetSamplesAsString()
        {
            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < this.Samples.Count; i++)
            {
                TrainingSample current = this.Samples[i];

                sb.AppendLine(string.Join(",", current.Samples));
            }

            return(sb.ToString());
        }
コード例 #2
0
 public void AddSample(TrainingSample sample)
 {
     if (this.m_canAddSample)
     {
         if (!this.Samples.Contains(sample))
         {
             this.Samples.Add(sample);
         }
         else
         {
             throw new Exception("Already contains value");
         }
     }
     else
     {
         throw new Exception("Training set was locked");
     }
 }