- 安装ML
Install-Package Microsoft.ML -Version 0.2.0
- 创建LearningPipeline对象
var pipeline = new LearningPipeline();
- 加载学习的文件
string dataPath = "data.txt"; pipeline.Add(new TextLoader(dataPath).CreateFrom<IrisData>(separator: ','));
- 定义要训练的特征点
pipeline.Add(new TextFeaturizer("Features", "Name"));
- 添加学习算法
pipeline.Add(new StochasticDualCoordinateAscentClassifier());
- 训练数据
var model = pipeline.Train<IrisData, IrisPrediction>();
- 预测数据
var prediction = model.Predict(new IrisData() { Name= "数据结构" });
在.net core下利用机器学习,对课程进行分类
最新推荐文章于 2024-09-02 07:50:42 发布