Skip to content

Instantly share code, notes, and snippets.


  • Microsoft Corp
  • Redmond, WA, U.S.
Block or report user

Report or block CESARDELATORRE

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
CESARDELATORRE / Breaking changes from ML.NET v0.9 to v0.10 impacting ML.NET
Last active Feb 8, 2019
Breaking changes from ML.NET v0.9 to v0.10 impacting ML.NET Samples
View Breaking changes from ML.NET v0.9 to v0.10 impacting ML.NET

The following are the breaking changes that were impacting the ML.NET samples (at when moving to v0.10:

  1. IDataView moved to a different NuGet package: a. Error: error CS0246: The type or namespace name 'IDataView' could not be found (are you missing a using directive or an assembly reference?) b. Fix: Add using Microsoft.Data.DataView; i. The new NuGet package is added automatically when using 0.10 version

  2. AsEnumerable() moved to mlContext.CreateEnumerable() a. Error: Severity Code Description Project File Line Suppression State

View Breaking changes from ML.NET v0.8 to v0.9 impacting ML.NET Samples
There are many more breaking changes in 0.9, but these are the ones that mostly the ML.NET samples faced when moving to v0.9:
1. MakePredictionFunction() --> CreatePredictionEngine() --> Based on my original feedback and this [issue](, since it creates an object, not a function..
2. The type or namespace name 'Microsoft.ML.Runtime' does not exist in the namespace 'Microsoft.ML' (Error: are you missing an assembly reference?)
a. Data attributes are now in: using Microsoft.ML.Data;
b. TextLoader and other types moved to using Microsoft.ML.Data;
c. Related, removed:
using Microsoft.ML.Runtime.Learners;
CESARDELATORRE / mlnet-static-api-not-using-dataset-file.cs
Last active Oct 3, 2018
ML.NET static API loading traing DataSet NOT from a file
View mlnet-static-api-not-using-dataset-file.cs
var dataReader = TextLoader.CreateReader(env,
c => (
CustomerId: c.LoadText(0),
ProductId: c.LoadText(1),
Quantity: c.LoadFloat(2),
Label: c.LoadBool(3)),
separator: ',', hasHeader: true);
FieldAwareFactorizationMachinePredictor pred = null;
var ctx = new BinaryClassificationContext(env);
Last active Jul 7, 2018
Adding FFM (FieldAwareFactorizationMachineBinaryClassifier) to ML.NET pipeline
View FFM.cs
pipeline.Add(new FieldAwareFactorizationMachineBinaryClassifier(){ LearningRate = 0.5f, Iter=2 });
CESARDELATORRE / export-onnx-model-from-mlnet-model.cs
Last active Jul 8, 2018
View export-onnx-model-from-mlnet-model.cs
var onnxPath = GetOutputPath(subDir, "SaveModelToOnnxTest.onnx");
var onnxAsJsonPath = GetOutputPath(subDir, "SaveModelToOnnxTest.json");
OnnxConverter converter = new OnnxConverter()
InputsToDrop = new[] { "Label" },
OutputsToDrop = new[] { "Label", "Features" },
Onnx = onnxPath,
Json = onnxAsJsonPath,
Domain = "com.mydomain"
View eShopOnContainers-CatalogAPI-Partial-docker-compose.override.yml
- ConnectionString=YOUR_VALUE
- ... Other Environment Variables
- "5101:80" # Important: In a production environment you should remove the external port (5101) kept here for microservice debugging purposes.
# The API Gateway redirects and access through the internal port (80).
View AddJwtBearer-ConfigureServices.cs
// prevent from mapping "sub" claim to nameidentifier.
var identityUrl = Configuration.GetValue<string>("IdentityUrl");
services.AddAuthentication(options =>
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
CESARDELATORRE / Sample-Authorize-Controller-Class.cs
Created May 15, 2018
View Sample-Authorize-Controller-Class.cs
namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers
public class BasketController : Controller
{ //...
View Sample-AuthenticationProviderKey-configuration.json
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
"Host": "basket.api",
"Port": 80
"UpstreamPathTemplate": "/api/{version}/b/{everything}",
CESARDELATORRE / Partial-eShopOnContainers-docker-compose.override.yml
Created May 15, 2018
View Partial-eShopOnContainers-docker-compose.override.yml
- IdentityUrl=http://identity.api
- "5200:80"
- ./src/ApiGateways/Mobile.Bff.Shopping/apigw:/app/configuration
You can’t perform that action at this time.