Skip to content

Commit

Permalink
Samples migration to v1.4 GA (dotnet#738)
Browse files Browse the repository at this point in the history
* Fixed file path for TaxiFarePrediction.Explainability

* Update to ML.NET 1.4 RC1

* BaseLine: Image Classification DNN-based sample updated to  ML.NET 1.4 GA

* Updates measuring Prediction times

* Update with code with explicit hyper-parameters

* Samples migrated to public ML.NET 1.4 Preview3 drop-build

* Samples code migrated to ML.NET 1.4

* Added sample BikeSharing-TimeSeries-Forecast-And-DB to Preview Solution

* Version v1.4 updated to all needed README.MD
  • Loading branch information
CESARDELATORRE authored Nov 6, 2019
1 parent 737bfc6 commit a980200
Show file tree
Hide file tree
Showing 104 changed files with 6,135 additions and 4,097 deletions.
4 changes: 2 additions & 2 deletions samples/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>

<PropertyGroup>
<MicrosoftMLVersion>1.3.1</MicrosoftMLVersion>
<MicrosoftMLPreviewVersion>0.15.1</MicrosoftMLPreviewVersion>
<MicrosoftMLVersion>1.4.0</MicrosoftMLVersion>
<MicrosoftMLPreviewVersion>0.16.0</MicrosoftMLPreviewVersion>
</PropertyGroup>

</Project>
87 changes: 55 additions & 32 deletions samples/csharp/Samples-Using-Preview.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,79 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29009.5
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DatabaseLoader.Solution", "DatabaseLoader.Solution", "{A3FA08DD-A8B7-4B65-9BBB-FE137FFF5098}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MovieRecommendation.Solution", "MovieRecommendation.Solution", "{A7836E64-C522-4236-8B31-0A360C2CA9ED}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ImageClassificationModelTraining.Solution", "ImageClassificationModelTraining.Solution", "{58888D0A-8521-4544-8CB7-A4151630EF77}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MovieRecommendation", "getting-started\MatrixFactorization_MovieRecommendation\MovieRecommendation\MovieRecommendation.csproj", "{39070118-6DFD-401F-8396-E1036F0C598C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DatabaseLoaderConsoleApp", "getting-started\DatabaseLoader\DatabaseLoaderConsoleApp\DatabaseLoaderConsoleApp.csproj", "{5A86174B-C49B-4C16-8CC6-2EA7C770A4F7}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "1. GettingStarted samples", "1. GettingStarted samples", "{50C6D192-D2F6-4275-B5DB-00DC85A1FA88}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageClassification.Predict", "getting-started\DeepLearning_ImageClassification_Training\ImageClassification.Predict\ImageClassification.Predict.csproj", "{73E98D88-1A4F-4328-BCF7-8191AF788586}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2. End-to-end apps", "2. End-to-end apps", "{F1E210B3-F333-479D-A40F-8CE10DCD6E1E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageClassification.Train", "getting-started\DeepLearning_ImageClassification_Training\ImageClassification.Train\ImageClassification.Train.csproj", "{5D928947-78DD-412B-8A40-2EB5A72A6144}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ProductRecommendation.Solution", "ProductRecommendation.Solution", "{FF92F77A-4D79-42DB-BCCE-2C49B6CCE6B3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageClassification.Shared", "getting-started\DeepLearning_ImageClassification_Training\ImageClassification.Shared\ImageClassification.Shared.csproj", "{1472A4E8-91D5-4738-98E0-7BA2D1C8DE5D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductRecommender", "getting-started\MatrixFactorization_ProductRecommendation\ProductRecommender\ProductRecommender.csproj", "{833EEC6A-F866-4052-ACE2-8D7E72E7862D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageClassification.WebApp", "getting-started\DeepLearning_ImageClassification_Training\WebApp.Predict\ImageClassification.WebApp.csproj", "{677BDA3F-C9AE-4F35-A12C-C4F9257FF00E}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ImageBinaryClassificationModelTraining.Solution", "ImageBinaryClassificationModelTraining.Solution", "{4C0827DD-9212-485B-B3A7-D7969AFD9328}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeepLearning_ImageClassification_Binary", "getting-started\DeepLearning_ImageClassification_Binary\DeepLearning_ImageClassification_Binary\DeepLearning_ImageClassification_Binary.csproj", "{147DAD69-AAB4-47FF-805F-53B3E9299D02}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BikeSharing-TimeSeries-Forecast-And-DB", "BikeSharing-TimeSeries-Forecast-And-DB", "{1EA75CE9-074B-444F-A4F9-AA3C6607BB2B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BikeDemandForecasting", "getting-started\Forecasting_BikeSharingDemand\BikeDemandForecasting\BikeDemandForecasting.csproj", "{68FFA3D0-A818-4767-89CC-821FB6F8EAEC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5A86174B-C49B-4C16-8CC6-2EA7C770A4F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5A86174B-C49B-4C16-8CC6-2EA7C770A4F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A86174B-C49B-4C16-8CC6-2EA7C770A4F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A86174B-C49B-4C16-8CC6-2EA7C770A4F7}.Release|Any CPU.Build.0 = Release|Any CPU
{73E98D88-1A4F-4328-BCF7-8191AF788586}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{73E98D88-1A4F-4328-BCF7-8191AF788586}.Debug|Any CPU.Build.0 = Debug|Any CPU
{73E98D88-1A4F-4328-BCF7-8191AF788586}.Release|Any CPU.ActiveCfg = Release|Any CPU
{73E98D88-1A4F-4328-BCF7-8191AF788586}.Release|Any CPU.Build.0 = Release|Any CPU
{5D928947-78DD-412B-8A40-2EB5A72A6144}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D928947-78DD-412B-8A40-2EB5A72A6144}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D928947-78DD-412B-8A40-2EB5A72A6144}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D928947-78DD-412B-8A40-2EB5A72A6144}.Release|Any CPU.Build.0 = Release|Any CPU
{1472A4E8-91D5-4738-98E0-7BA2D1C8DE5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1472A4E8-91D5-4738-98E0-7BA2D1C8DE5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1472A4E8-91D5-4738-98E0-7BA2D1C8DE5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1472A4E8-91D5-4738-98E0-7BA2D1C8DE5D}.Release|Any CPU.Build.0 = Release|Any CPU
{677BDA3F-C9AE-4F35-A12C-C4F9257FF00E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{677BDA3F-C9AE-4F35-A12C-C4F9257FF00E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{677BDA3F-C9AE-4F35-A12C-C4F9257FF00E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{677BDA3F-C9AE-4F35-A12C-C4F9257FF00E}.Release|Any CPU.Build.0 = Release|Any CPU
{39070118-6DFD-401F-8396-E1036F0C598C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39070118-6DFD-401F-8396-E1036F0C598C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39070118-6DFD-401F-8396-E1036F0C598C}.Debug|x64.ActiveCfg = Debug|Any CPU
{39070118-6DFD-401F-8396-E1036F0C598C}.Debug|x64.Build.0 = Debug|Any CPU
{39070118-6DFD-401F-8396-E1036F0C598C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39070118-6DFD-401F-8396-E1036F0C598C}.Release|Any CPU.Build.0 = Release|Any CPU
{39070118-6DFD-401F-8396-E1036F0C598C}.Release|x64.ActiveCfg = Release|Any CPU
{39070118-6DFD-401F-8396-E1036F0C598C}.Release|x64.Build.0 = Release|Any CPU
{833EEC6A-F866-4052-ACE2-8D7E72E7862D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{833EEC6A-F866-4052-ACE2-8D7E72E7862D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{833EEC6A-F866-4052-ACE2-8D7E72E7862D}.Debug|x64.ActiveCfg = Debug|x64
{833EEC6A-F866-4052-ACE2-8D7E72E7862D}.Debug|x64.Build.0 = Debug|x64
{833EEC6A-F866-4052-ACE2-8D7E72E7862D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{833EEC6A-F866-4052-ACE2-8D7E72E7862D}.Release|Any CPU.Build.0 = Release|Any CPU
{833EEC6A-F866-4052-ACE2-8D7E72E7862D}.Release|x64.ActiveCfg = Release|x64
{833EEC6A-F866-4052-ACE2-8D7E72E7862D}.Release|x64.Build.0 = Release|x64
{147DAD69-AAB4-47FF-805F-53B3E9299D02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{147DAD69-AAB4-47FF-805F-53B3E9299D02}.Debug|Any CPU.Build.0 = Debug|Any CPU
{147DAD69-AAB4-47FF-805F-53B3E9299D02}.Debug|x64.ActiveCfg = Debug|Any CPU
{147DAD69-AAB4-47FF-805F-53B3E9299D02}.Debug|x64.Build.0 = Debug|Any CPU
{147DAD69-AAB4-47FF-805F-53B3E9299D02}.Release|Any CPU.ActiveCfg = Release|Any CPU
{147DAD69-AAB4-47FF-805F-53B3E9299D02}.Release|Any CPU.Build.0 = Release|Any CPU
{147DAD69-AAB4-47FF-805F-53B3E9299D02}.Release|x64.ActiveCfg = Release|Any CPU
{147DAD69-AAB4-47FF-805F-53B3E9299D02}.Release|x64.Build.0 = Release|Any CPU
{68FFA3D0-A818-4767-89CC-821FB6F8EAEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{68FFA3D0-A818-4767-89CC-821FB6F8EAEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{68FFA3D0-A818-4767-89CC-821FB6F8EAEC}.Debug|x64.ActiveCfg = Debug|Any CPU
{68FFA3D0-A818-4767-89CC-821FB6F8EAEC}.Debug|x64.Build.0 = Debug|Any CPU
{68FFA3D0-A818-4767-89CC-821FB6F8EAEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{68FFA3D0-A818-4767-89CC-821FB6F8EAEC}.Release|Any CPU.Build.0 = Release|Any CPU
{68FFA3D0-A818-4767-89CC-821FB6F8EAEC}.Release|x64.ActiveCfg = Release|Any CPU
{68FFA3D0-A818-4767-89CC-821FB6F8EAEC}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5A86174B-C49B-4C16-8CC6-2EA7C770A4F7} = {A3FA08DD-A8B7-4B65-9BBB-FE137FFF5098}
{73E98D88-1A4F-4328-BCF7-8191AF788586} = {58888D0A-8521-4544-8CB7-A4151630EF77}
{5D928947-78DD-412B-8A40-2EB5A72A6144} = {58888D0A-8521-4544-8CB7-A4151630EF77}
{1472A4E8-91D5-4738-98E0-7BA2D1C8DE5D} = {58888D0A-8521-4544-8CB7-A4151630EF77}
{677BDA3F-C9AE-4F35-A12C-C4F9257FF00E} = {58888D0A-8521-4544-8CB7-A4151630EF77}
{A7836E64-C522-4236-8B31-0A360C2CA9ED} = {50C6D192-D2F6-4275-B5DB-00DC85A1FA88}
{39070118-6DFD-401F-8396-E1036F0C598C} = {A7836E64-C522-4236-8B31-0A360C2CA9ED}
{FF92F77A-4D79-42DB-BCCE-2C49B6CCE6B3} = {50C6D192-D2F6-4275-B5DB-00DC85A1FA88}
{833EEC6A-F866-4052-ACE2-8D7E72E7862D} = {FF92F77A-4D79-42DB-BCCE-2C49B6CCE6B3}
{4C0827DD-9212-485B-B3A7-D7969AFD9328} = {50C6D192-D2F6-4275-B5DB-00DC85A1FA88}
{147DAD69-AAB4-47FF-805F-53B3E9299D02} = {4C0827DD-9212-485B-B3A7-D7969AFD9328}
{1EA75CE9-074B-444F-A4F9-AA3C6607BB2B} = {50C6D192-D2F6-4275-B5DB-00DC85A1FA88}
{68FFA3D0-A818-4767-89CC-821FB6F8EAEC} = {1EA75CE9-074B-444F-A4F9-AA3C6607BB2B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {98369941-33DD-450C-A410-B9A91C8CDE91}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| ML.NET version | API type | Status | App Type | Data type | Scenario | ML Task | Algorithms |
|----------------|-------------------|-------------------------------|-------------|-----------|---------------------|---------------------------|-----------------------------|
| v1.3.1 | Dynamic API | Up-to-date | WinForms app | .csv files | Spike and Change Point Detection of Product Sales | Anomaly Detection | IID Spike Detection and IID Change point Detection |
| v1.4 | Dynamic API | Up-to-date | WinForms app | .csv files | Spike and Change Point Detection of Product Sales | Anomaly Detection | IID Spike Detection and IID Change point Detection |

![Alt Text](./SpikeDetectionE2EApp/SpikeDetection.WinForms/images/productsales.gif)

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public partial class Form1 : Form
private string filePath = "";
Tuple<string, string> tup = null;
Dictionary<int, Tuple<string, string>> dict = new Dictionary<int, Tuple<string, string>>();
private static string BaseModelsRelativePath = @"../../../MLModels";
private static string BaseModelsRelativePath = @"../../../../MLModels";
private static string ModelRelativePath1 = $"{BaseModelsRelativePath}/ProductSalesSpikeModel.zip";
private static string ModelRelativePath2 = $"{BaseModelsRelativePath}/ProductSalesChangePointModel.zip";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,31 +118,31 @@
<Version>$(MicrosoftMLVersion)</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>10.0.3</Version>
<Version>12.0.2</Version>
</PackageReference>
<PackageReference Include="System.Buffers">
<Version>4.4.0</Version>
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="System.CodeDom">
<Version>4.4.0</Version>
<Version>4.6.0</Version>
</PackageReference>
<PackageReference Include="System.Collections.Immutable">
<Version>1.5.0</Version>
<Version>1.6.0</Version>
</PackageReference>
<PackageReference Include="System.Memory">
<Version>4.5.1</Version>
<Version>4.5.3</Version>
</PackageReference>
<PackageReference Include="System.Numerics.Vectors">
<Version>4.4.0</Version>
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="System.Reflection.Emit.Lightweight">
<Version>4.3.0</Version>
<Version>4.6.0</Version>
</PackageReference>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe">
<Version>4.5.0</Version>
<Version>4.6.0</Version>
</PackageReference>
<PackageReference Include="System.Threading.Tasks.Dataflow">
<Version>4.8.0</Version>
<Version>4.10.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| ML.NET version | API type | Status | App Type | Data type | Scenario | ML Task | Algorithms |
|----------------|-------------------|-------------------------------|-------------|-----------|---------------------|---------------------------|-----------------------------|
| v1.3.1 | Dynamic API | up-to-date | Console app | Images and text labels | Images classification | TensorFlow model | DeepLearning model |
| v1.4 | Dynamic API | up-to-date | Console app | Images and text labels | Images classification | TensorFlow model | DeepLearning model |


## Problem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.ML" Version="$(MicrosoftMLPreviewVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
<PackageReference Include="Microsoft.Extensions.ML" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML.ImageAnalytics" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML.TensorFlow" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="1.15.0" />
</ItemGroup>


<ItemGroup>
<Folder Include="ImageHelpers\" />
<Folder Include="ML\TensorFlowModel\" />
Expand Down
2 changes: 1 addition & 1 deletion samples/csharp/end-to-end-apps/Forecasting-Sales/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| ML.NET version | API type | Status | App Type | Data type | Scenario | ML Task | Algorithms |
|----------------|-------------|------------|--------------------------------------|---------------------------|----------------|-------------------------|------------------------------------------------------|
| v1.3.1 | Dynamic API | Up-to-date | ASP.NET Core web app and Console app | SQL Server and .csv files | Sales forecast | Regression, Time Series | FastTreeTweedie Regression, Single Spectrum Analysis |
| v1.4 | Dynamic API | Up-to-date | ASP.NET Core web app and Console app | SQL Server and .csv files | Sales forecast | Regression, Time Series | FastTreeTweedie Regression, Single Spectrum Analysis |

eShopDashboardML is a web app with Sales Forecast predictions (per product) using [Microsoft Machine Learning .NET (ML.NET)](https://github.com/dotnet/machinelearning).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Microsoft.Extensions.ML;
using Microsoft.ML;
using Serilog;
using System;

namespace eShopDashboard
{
Expand All @@ -29,11 +30,15 @@ public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<CatalogContext>(options =>
options.UseSqlServer(
Configuration.GetConnectionString("DefaultConnection")));
Configuration.GetConnectionString("DefaultConnection"),
opts => opts.CommandTimeout((int)TimeSpan.FromMinutes(20).TotalSeconds)
));

services.AddDbContext<OrderingContext>(options =>
options.UseSqlServer(
Configuration.GetConnectionString("DefaultConnection")));
Configuration.GetConnectionString("DefaultConnection"),
opts => opts.CommandTimeout((int)TimeSpan.FromMinutes(20).TotalSeconds)
));

services.AddScoped<IOrderingQueries, OrderingQueries>();
services.AddScoped<ICatalogQueries, CatalogQueries>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb; Database=eShopDashboard; Trusted_Connection=True; MultipleActiveResultSets=true"
"DefaultConnection": "Server=(localdb)\\mssqllocaldb; Database=eShopDashboard; Trusted_Connection=True; MultipleActiveResultSets=true; Connection Timeout=60"
},
"CatalogSettings": {
"AzurePicBasUrl": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ItemGroup>
<PackageReference Include="Dapper.StrongName" Version="1.50.5" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Extensions.ML" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML.FastTree" Version="$(MicrosoftMLVersion)" />
<PackageReference Include="Microsoft.ML.TimeSeries" Version="$(MicrosoftMLVersion)" />
Expand All @@ -21,7 +22,6 @@
<PackageReference Include="Serilog.Sinks.Seq" Version="4.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="TinyCsvParser" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.ML" Version="$(MicrosoftMLPreviewVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit a980200

Please sign in to comment.