예제 #1
0
        public async Task TrainSvm()
        {
            try
            {
                if (currentSet == null)
                {
                    throw new ArgumentNullException(nameof(currentSet));
                }

                IArffDataSet     dataSet = currentSet;
                MachineSentiment machine = await MachineSentiment.Train(dataSet, CancellationToken.None).ConfigureAwait(false);

                machine.Save(SvmPath);
                LoadSvm();
                log.LogInformation("SVM Training Completed...");
            }
            catch (Exception ex)
            {
                log.LogError(ex, "Error");
                throw;
            }
        }
예제 #2
0
 private void LoadSvm()
 {
     log.LogInformation("Loading SVM vectors...");
     Model = MachineSentiment.Load(SvmPath);
 }