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

Exploring the project architecture

Building on the project architecture and code we created in Chapter 2, Setting Up the ML.NET Environment, the major change architecturally in this example is the mechanism for input. Chapter 2Setting Up the ML.NET Environment, used a simple string to provide sentiment analysis via a command-line argument. In this application, there are several properties to pass into the model; therefore, for this application, we are now using a JSON file to contain our input data. With this addition, we are now including the popular Newtonsoft.Json NuGet package (version 12.0.2 is the latest at the time of this writing and what is used in the included sample). If you are building this project from scratch and do not remember how to add a NuGet reference, please refer back to Chapter 2, Setting Up the ML.NET Environment

The following screenshot shows the Visual Studio Solution Explorer view of the project. The new addition to the solution is the ExtensionMethods class file, which we will review in the next section: 

The sampledata.csv file contains 40 rows of random data; feel free to adjust the data to fit your own observations or to adjust the trained model. Here is a snippet of the data:

16,1,1,0,20,38,1,1,1
23,1,1,1,17,36,0,1,0
6,1,1,0,10,30,1,0,1
4,0,1,0,6,26,1,0,1
14,0,0,0,4,27,1,0,1
24,1,1,1,14,30,1,0,1
5,1,1,0,8,31,0,1,1
12,1,1,0,20,50,0,1,1
12,1,1,0,12,50,1,0,1
6,1,1,0,10,52,0,1,1

Each of these rows contains the value for the properties in the newly created EmploymentHistory class that we will review later on in this chapter.

If you want to use a larger dataset to train and expand this example, the website Kaggle offers a dataset created by IBM data scientists. This dataset is available here:  https://www.kaggle.com/pavansubhasht/ibm-hr-analytics-attrition-dataset.
主站蜘蛛池模板: 平谷区| 海宁市| 平舆县| 湛江市| 怀远县| 岢岚县| 陆良县| 沅陵县| 安阳县| 海门市| 陇南市| 三台县| 神农架林区| 铅山县| 永登县| 德兴市| 萨嘎县| 漳平市| 龙州县| 缙云县| 衡山县| 拉萨市| 三穗县| 民和| 阿拉善盟| 玉山县| 获嘉县| 黄石市| 潮州市| 嘉善县| 明水县| 襄汾县| 杂多县| 西昌市| 廉江市| 宝清县| 莱阳市| 山东省| 抚顺市| 若羌县| 息烽县|