打开: visual studio 2019  下载机器学习模块

.NET ML 机器学习上手

在 工具->选项->环境-> 新特性中选用 ML

在解决方案管理器中, 添加ML项目.

选择使用场景,进行数据分析 scenario.

.NET ML 机器学习上手

提供相关数据集, 并开始训练

对模型进行评分evaluation

建立耗损模型

Consume

using System;
using MyMLAppML.Model;

namespace myMLApp
{
    class Program
    {
        static void Main(string[] args)
        {
            // Add input data
            var input = new ModelInput()
            {
              Col0 = "This restaurant was wonderful."
            };

            // Load model and predict output of sample data
            ModelOutput result = ConsumeModel.Predict(input);
            // If Prediction is 1, sentiment is "Positive"; otherwise, sentiment is "Negative"
            string sentiment = result.Prediction == "1" ? "Positive" : "Negative";
            Console.WriteLine($"Text: {input.Col0}\nSentiment: {sentiment}");
        }
    }
}

  机器学习样例:https://github.com/dotnet/machinelearning-samples

相关文章:

  • 2021-11-29
  • 2022-01-03
  • 2021-06-08
  • 2022-01-12
  • 2022-02-12
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-05
  • 2022-01-03
  • 2022-01-23
  • 2022-02-02
  • 2022-02-12
  • 2022-12-23
相关资源
相似解决方案