- Hands-On Machine Learning with ML.NET
- Jarred Capellman
- 130字
- 2021-06-24 16:43:30
The BaseML class
The BaseML class, as discussed earlier, is going to contain the common code between our Trainer and Predictor classes, starting with this chapter. Over the remainder of the book, we will build on top of the BaseML class defined as follows:
using System;
using System.IO;
using chapter02.Common;
using Microsoft.ML;
namespace chapter02.ML.Base
{
public class BaseML
{
protected static string ModelPath => Path.Combine(AppContext.BaseDirectory, Constants.MODEL_FILENAME);
protected readonly MLContext MlContext;
protected BaseML()
{
MlContext = new MLContext(2020);
}
}
}
For all ML.NET applications in both training and predictions, an MLContext object is required. Initializing the object with a specific seed value is needed to create more consistent results during the testing component. Once a model is loaded, the seed value (or lack thereof) does not affect the output.
推薦閱讀
- Java完全自學教程
- Python數據可視化:基于Bokeh的可視化繪圖
- Java EE框架整合開發入門到實戰:Spring+Spring MVC+MyBatis(微課版)
- Java Web及其框架技術
- 匯編語言程序設計(第2版)
- Python數據分析(第2版)
- Big Data Analytics
- JavaScript動態網頁開發詳解
- 微信小程序開發與實戰(微課版)
- OpenCV 3 Blueprints
- Photoshop CC移動UI設計案例教程(全彩慕課版·第2版)
- C#程序設計基礎入門教程
- Laravel Design Patterns and Best Practices
- 關系數據庫與SQL Server 2012(第3版)
- 企業級Java現代化:寫給開發者的云原生簡明指南