Skip to content

[AutoML] bring AutoML API library to master #3882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 285 commits into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
285 commits
Select commit Hold shift + click to select a range
390e9d7
Ungroup Columns in Column Inference (#40)
srsaggam Jan 29, 2019
2a638cc
Misc fixes (#39)
daholste Jan 29, 2019
21b16c3
Removing the nuget.config and have build.props mention the nuget pack…
srsaggam Jan 29, 2019
ff599fd
transform inferencing concat / ignore fixes (#41)
daholste Jan 29, 2019
f8dd6f8
make pipeline object model & other public classes internal (#43)
daholste Jan 29, 2019
bd900ff
handle SMAC exception when fewer trees were trained than requested (#44)
daholste Jan 29, 2019
d254f4e
Throw error on incorrect Label name in InferColumns API (#47)
srsaggam Jan 30, 2019
41c663c
Set Nullable Auto params to null values (#50)
srsaggam Jan 30, 2019
e4a64cf
First public api propsal (#52)
vinodshanbhag Jan 30, 2019
e6fa88e
Revert "Set Nullable Auto params to null values" (#53)
srsaggam Jan 31, 2019
bbbd341
AutoFit return type is now an IEnumerable (#55)
vinodshanbhag Feb 1, 2019
e3ae06f
misc fixes & test additions, towards 0.1 release (#56)
daholste Feb 3, 2019
6d4cb73
Enable UnitTests on build server (#57)
daholste Feb 3, 2019
60083a8
1) Making trainer name public (#62)
vinodshanbhag Feb 6, 2019
312e267
Initial version of CLI tool for mlnet (#61)
srsaggam Feb 6, 2019
4748f03
Use better AutiFit overload and ignore Multiclass (#64)
vinodshanbhag Feb 6, 2019
974b2d7
Upgrading CLI to produce ML.NET V.10 APIs and bunch of Refactoring ta…
srsaggam Feb 7, 2019
bd9b5fe
Upgrade ML.NET package to 0.10.0 (#70)
daholste Feb 7, 2019
c8160d4
Change in template to accomodate new API of TextLoader (#72)
srsaggam Feb 7, 2019
3bcaaf8
Enable gated check for mlnet.tests (#79)
srsaggam Feb 7, 2019
c8f8e38
CLI tool - make validation dataset optional and support for crossvali…
srsaggam Feb 8, 2019
aba6f93
benchmarking related changes (#63)
Dmitry-A Feb 8, 2019
057023b
fix fast forest learner (don't sweep over learning rate) (#88)
daholste Feb 8, 2019
6f2bcab
Made changes to Have non-calibrated scoring for binary classifiers (#86)
srsaggam Feb 9, 2019
31379c4
rev ColumnInference API: can take label index; rev output object type…
daholste Feb 10, 2019
fd5c904
rename AutoML to Microsoft.ML.Auto everywhere and a shot at publishin…
Dmitry-A Feb 11, 2019
f92e1a2
publish nuget (#101)
Dmitry-A Feb 11, 2019
9cee0eb
Fix Codegen for columnConvert and ValueToKeyMapping transform and add…
srsaggam Feb 11, 2019
b8b577a
When generating usings choose only distinct usings directives (#94)
srsaggam Feb 11, 2019
8ec02d8
Autofit overloads + cancellation + progress callbacks
vinodshanbhag Feb 12, 2019
6ed9d0a
Default the kfolds to value 5 in CLI generated code (#115)
srsaggam Feb 12, 2019
6995688
Remove extra ; from generated code (#114)
srsaggam Feb 12, 2019
ed430ef
TimeoutInSeconds (#116)
vinodshanbhag Feb 13, 2019
48de6a7
Added more command line args implementation to CLI tool and refactori…
srsaggam Feb 13, 2019
1ed4195
Fail gracefully if unable to instantiate data view with swept paramet…
daholste Feb 14, 2019
1dc5ba2
validate AutoFit 'Features' column must be of type R4 (#132)
daholste Feb 14, 2019
1066191
Samples: exceptions / nits (#124)
daholste Feb 14, 2019
d5dc0ce
Logging support in CLI + Implementation of cmd args [--name,--output,…
srsaggam Feb 14, 2019
e6da4a4
added correct validation check (#137)
srsaggam Feb 14, 2019
eac7ff4
Use CreateTextLoader<T>(..) instead of CreateTextLoader(..) (#138)
srsaggam Feb 14, 2019
73dfed0
changed CreateTextLoader to ReadFromTextFile method. (#140)
srsaggam Feb 15, 2019
38595ab
exception fixes (#136)
daholste Feb 15, 2019
ff9b14a
infer purpose of hidden columns as 'ignore' (#142)
daholste Feb 15, 2019
ad8c28e
Added approval tests and bunch of refactoring of code and normalizing…
srsaggam Feb 15, 2019
8029cc1
API 2.0 skeleton (#149)
vinodshanbhag Feb 15, 2019
9fb2de3
The CV code should come before the training when there is no test dat…
srsaggam Feb 17, 2019
1c1004b
Format the generated code + bunch of misc tasks (#152)
srsaggam Feb 19, 2019
9fa97a3
Sanitize the column names in CLI (#162)
srsaggam Feb 20, 2019
7605bf0
fix package name (#168)
srsaggam Feb 20, 2019
1adfbc7
Rev public API (#163)
daholste Feb 20, 2019
b4bfe72
Rename TransformGeneratorBase .cs to TransformGeneratorBase.cs (#153)
justinormont Feb 20, 2019
abf1b3d
Fix minor version for the repository + remove Nlog config package (#171)
srsaggam Feb 20, 2019
fa6e616
Added new test to columninfo and fixing up API (#178)
vinodshanbhag Feb 20, 2019
51a613c
Make optimizing metric customizable and add trainer whitelist functio…
daholste Feb 20, 2019
8a9f1f2
API rev (#181)
daholste Feb 20, 2019
2d8a6ed
propagate root MLContext thru AutoML (instead of creating our own) (#…
daholste Feb 21, 2019
ce4ad27
Enabling new command line args (#183)
srsaggam Feb 21, 2019
0d93e80
rename 'AutoFitter' to 'Experiment' (#169)
daholste Feb 21, 2019
63d5b2d
added tests (#187)
srsaggam Feb 21, 2019
12c236c
rev InferColumns to accept ColumnInfo input param (#186)
daholste Feb 21, 2019
88ff3f5
Implement argument --has-header and change usage of dataset (#194)
srsaggam Feb 22, 2019
9cc2910
removed dummy command (#195)
srsaggam Feb 22, 2019
b3f980b
Fix bug for regression and sanitize input label from user (#198)
srsaggam Feb 22, 2019
0444787
Do not generate code concatenating columns when the dataset has a sin…
daholste Feb 22, 2019
7744549
Include some missed logging in the generated code. (#199)
srsaggam Feb 22, 2019
2f1b176
cleaning up proj files (#185)
srsaggam Feb 22, 2019
895414c
Some spaces and extra lines + bug in output path (#204)
srsaggam Feb 22, 2019
5279a69
accept label from user input and provide in generated code (#205)
srsaggam Feb 23, 2019
c4090f3
Rev handling of weight / label columns (#203)
daholste Feb 23, 2019
2f9263c
migrate to private ML.NET nuget for latest bug fixes (#131)
daholste Feb 23, 2019
796ae8a
fix multiclass with nonstandard label (#207)
daholste Feb 23, 2019
abf6f0d
Multiclass nondefault label test (#208)
daholste Feb 23, 2019
c955ae9
printing escaped chars + bug (#212)
srsaggam Feb 25, 2019
37cb1f8
delete unused internal samples (#211)
daholste Feb 25, 2019
08e908c
fix SMAC bug that causes multiclass sample to infinite loop (#209)
daholste Feb 25, 2019
18bf568
Rev user input validation for new API (#210)
daholste Feb 25, 2019
b3271f6
added console message for exit and nit picks (#215)
srsaggam Feb 25, 2019
27a599d
exit when exception encountered (#216)
srsaggam Feb 25, 2019
3437212
Seal API classes (and make EnableCaching internal) (#217)
daholste Feb 26, 2019
0aa5d0f
Suggested sample nits (feel free to ask for any of these to be revert…
daholste Feb 26, 2019
b629d78
User input column type validation (#218)
daholste Feb 26, 2019
8463bae
upgrade commandline and renaming (#221)
srsaggam Feb 26, 2019
9ea19bd
Make build.sh, init-tools.sh, & run.sh executable on OSX/Linux (#225)
justinormont Feb 26, 2019
dea2fe2
CLI argument descriptions updated (#224)
CESARDELATORRE Feb 26, 2019
95dc1fc
added flag to disable training code (#227)
srsaggam Feb 26, 2019
e52d7f0
Exit if perfect model produced (#220)
daholste Feb 26, 2019
95b58d3
removed header (#228)
srsaggam Feb 26, 2019
9f8de06
removed console read key (#229)
srsaggam Feb 26, 2019
9de92e6
Fix model path in generated file (#230)
srsaggam Feb 26, 2019
15dd299
reorder samples (#231)
daholste Feb 26, 2019
b5e7e1f
remove rule that infers column purpose as categorical if # of distinc…
daholste Feb 27, 2019
79ad446
Null reference exception fix for finding best model when some runs ha…
daholste Feb 28, 2019
9e56488
samples fixes (#238)
daholste Feb 28, 2019
d8d9295
fix for defaulting Averaged Perceptron # of iterations to 10 (#237)
daholste Feb 28, 2019
12cff38
Bug bash feedback Feb 27. API changes and sample changes (#240)
vinodshanbhag Feb 28, 2019
584a0d6
Samples / API rev from 2/27 bug bash feedback (#242)
daholste Feb 28, 2019
20d45db
changed the directory structure for generated project (#243)
srsaggam Mar 1, 2019
44e5c7a
Fix test file locations on OSX (#235)
justinormont Mar 1, 2019
ce27641
upgrade to latest ML.NET public surface (#246)
daholste Mar 2, 2019
80a48be
Upgrade to ML.NET 0.11 (#247)
srsaggam Mar 2, 2019
3f77e59
Private preview final API changes (#250)
vinodshanbhag Mar 3, 2019
8fd2aa8
Add estimator to public API iteration result (#248)
daholste Mar 3, 2019
b3fd4dc
LightGBM pipeline serialization fix (#251)
daholste Mar 3, 2019
7f74a29
Change order that we search for TextLoader's parameters (#256)
justinormont Mar 3, 2019
6e1cf63
CLI IFileInfo null exception fix (#254)
daholste Mar 3, 2019
e4a2dc8
Averaged Perceptron pipeline serialization fix (#257)
daholste Mar 4, 2019
12a5d46
Upgrade command-line-api and default folder name change (#258)
srsaggam Mar 4, 2019
958dbf8
eliminate IFileInfo from CLI (#260)
daholste Mar 4, 2019
3b1d0ac
Rev samples towards private preview; ignored columns fix (#259)
daholste Mar 4, 2019
3acd887
remove unused methods in consolehelper and nit picks in generated cod…
srsaggam Mar 4, 2019
1a5161d
added nuget sources in generated csproj (#262)
srsaggam Mar 5, 2019
c77b78a
upgrade to mlnet 0.11 (#263)
srsaggam Mar 6, 2019
677aa0e
Formatting CLI metrics (#264)
justinormont Mar 6, 2019
551a7a1
Add implementation of non -ova multi class trainers code gen (#267)
srsaggam Mar 6, 2019
3326539
Add caching (#249)
daholste Mar 7, 2019
cc7bb86
AdvancedExperimentSettings sample nits (#265)
daholste Mar 7, 2019
3ad0798
Add sampling key column (#268)
daholste Mar 7, 2019
fe503d3
Initial work for multi-class classification support for CLI (#226)
justinormont Mar 7, 2019
50f8f62
Refactor the orchestration of AutoML calls (#272)
srsaggam Mar 8, 2019
2ea089e
Do not auto-group columns with suggested purpose = 'Ignore' (#273)
daholste Mar 8, 2019
2ba9664
Fix: during type inferencing, parse whitespace strings as NaN (#271)
daholste Mar 8, 2019
001b8df
Printing additional metrics in CLI for binary classification (#274)
justinormont Mar 8, 2019
dba3828
Add API option to store models on disk (instead of in memory); fix IE…
daholste Mar 8, 2019
d03e55f
Print failed iterations in CLI (#275)
justinormont Mar 13, 2019
0bb8951
change the type to float from double (#277)
srsaggam Mar 13, 2019
3a4595d
cache arg implementation in CLI (#280)
srsaggam Mar 13, 2019
f25e4f9
Remove duplicate value-to-key mapping transform for multiclass string…
daholste Mar 14, 2019
6e5a5d7
Add post-trainer transform SDK infra; add KeyToValueMapping transform…
daholste Mar 15, 2019
4a6921d
Implement ignore columns command line arg (#290)
srsaggam Mar 16, 2019
9603fc4
Print winning iteration and runtime in CLI (#288)
justinormont Mar 16, 2019
990cfbd
Add MacOS & Linux to CI; MacOS & Linux test fixes (#293)
daholste Mar 17, 2019
dc16273
MicroAccuracy as default for multi-class (#295)
justinormont Mar 17, 2019
260937c
Null exception for ignorecolumns in CLI (#294)
justinormont Mar 18, 2019
6013b95
Emit caching flag in pipeline object model. (Includes SuggestedPipeli…
daholste Mar 18, 2019
829ae8c
removed sln (#297)
srsaggam Mar 18, 2019
2c44aab
Caching enabling in code gen part -2 (#298)
srsaggam Mar 18, 2019
30046a1
support comma separated values for --ignore-columns (#300)
srsaggam Mar 19, 2019
d2c50a7
default initialization for ignore columns (#302)
srsaggam Mar 20, 2019
14091e4
Codegen for multiclass non-ova (#303)
srsaggam Mar 20, 2019
25cc50d
Generated Project new structure. (#305)
srsaggam Mar 25, 2019
35e5bbc
include using system in prediction class (#307)
srsaggam Mar 25, 2019
e152288
Random number generator is not thread safe (#310)
justinormont Mar 26, 2019
cf8c1f4
Fix multiclass code gen (#314)
srsaggam Mar 26, 2019
db3850c
Fix compile error in codegen project (#319)
srsaggam Mar 27, 2019
73d141b
Rev OVA pipeline node SDK output: wrap binary trainers as children in…
daholste Mar 27, 2019
64f5ba1
Ova Multi class codegen support (#321)
srsaggam Mar 27, 2019
a3e7f6a
Rev run result trainer name for OVA: output different trainer name fo…
daholste Mar 27, 2019
4b6cb6a
Console helper bug in generated code for multiclass (#323)
srsaggam Mar 27, 2019
b2196c2
Initial version of Progress bar impl and CLI UI experience (#325)
srsaggam Mar 29, 2019
701aa82
Setting model directory to temp directory (#327)
vinodshanbhag Mar 30, 2019
c674103
Suggested changes to progress bar (#335)
srsaggam Apr 1, 2019
c328d21
Rev Samples (#334)
daholste Apr 1, 2019
f44473f
Telemetry2 (#333)
Dmitry-A Apr 2, 2019
93cf2d3
Fix progress bar in linux/osx (#336)
srsaggam Apr 2, 2019
6a752a5
Mem leak fix (#328)
Dmitry-A Apr 2, 2019
f9d547b
Upgrade ML.NET package (#343)
daholste Apr 3, 2019
43fe8b8
Add cross-validation (CV), and auto-CV for small datasets; push commo…
daholste Apr 3, 2019
6b2eca8
restore old yml for internal pipeline so we can publish nuget again t…
Dmitry-A Apr 3, 2019
3c492c4
Polishing the CLI UI part-1 (#338)
srsaggam Apr 4, 2019
cab5809
CLI ML.NET version upgrade (#345)
daholste Apr 4, 2019
a810d8d
Sample revs; ColumnInformation property name revs; pre-featurizer fix…
daholste Apr 4, 2019
e89b9a8
CLI -- consume logs from AutoML SDK (#349)
daholste Apr 5, 2019
b68b8f2
Rename RunDetails --> RunDetail (#350)
daholste Apr 5, 2019
ba08a53
command line api upgrade and progress bar rendering bug (#366)
srsaggam Apr 9, 2019
9b6adcd
change in the version (#368)
srsaggam Apr 9, 2019
4f9dc40
fix few bugs in progressbar and verbosity (#374)
srsaggam Apr 10, 2019
96d2427
Fix for folders with space in it while generating project (#376)
srsaggam Apr 10, 2019
40496fd
SMAC fix for minimizing metrics (#363)
daholste Apr 11, 2019
9faceb2
Formatting Regression metrics and progress bar display days. (#379)
srsaggam Apr 11, 2019
ffd773b
change command name and add pbar message (#380)
srsaggam Apr 11, 2019
662a8ea
UI missing features (#382)
srsaggam Apr 12, 2019
e257648
downgrade the codepages (#384)
srsaggam Apr 12, 2019
c5ec302
Change in project structure (#385)
srsaggam Apr 12, 2019
d4b7700
FileSizeBuckets in correct units (#387)
justinormont Apr 12, 2019
5227ee5
changed order (#388)
srsaggam Apr 12, 2019
553e089
prep work to transfer to ml.net (#389)
Dmitry-A Apr 12, 2019
2d32ee0
moving code and history over from machinelearning-automl
Dmitry-A Apr 12, 2019
013a8d3
Add AutoML components to build, fix issues related to that so it builds
Dmitry-A Apr 12, 2019
b1d50f6
Merge remote-tracking branch 'remotes/dmitrya/users/dmitrya/move-to-m…
Dmitry-A Apr 13, 2019
a7446e4
fix test cases, remove AppInsights ref from AutoML (#3329)
Dmitry-A Apr 13, 2019
53a1d02
[AutoML] disable netfx build leg for now (#3331)
Dmitry-A Apr 13, 2019
4056c63
[AutoML] Add AutoML XML documentation to all public members; migrate …
daholste Apr 16, 2019
4ead03d
[AutoML] Rev AutoML public API; add required native references to Aut…
daholste Apr 16, 2019
ffeed1b
[AutoML] Minor changes to generated project in CLI based on feedback …
srsaggam Apr 17, 2019
8874994
[AutoML] Migrate AutoML back to its own solution, w/ NuGet dependenci…
daholste Apr 18, 2019
272ede6
[AutoML] publish AutoML package (#3383)
Dmitry-A Apr 18, 2019
d1b9e62
bump version to 0.3 since that's the one we're going to ship for buil…
Dmitry-A Apr 18, 2019
8f06a61
[AutoML] temporarily disable all but x64 platforms -- don't want to d…
Dmitry-A Apr 18, 2019
9718aaf
disable steps but keep phases to keep vsts build pipeline happy (#3423)
Dmitry-A Apr 19, 2019
da3a403
API docs for experimentation (#3484)
vinodshanbhag Apr 22, 2019
c832e27
fixed path bug and regression metrics correction (#3504)
srsaggam Apr 22, 2019
7191ebe
changed the casing of option alias as it conflicts with --help (#3554)
srsaggam Apr 23, 2019
c9cb3cc
[AutoML] Generated project - FastTree nuget package inclusion dynamic…
srsaggam Apr 24, 2019
29d92ed
[AutoML] Add AutoML example code (#3458)
daholste Apr 25, 2019
fe77854
AutoML PipelineSuggester: don't recommend pipelines from first-stage …
daholste Apr 26, 2019
4dc47aa
InferColumns API: Validate all columns specified in column info exist…
daholste Apr 26, 2019
4d3416e
[AutoML] AutoML SDK API: validate schema types of input IDataView (#3…
daholste Apr 26, 2019
1430ebf
[AutoML] If first three iterations all fail, short-circuit AutoML exp…
daholste Apr 26, 2019
706e8c9
mlnet CLI nupkg creation/signing (#3606)
Dmitry-A Apr 26, 2019
b274f1e
[AutoML] rename Auto to AutoML in namespace and nuget (#3609)
Dmitry-A Apr 27, 2019
ed43327
[AutoML] take dependency on a specific ml.net version (#3610)
Dmitry-A Apr 27, 2019
2c1cdc1
force a specific ml.net nuget version, fix typo (#3616)
Dmitry-A Apr 29, 2019
d8bc4ed
[AutoML] Fix error handling in CLI. (#3618)
srsaggam Apr 29, 2019
ca974cd
[AutoML] turn off line pragmas in .tt files to play nice with signing…
Dmitry-A Apr 29, 2019
06e130b
change the param name (#3619)
srsaggam Apr 29, 2019
40a4346
[AutoML] return null instead of null ref crash on Model property acc…
Dmitry-A Apr 30, 2019
c3d93ff
[AutoML] Handling label column names which have space and exception l…
srsaggam Apr 30, 2019
5e39073
use Name instead of FullName for telemetry filename hash (#3633)
Dmitry-A May 1, 2019
dfa841c
renamed classes (#3634)
srsaggam May 1, 2019
1212d56
change ML.NET dependency to 1.0 (#3639)
Dmitry-A May 1, 2019
9e1fcdf
set exploration time default in CLI to half hour (#3640)
Dmitry-A May 1, 2019
4a535ff
[AutoML] step 2 of removing pinned nupkg versions (#3642)
Dmitry-A May 1, 2019
e44edca
InferColumns API that consumes label column index -- Only rename labe…
daholste May 1, 2019
f6c5345
[AutoML] Upgrade ml.net package in generated code (#3644)
srsaggam May 2, 2019
67d1cee
[AutoML] Early stopping in CLI based on the exploration time (#3641)
srsaggam May 2, 2019
3efc186
[AutoML] Change wording for CouldNotFinshOnTime message (#3655)
Dmitry-A May 2, 2019
b5438d1
temp change to get around vsts publish failure (#3656)
Dmitry-A May 3, 2019
62a82b2
[AutoML] bump version to 0.4.0 (#3658)
Dmitry-A May 3, 2019
14abc9d
implement culture invariant strings (#3725)
srsaggam May 15, 2019
fac974d
reset culture (#3730)
srsaggam May 15, 2019
bf40c9f
[AutoML] Cross validation fixes; validate empty training / validation…
daholste Jun 3, 2019
3846384
[AutoML] Enable style cop rules & resolve errors (#3823)
daholste Jun 6, 2019
b1af7a6
add task agnostic wrappers for autofit calls (#3860)
Dmitry-A Jun 13, 2019
227da9d
[AutoML] CLI telemetry rev (#3789)
daholste Jun 17, 2019
dab4600
get in sync with master
Dmitry-A Jun 18, 2019
52e270d
bring AutoML API library to master
Dmitry-A Jun 19, 2019
f616dda
delete automl .sln
Dmitry-A Jun 19, 2019
66a30cf
CLI -- regenerate templated CS files (#3954)
daholste Jul 2, 2019
f121a38
[AutoML] Bump ML.NET package version to 1.2.0 in AutoML API and CLI; …
daholste Jul 3, 2019
e6a9595
Build AutoML NuGet package (#3961)
daholste Jul 3, 2019
d518b58
Increment AutoML build version to 0.15.0 for preview. (#3968)
justinormont Jul 7, 2019
a15aaa7
added culture independent parsing (#3731)
srsaggam Jul 12, 2019
1360328
Merge remote-tracking branch 'upstream/master'
Dmitry-A Jul 29, 2019
d265656
- convert tests to xunit
Dmitry-A Aug 5, 2019
bceeec8
sync with AutoML feature branch
Dmitry-A Aug 5, 2019
0f020b6
address issues only showing up in a couple configurations during CI b…
Dmitry-A Aug 6, 2019
4040314
fix cut&paste error
Dmitry-A Aug 6, 2019
4f3d82d
[AutoML] Bump version to ML.NET 1.3.1 in AutoML API and CLI and AutoM…
srsaggam Aug 6, 2019
3a67603
[AutoML] Fix for Exception thrown in cross val when one of the score …
srsaggam Aug 6, 2019
dc9a9b7
changes signing (#4079)
srsaggam Aug 7, 2019
2b633df
Addressed PR comments and build issues
Dmitry-A Aug 16, 2019
7d645b3
minor nit - removed unused folder ref
Dmitry-A Aug 16, 2019
524176a
update with latest from features/automl
Dmitry-A Aug 16, 2019
de657f0
sync to master
Dmitry-A Aug 17, 2019
6c7e7c0
Fix the .sln file for the right configurations.
eerhardt Aug 17, 2019
3a1f543
Fix mistake in .sln file
eerhardt Aug 17, 2019
02a9bd3
test fixes and disable one test
Dmitry-A Aug 17, 2019
e54e6b3
Merge branch 'master' of https://github.com/Dmitry-A/machinelearning
Dmitry-A Aug 17, 2019
179a99a
fix tests, re-add AutoML samples csproj
Dmitry-A Aug 19, 2019
3db7d98
bumped VS version to 16 in .sln, removed InternalsVisible for a dead …
Dmitry-A Aug 19, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 89 additions & 2 deletions Microsoft.ML.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2026
# Visual Studio Version 16
VisualStudioVersion = 16.0.29209.152
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Core", "src\Microsoft.ML.Core\Microsoft.ML.Core.csproj", "{A6CA6CC6-5D7C-4D7F-A0F5-35E14B383B0A}"
EndProject
Expand Down Expand Up @@ -264,6 +264,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.StableApi", "t
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Dnn", "src\Microsoft.ML.Dnn\Microsoft.ML.Dnn.csproj", "{4C2D1A8F-7AC1-4036-B5E3-4B31769D73B8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.AutoML.Tests", "test\Microsoft.ML.AutoML.Tests\Microsoft.ML.AutoML.Tests.csproj", "{C2652287-CD6D-40FB-B042-95FB56D09DB8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.AutoML", "src\Microsoft.ML.AutoML\Microsoft.ML.AutoML.csproj", "{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.ML.AutoML", "Microsoft.ML.AutoML", "{F5D11F71-2D61-4AE9-99D7-0F0B54649B15}"
ProjectSection(SolutionItems) = preProject
pkg\Microsoft.ML.AutoML\Microsoft.ML.AutoML.nupkgproj = pkg\Microsoft.ML.AutoML\Microsoft.ML.AutoML.nupkgproj
pkg\Microsoft.ML.AutoML\Microsoft.ML.AutoML.symbols.nupkgproj = pkg\Microsoft.ML.AutoML\Microsoft.ML.AutoML.symbols.nupkgproj
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.AutoML.Samples", "docs\samples\Microsoft.ML.AutoML.Samples\Microsoft.ML.AutoML.Samples.csproj", "{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1528,6 +1540,77 @@ Global
{4C2D1A8F-7AC1-4036-B5E3-4B31769D73B8}.Release-netfx|Any CPU.Build.0 = Release-netfx|Any CPU
{4C2D1A8F-7AC1-4036-B5E3-4B31769D73B8}.Release-netfx|x64.ActiveCfg = Release-netfx|Any CPU
{4C2D1A8F-7AC1-4036-B5E3-4B31769D73B8}.Release-netfx|x64.Build.0 = Release-netfx|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Debug|x64.ActiveCfg = Debug|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Debug|x64.Build.0 = Debug|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Debug-netcoreapp3_0|Any CPU.ActiveCfg = Debug-netcoreapp3_0|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Debug-netcoreapp3_0|Any CPU.Build.0 = Debug-netcoreapp3_0|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Debug-netcoreapp3_0|x64.ActiveCfg = Debug-netcoreapp3_0|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Debug-netcoreapp3_0|x64.Build.0 = Debug-netcoreapp3_0|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Debug-netfx|Any CPU.ActiveCfg = Debug-netfx|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Debug-netfx|Any CPU.Build.0 = Debug-netfx|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Debug-netfx|x64.ActiveCfg = Debug-netfx|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Debug-netfx|x64.Build.0 = Debug-netfx|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Release|Any CPU.Build.0 = Release|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Release|x64.ActiveCfg = Release|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Release|x64.Build.0 = Release|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Release-netcoreapp3_0|Any CPU.ActiveCfg = Release-netcoreapp3_0|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Release-netcoreapp3_0|Any CPU.Build.0 = Release-netcoreapp3_0|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Release-netcoreapp3_0|x64.ActiveCfg = Release-netcoreapp3_0|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Release-netcoreapp3_0|x64.Build.0 = Release-netcoreapp3_0|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Release-netfx|Any CPU.ActiveCfg = Release-netfx|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Release-netfx|Any CPU.Build.0 = Release-netfx|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Release-netfx|x64.ActiveCfg = Release-netfx|Any CPU
{C2652287-CD6D-40FB-B042-95FB56D09DB8}.Release-netfx|x64.Build.0 = Release-netfx|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Debug|x64.ActiveCfg = Debug|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Debug|x64.Build.0 = Debug|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Debug-netcoreapp3_0|Any CPU.ActiveCfg = Debug-netcoreapp3_0|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Debug-netcoreapp3_0|Any CPU.Build.0 = Debug-netcoreapp3_0|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Debug-netcoreapp3_0|x64.ActiveCfg = Debug-netcoreapp3_0|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Debug-netcoreapp3_0|x64.Build.0 = Debug-netcoreapp3_0|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Debug-netfx|Any CPU.ActiveCfg = Debug-netfx|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Debug-netfx|Any CPU.Build.0 = Debug-netfx|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Debug-netfx|x64.ActiveCfg = Debug-netfx|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Debug-netfx|x64.Build.0 = Debug-netfx|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Release|Any CPU.Build.0 = Release|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Release|x64.ActiveCfg = Release|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Release|x64.Build.0 = Release|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Release-netcoreapp3_0|Any CPU.ActiveCfg = Release-netcoreapp3_0|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Release-netcoreapp3_0|Any CPU.Build.0 = Release-netcoreapp3_0|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Release-netcoreapp3_0|x64.ActiveCfg = Release-netcoreapp3_0|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Release-netcoreapp3_0|x64.Build.0 = Release-netcoreapp3_0|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Release-netfx|Any CPU.ActiveCfg = Release-netfx|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Release-netfx|Any CPU.Build.0 = Release-netfx|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Release-netfx|x64.ActiveCfg = Release-netfx|Any CPU
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80}.Release-netfx|x64.Build.0 = Release-netfx|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Debug|x64.ActiveCfg = Debug|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Debug|x64.Build.0 = Debug|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Debug-netcoreapp3_0|Any CPU.ActiveCfg = Debug-netcoreapp3_0|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Debug-netcoreapp3_0|Any CPU.Build.0 = Debug-netcoreapp3_0|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Debug-netcoreapp3_0|x64.ActiveCfg = Debug-netcoreapp3_0|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Debug-netcoreapp3_0|x64.Build.0 = Debug-netcoreapp3_0|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Debug-netfx|Any CPU.ActiveCfg = Debug-netfx|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Debug-netfx|Any CPU.Build.0 = Debug-netfx|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Debug-netfx|x64.ActiveCfg = Debug-netfx|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Debug-netfx|x64.Build.0 = Debug-netfx|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Release|Any CPU.Build.0 = Release|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Release|x64.ActiveCfg = Release|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Release|x64.Build.0 = Release|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Release-netcoreapp3_0|Any CPU.ActiveCfg = Release-netcoreapp3_0|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Release-netcoreapp3_0|Any CPU.Build.0 = Release-netcoreapp3_0|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Release-netcoreapp3_0|x64.ActiveCfg = Release-netcoreapp3_0|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Release-netcoreapp3_0|x64.Build.0 = Release-netcoreapp3_0|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Release-netfx|Any CPU.ActiveCfg = Release-netfx|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Release-netfx|Any CPU.Build.0 = Release-netfx|Any CPU
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3}.Release-netfx|x64.ActiveCfg = Release-netfx|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1610,6 +1693,10 @@ Global
{AE4F7569-26F3-4160-8A8B-7A57D0DA3350} = {D3D38B03-B557-484D-8348-8BADEE4DF592}
{F308DC6B-7E59-40D7-A581-834E8CD99CFE} = {7F13E156-3EBA-4021-84A5-CD56BA72F99E}
{4C2D1A8F-7AC1-4036-B5E3-4B31769D73B8} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{C2652287-CD6D-40FB-B042-95FB56D09DB8} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
{E48285BF-F49A-4EA3-AED0-1BDDBF77EB80} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{F5D11F71-2D61-4AE9-99D7-0F0B54649B15} = {D3D38B03-B557-484D-8348-8BADEE4DF592}
{A6924919-9E37-4023-8B7F-E85C8E3CC9B3} = {DA452A53-2E94-4433-B08C-041EDEC729E6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {41165AF1-35BB-4832-A189-73060F82B01D}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using System;
using System.IO;
using System.Linq;
using Microsoft.ML.AutoML;
using Microsoft.ML.Data;

namespace Microsoft.ML.AutoML.Samples
{
public static class BinaryClassificationExperiment
{
private static string TrainDataPath = "<Path to your train dataset goes here>";
private static string TestDataPath = "<Path to your test dataset goes here>";
private static string ModelPath = @"<Desired model output directory goes here>\SentimentModel.zip";
private static uint ExperimentTime = 60;

public static void Run()
{
MLContext mlContext = new MLContext();

// STEP 1: Load data
IDataView trainDataView = mlContext.Data.LoadFromTextFile<SentimentIssue>(TrainDataPath, hasHeader: true);
IDataView testDataView = mlContext.Data.LoadFromTextFile<SentimentIssue>(TestDataPath, hasHeader: true);

// STEP 2: Run AutoML experiment
Console.WriteLine($"Running AutoML binary classification experiment for {ExperimentTime} seconds...");
ExperimentResult<BinaryClassificationMetrics> experimentResult = mlContext.Auto()
.CreateBinaryClassificationExperiment(ExperimentTime)
.Execute(trainDataView);

// STEP 3: Print metric from the best model
RunDetail<BinaryClassificationMetrics> bestRun = experimentResult.BestRun;
Console.WriteLine($"Total models produced: {experimentResult.RunDetails.Count()}");
Console.WriteLine($"Best model's trainer: {bestRun.TrainerName}");
Console.WriteLine($"Metrics of best model from validation data --");
PrintMetrics(bestRun.ValidationMetrics);

// STEP 4: Evaluate test data
IDataView testDataViewWithBestScore = bestRun.Model.Transform(testDataView);
BinaryClassificationMetrics testMetrics = mlContext.BinaryClassification.EvaluateNonCalibrated(testDataViewWithBestScore);
Console.WriteLine($"Metrics of best model on test data --");
PrintMetrics(testMetrics);

// STEP 5: Save the best model for later deployment and inferencing
using (FileStream fs = File.Create(ModelPath))
mlContext.Model.Save(bestRun.Model, trainDataView.Schema, fs);

// STEP 6: Create prediction engine from the best trained model
var predictionEngine = mlContext.Model.CreatePredictionEngine<SentimentIssue, SentimentPrediction>(bestRun.Model);

// STEP 7: Initialize a new sentiment issue, and get the predicted sentiment
var testSentimentIssue = new SentimentIssue
{
Text = "I hope this helps."
};
var prediction = predictionEngine.Predict(testSentimentIssue);
Console.WriteLine($"Predicted sentiment for test issue: {prediction.Prediction}");

Console.WriteLine("Press any key to continue...");
Console.ReadKey();
}

private static void PrintMetrics(BinaryClassificationMetrics metrics)
{
Console.WriteLine($"Accuracy: {metrics.Accuracy}");
Console.WriteLine($"AreaUnderPrecisionRecallCurve: {metrics.AreaUnderPrecisionRecallCurve}");
Console.WriteLine($"AreaUnderRocCurve: {metrics.AreaUnderRocCurve}");
Console.WriteLine($"F1Score: {metrics.F1Score}");
Console.WriteLine($"NegativePrecision: {metrics.NegativePrecision}");
Console.WriteLine($"NegativeRecall: {metrics.NegativeRecall}");
Console.WriteLine($"PositivePrecision: {metrics.PositivePrecision}");
Console.WriteLine($"PositiveRecall: {metrics.PositiveRecall}");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Microsoft.ML.Data;

namespace Microsoft.ML.AutoML.Samples
{
public class PixelData
{
[LoadColumn(0, 63)]
[VectorType(64)]
public float[] PixelValues;

[LoadColumn(64)]
public float Number;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Microsoft.ML.Data;

namespace Microsoft.ML.AutoML.Samples
{
public class PixelPrediction
{
[ColumnName("PredictedLabel")]
public float Prediction;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Microsoft.ML.Data;

namespace Microsoft.ML.AutoML.Samples
{
public class SentimentIssue
{
[LoadColumn(0)]
public bool Label { get; set; }

[LoadColumn(1)]
public string Text { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Microsoft.ML.Data;

namespace Microsoft.ML.AutoML.Samples
{
public class SentimentPrediction
{
// ColumnName attribute is used to change the column name from
// its default value, which is the name of the field.
[ColumnName("PredictedLabel")]
public bool Prediction { get; set; }

public float Score { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Microsoft.ML.Data;

namespace Microsoft.ML.AutoML.Samples
{
public class TaxiTrip
{
[LoadColumn(0)]
public string VendorId;

[LoadColumn(1)]
public float RateCode;

[LoadColumn(2)]
public float PassengerCount;

[LoadColumn(3)]
public float TripTimeInSeconds;

[LoadColumn(4)]
public float TripDistance;

[LoadColumn(5)]
public string PaymentType;

[LoadColumn(6)]
public float FareAmount;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Microsoft.ML.Data;

namespace Microsoft.ML.AutoML.Samples
{
public class TaxiTripFarePrediction
{
[ColumnName("Score")]
public float FareAmount;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Microsoft.ML.AutoML\Microsoft.ML.AutoML.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using System;
using System.IO;
using System.Linq;
using Microsoft.ML.AutoML;
using Microsoft.ML.Data;

namespace Microsoft.ML.AutoML.Samples
{
public static class MulticlassClassificationExperiment
{
private static string TrainDataPath = "<Path to your train dataset goes here>";
private static string TestDataPath = "<Path to your test dataset goes here>";
private static string ModelPath = @"<Desired model output directory goes here>\OptDigitsModel.zip";
private static string LabelColumnName = "Number";
private static uint ExperimentTime = 60;

public static void Run()
{
MLContext mlContext = new MLContext();

// STEP 1: Load data
IDataView trainDataView = mlContext.Data.LoadFromTextFile<PixelData>(TrainDataPath, separatorChar: ',');
IDataView testDataView = mlContext.Data.LoadFromTextFile<PixelData>(TestDataPath, separatorChar: ',');

// STEP 2: Run AutoML experiment
Console.WriteLine($"Running AutoML multiclass classification experiment for {ExperimentTime} seconds...");
ExperimentResult<MulticlassClassificationMetrics> experimentResult = mlContext.Auto()
.CreateMulticlassClassificationExperiment(ExperimentTime)
.Execute(trainDataView, LabelColumnName);

// STEP 3: Print metric from the best model
RunDetail<MulticlassClassificationMetrics> bestRun = experimentResult.BestRun;
Console.WriteLine($"Total models produced: {experimentResult.RunDetails.Count()}");
Console.WriteLine($"Best model's trainer: {bestRun.TrainerName}");
Console.WriteLine($"Metrics of best model from validation data --");
PrintMetrics(bestRun.ValidationMetrics);

// STEP 4: Evaluate test data
IDataView testDataViewWithBestScore = bestRun.Model.Transform(testDataView);
MulticlassClassificationMetrics testMetrics = mlContext.MulticlassClassification.Evaluate(testDataViewWithBestScore, labelColumnName: LabelColumnName);
Console.WriteLine($"Metrics of best model on test data --");
PrintMetrics(testMetrics);

// STEP 5: Save the best model for later deployment and inferencing
using (FileStream fs = File.Create(ModelPath))
mlContext.Model.Save(bestRun.Model, trainDataView.Schema, fs);

// STEP 6: Create prediction engine from the best trained model
var predictionEngine = mlContext.Model.CreatePredictionEngine<PixelData, PixelPrediction>(bestRun.Model);

// STEP 7: Initialize new pixel data, and get the predicted number
var testPixelData = new PixelData
{
PixelValues = new float[] { 0, 0, 1, 8, 15, 10, 0, 0, 0, 3, 13, 15, 14, 14, 0, 0, 0, 5, 10, 0, 10, 12, 0, 0, 0, 0, 3, 5, 15, 10, 2, 0, 0, 0, 16, 16, 16, 16, 12, 0, 0, 1, 8, 12, 14, 8, 3, 0, 0, 0, 0, 10, 13, 0, 0, 0, 0, 0, 0, 11, 9, 0, 0, 0 }
};
var prediction = predictionEngine.Predict(testPixelData);
Console.WriteLine($"Predicted number for test pixels: {prediction.Prediction}");

Console.WriteLine("Press any key to continue...");
Console.ReadKey();
}

private static void PrintMetrics(MulticlassClassificationMetrics metrics)
{
Console.WriteLine($"LogLoss: {metrics.LogLoss}");
Console.WriteLine($"LogLossReduction: {metrics.LogLossReduction}");
Console.WriteLine($"MacroAccuracy: {metrics.MacroAccuracy}");
Console.WriteLine($"MicroAccuracy: {metrics.MicroAccuracy}");
}
}
}
Loading