Skip to content

Instantly share code, notes, and snippets.

Cesar De la Torre CESARDELATORRE

  • 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
CESARDELATORRE / Breaking changes from ML.NET v0.9 to v0.10 impacting ML.NET Samples.md
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 Samples.md

The following are the breaking changes that were impacting the ML.NET samples (at https://github.com/dotnet/machinelearning-samples) 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](https://github.com/dotnet/machinelearning/issues/1761), 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
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);
@CESARDELATORRE
CESARDELATORRE / FFM.cs
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
CESARDELATORRE / export-onnx-model-from-mlnet-model.cs
Last active Jul 8, 2018
export-onnx-model-from-mlnet-model
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
catalog.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=YOUR_VALUE
- ... Other Environment Variables
ports:
- "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.
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
var identityUrl = Configuration.GetValue<string>("IdentityUrl");
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
@CESARDELATORRE
CESARDELATORRE / Sample-Authorize-Controller-Class.cs
Created May 15, 2018
Sample-Authorize-Controller-Class.cs
View Sample-Authorize-Controller-Class.cs
namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers
{
[Route("api/v1/[controller]")]
[Authorize]
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
CESARDELATORRE / Partial-eShopOnContainers-docker-compose.override.yml
Created May 15, 2018
Partial-eShopOnContainers-docker-compose.override.yml
View Partial-eShopOnContainers-docker-compose.override.yml
mobileshoppingapigw:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- IdentityUrl=http://identity.api
ports:
- "5200:80"
volumes:
- ./src/ApiGateways/Mobile.Bff.Shopping/apigw:/app/configuration
mobilemarketingapigw:
You can’t perform that action at this time.