zoukankan      html  css  js  c++  java
  • .NET ML 机器学习上手

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

    Model Builder component in Visual Studio Installer.

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

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

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

    Model Builder supports classification, value prediction, recommendation, image classification, and object detection scenarios.

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

    对模型进行评分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}
    Sentiment: {sentiment}");
            }
        }
    }
    

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

  • 相关阅读:
    软件工程概论
    软件工程概论
    JAVA
    JAVA
    C#字符补位
    C#绘图双缓冲
    C#中IP地址转换为数值的方法
    C#并行编程-并发集合
    C#委托
    C#事件(event)解析
  • 原文地址:https://www.cnblogs.com/xred/p/14324514.html
Copyright © 2011-2022 走看看