Repository Details
Shared by
HelloGitHub Rating
0 ratings
微软开源的 C# 机器学习框架
Past 7 days Received 0 stars ✨
Use arrow keys to explore dates, Home and End for the first and last date, Escape to dismiss.| Date | Star | Daily change |
|---|---|---|
| 周二 | 9,362 | — |
| 周三 | 9,362 | 0 |
| 周四 | 9,362 | 0 |
| 周五 | 9,361 | -1 |
| 周六 | 9,361 | 0 |
| 周日 | 9,361 | 0 |
| 周一 | 9,362 | +1 |
9.4k
Stars
No
Chinese
C#
Language
Yes
Active
251
Contributors
606
Issues
Yes
Organization
None
Latest
2k
Forks
MIT
License
微软开源的 C# 机器学习框架。支持的机器学习类任务:分类、回归、聚类等,[教程和视频](https://dotnet.microsoft.com/learn/ml-dotnet)。示例代码:
```C
var dataPath = "sentiment.csv";
var mlContext = new MLContext();
var loader = mlContext.Data.CreateTextLoader(new[]
{
new TextLoader.Column("SentimentText", DataKind.String, 1),
new TextLoader.Column("Label", DataKind.Boolean, 0),
},
hasHeader: true,
separatorChar: ',');
var data = loader.Load(dataPath);
var learningPipeline = mlContext.Transforms.Text.FeaturizeText("Features", "SentimentText")
.Append(mlContext.BinaryClassification.Trainers.FastTree());
var model = learningPipeline.Fit(data);
var predictionEngine = mlContext.Model.CreatePredictionEngine<SentimentData, SentimentPrediction>(model);
var prediction = predictionEngine.Predict(new SentimentData
{
SentimentText = "Today is a great day!"
});
Console.WriteLine("prediction: " + prediction.Prediction);
```
Included in:
Vol.54
Comments
Rating:
No comments yet