- Hands-On Machine Learning with ML.NET
- Jarred Capellman
- 112字
- 2021-06-24 16:43:35
The Program class
In the Program class, we added a third option to extract features and create the sample data .tsv file:
- To begin, we modify the help text to indicate the new extract option that takes a path to the training folder:
if (args.Length != 2)
{
Console.WriteLine($"Invalid arguments passed in, exiting.{Environment.NewLine}{Environment.NewLine}Usage:{Environment.NewLine}" +
$"predict <path to input file>{Environment.NewLine}" +
$"or {Environment.NewLine}" +
$"train <path to training data file>{Environment.NewLine}" +
$"or {Environment.NewLine}" +
$"extract <path to folder>{Environment.NewLine}");
return;
}
- In addition, we also need to modify the main switch/case to support the extract argument:
switch (args[0])
{
case "extract":
new FeatureExtractor().Extract(args[1]);
break;
case "predict":
new Predictor().Predict(args[1]);
break;
case "train":
new Trainer().Train(args[1]);
break;
default:
Console.WriteLine($"{args[0]} is an invalid option");
break;
}
推薦閱讀
- Microsoft Exchange Server PowerShell Cookbook(Third Edition)
- Android和PHP開發最佳實踐(第2版)
- 計算機圖形學編程(使用OpenGL和C++)(第2版)
- Python程序設計(第3版)
- 你必須知道的204個Visual C++開發問題
- HTML5+CSS3網站設計教程
- HTML5+CSS3+JavaScript Web開發案例教程(在線實訓版)
- Learn React with TypeScript 3
- 琢石成器:Windows環境下32位匯編語言程序設計
- Learning DHTMLX Suite UI
- 編程與類型系統
- 用戶體驗可視化指南
- TMS320LF240x芯片原理、設計及應用
- Distributed Computing in Java 9
- Practical Predictive Analytics