C#_機器學習範例(AI Agent 範例)
C#_機器學習範例(AI Agent 範例)
資料來源: copilot
GITHUB: https://github.com/jash-git/CS_ML
code
using System;
using System.IO;
using Microsoft.ML;
using Microsoft.ML.Data;
/*
# AI Agent 範例 ~ copilot
有趣的挑戰啊!這裡有個簡單的範例,展示如何在 C# 使用 ML.NET 建立一個基本的機器學習代理。
01.在 NuGet Package Manager 中搜索並安裝 Microsoft.ML
02.這是一個簡單的數據集範例:
csv
Size,SoldPrice
700,50000
800,60000
850,62500
將資料保存為名為 house_prices.csv 的文件。
03.在這個範例中,我們利用 ML.NET 訓練了一個簡單的線性回歸模型,並預測給定房屋面積(如 900 sq. ft.)的價格。
*/
public class HouseData
{
[LoadColumn(0)]
public float Size { get; set; }
[LoadColumn(1)]
public float SoldPrice { get; set; }
}
public class HousePricePrediction
{
[ColumnName("Score")]
public float Price { get; set; }
}
class Program
{
static void Main(string[] args)
{
var mlContext = new MLContext();
var dataPath = Path.Combine(Environment.CurrentDirectory, "house_prices.csv");
var dataView = mlContext.Data.LoadFromTextFile<HouseData>(dataPath, hasHeader: true, separatorChar: ',');
var pipeline = mlContext.Transforms.Concatenate("Features", new[] { "Size" })
.Append(mlContext.Regression.Trainers.Sdca(labelColumnName: "SoldPrice", maximumNumberOfIterations: 100));
var model = pipeline.Fit(dataView);
var size = new HouseData() { Size = 900 };//輸入
var predictionFunction = mlContext.Model.CreatePredictionEngine<HouseData, HousePricePrediction>(model);
var prediction = predictionFunction.Predict(size);
Console.WriteLine($"預測房價: {prediction.Price}");
}
}
10 thoughts on “C#_機器學習範例(AI Agent 範例)”
YT_AI Agent 範例( python +OpenAI )
資料來源:
https://www.youtube.com/watch?v=Mjyj0Aw9K7s
https://www.largitdata.com/course/250/
https://colab.research.google.com/github/ywchiu/largitdata/blob/master/code/Course_250.ipynb
https://github.com/ywchiu/largitdata
所有收藏都在 上面GITHUB中
Semantic Kernel 的魔力-用.NET探索生成式應用 系列 [微軟的AI Agent 解決方案]
https://ithelp.ithome.com.tw/users/20126569/ironman/7890
AI Agent 教程_ithelp(AI Agent Tutorial_ithelp)
資料來源: https://ithelp.ithome.com.tw/users/20111706/ironman/8049
n8n入門: https://www.youtube.com/watch?v=vvqhzbp4J5A
https://github.com/jash-git/AI-Agent-Tutorial_ithelp
微軟 C# ML 函示庫(ML.NET) 教學網頁/GITHUB 網址 收藏
https://learn.microsoft.com/zh-tw/dotnet/machine-learning/tutorials/
https://github.com/dotnet/machinelearning/
Create Your First Machine Learning Pipeline in ML.NET [80 支影片]
C# TensorFlow.NET
教學網頁: https://scisharp.github.io/tensorflow-net-docs/#/
Code: https://github.com/SciSharp/TensorFlow.NET
C# Neural net tensorflow YT
https://www.youtube.com/watch?v=AB9lfHDOe5U&list=PL_zYr3RxTd6YIrEWEA-mwlQUEUlww0AQd&pp=0gcJCV8EOCosWNin
TensorFlow.NET机器学习环境搭建(1)C#
https://blog.csdn.net/zxy13826134783/article/details/127854343
01.安裝 TensorFlow.NET
02.安裝 TensorFlow.Keras
03.安裝 SciSharp.TensorFlow.Redist
04.切換專案類型 只能選成X64或X32不可以使用Any CPU
C# 機器學習(ML) AI 教學(YT/youtube)/範例 入門 函示庫 GITHUB 收藏 介紹
TensorFlow.NET機器學習入門(Getting Started with TensorFlow.NET Machine Learning) 完整教學和對應範例程式碼
GITHUB: https://github.com/jash-git/Getting-Started-with-TensorFlow.NET-Machine-Learning
TensorFlow.NET機器學習入門【1】開發環境與類型簡介
TensorFlow.NET機器學習入門【2】線性迴歸
TensorFlow.NET機器學習入門【3】採用神經網路實現非線性迴歸
TensorFlow.NET機器學習入門【4】採用神經網路處理分類問題
TensorFlow.NET機器學習入門【5】採用神經網路實作手寫數字辨識(MNIST)
TensorFlow.NET機器學習入門【6】採用神經網路處理Fashion-MNIST
TensorFlow.NET機器學習入門【7】採用卷積神經網路(CNN)處理Fashion-MNIST
TensorFlow.NET機器學習入門【8】採用GPU進行學習
TensorFlow.NET機器學習入門【9】後記