- 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;
}
推薦閱讀
- 程序員面試筆試寶典(第3版)
- 騰訊iOS測(cè)試實(shí)踐
- Access 數(shù)據(jù)庫應(yīng)用教程
- Vue.js入門與商城開發(fā)實(shí)戰(zhàn)
- Python Deep Learning
- Apache Karaf Cookbook
- PHP+MySQL網(wǎng)站開發(fā)項(xiàng)目式教程
- Python機(jī)器學(xué)習(xí)算法與實(shí)戰(zhàn)
- D3.js 4.x Data Visualization(Third Edition)
- R Data Analysis Cookbook(Second Edition)
- Getting Started with LLVM Core Libraries
- IPython Interactive Computing and Visualization Cookbook
- Java高級(jí)程序設(shè)計(jì)
- ArcPy and ArcGIS(Second Edition)
- Parallel Programming with Python