官术网_书友最值得收藏!

Components of ML.NET

As mentioned previously, ML.NET was designed to be intuitive for experienced .NET developers. The architecture and components are very similar to the patterns found in ASP.NET and WPF.

At the heart of ML.NET is the MLContext object. Similar to AppContext in a .NET application, MLContext is a singleton class. The MLContext object itself provides access to all of the trainer catalogs ML.NET offers (some are offered by additional NuGet packages). You can think of a trainer catalog in ML.NET as a specific algorithm such as binary classification or clustering.

Here are some of the ML.NET catalogs:

  • Anomaly detection
  • Binary classification
  • Clustering
  • Forecasting
  • Regression
  • Time series

These six groups of algorithms were reviewed earlier in this chapter and will be covered in more detail in subsequent dedicated chapters in this book.

In addition, added recently in ML.NET 1.4 was the ability to import data directly from a database. This feature, while in preview at the time of writing, can facilitate not only an easier feature extraction process, but also expands the possibilities of making real-time predictions in an existing application or pipeline possible. All major databases are supported, including SQL Server, Oracle, SQLite, PostgreSQL, MySQL, DB2, and Azure SQL. We will explore this feature in Chapter 4, Classification Model, with a console application using a SQLite database.

The following diagram presents the high-level architecture of ML.NET:

Here, you can see an almost exact match to the traditional machine learning process. This was intentionally done to reduce the learning curve for those familiar with other frameworks. Each step in the architecture can be summarized as follows:

  1. IDataView: This is used to store the loaded training data into memory.
  2. Creating a Pipeline: The pipeline creation maps the IDataView object properties to values to send to the model for training.
  3. Fit(): Regardless of the algorithm, after the pipeline has been created, calling Fit() kicks off the actual model training.
  4. Save(): As the name implies, this saves the model (in a binary format) to a file.
  5. ITransformer: This loads the model back into memory to run predictions.
  6. Evaluate(): As the name implies, this evaluates the model (Chapter 2Setting Up the ML.NET Environment will dive further into the evaluation architecture).

Over the course of this book, we will dive into these methods more thoroughly.

主站蜘蛛池模板: 苍山县| 新巴尔虎右旗| 高陵县| 土默特左旗| 横峰县| 清涧县| 巴中市| 岳池县| 班戈县| 法库县| 桓台县| 钟祥市| 民县| 泌阳县| 肇东市| 江达县| 汉中市| 遵义县| 武城县| 虞城县| 德令哈市| 沁源县| 沂源县| 准格尔旗| 七台河市| 望江县| 弋阳县| 三河市| 松滋市| 新津县| 宜良县| 青浦区| 通州区| 灵武市| 东安县| 台安县| 翼城县| 汉沽区| 福贡县| 尚义县| 囊谦县|