- 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;
}
推薦閱讀
- C++面向對象程序設計(第三版)
- Django Design Patterns and Best Practices
- Django:Web Development with Python
- Learning Firefox OS Application Development
- SharePoint Development with the SharePoint Framework
- 算法訓練營:提高篇(全彩版)
- 自然語言處理Python進階
- SQL經典實例(第2版)
- C語言程序設計
- Access 2010數據庫應用技術(第2版)
- 學習OpenCV 4:基于Python的算法實戰
- 打開Go語言之門:入門、實戰與進階
- Qlik Sense? Cookbook
- Android應用開發實戰(第2版)
- 大數據時代的企業升級之道(全3冊)