- 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;
}
推薦閱讀
- 零基礎(chǔ)學(xué)C++程序設(shè)計(jì)
- Python 深度學(xué)習(xí)
- R語言數(shù)據(jù)可視化之美:專業(yè)圖表繪制指南
- Rust編程從入門到實(shí)戰(zhàn)
- 編寫高質(zhì)量代碼:改善Python程序的91個(gè)建議
- 鋒利的SQL(第2版)
- Kali Linux Wireless Penetration Testing Beginner's Guide(Third Edition)
- 高級語言程序設(shè)計(jì)(C語言版):基于計(jì)算思維能力培養(yǎng)
- 學(xué)習(xí)OpenCV 4:基于Python的算法實(shí)戰(zhàn)
- D3.js By Example
- Building Wireless Sensor Networks Using Arduino
- TypeScript 2.x By Example
- Arduino機(jī)器人系統(tǒng)設(shè)計(jì)及開發(fā)
- Java EE程序設(shè)計(jì)與開發(fā)實(shí)踐教程
- PhoneGap 3.x Mobile Application Development Hotshot