You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why Examples?
To simplify getting-started for ml.net add examples for different ML tasks like regression, binary and multi-class classification. In the future examples should also demonstrate how to use different transforms, transforms with hyper-parameters, learners and more. This will allow ML.NET users to have a great getting started experience OOTB and also help build models specific to their problem sets.
What should we do?
There are a few kind of examples/samples required. 1. and 2. should be available as a part of the dotnet/machinelearning/samples location. For 3. we should find a place to host them separate to this repository.
1. First Touch with ML.NET:
- Simple, getting started, Quick-Starts, F5-able in Visual Studio/VS Code and dot-net CLI
e.g. Taxi Fare, Sentiment Analysis, Iris etc.
2. ML.NET usage:
- How to use different features in ML.NET: CV vs. train-test, using different transforms, learners etc.
3. End-End samples
- Real world apps like ASP.NET apps(eshop), Cloud Native apps demonstrating how a productized,
real world sample app will look like with ML.NET
Thoughts?
Reacted by Xiangyang (Mark) Guo, mltf, Adam Shakhabov and Raul Schnelzer
Awesome! Especially the thoughts about asp.net app. For the easy examples should not forget other languages : powershell, F#, VB.NET and Python? Python has an extrem nice .NET interface. Just to show : ML.NET for any language. ;)
// Learn more about F# at http://fsharp.orgopenMicrosoft.MLopenMicrosoft.ML.Runtime.ApiopenMicrosoft.ML.TrainersopenMicrosoft.ML.TransformsopenSystem//The first four properties are inputs, the label is what you are predicting which is set in trainingtypeIrisData()=[<Column("0")>][<DefaultValue>]val mutablepublicSepalLength:float32[<Column("1")>][<DefaultValue>]val mutablepublicSepalWidth:float32[<Column("2")>][<DefaultValue>]val mutablepublicPetalLength:float32[<Column("3")>][<DefaultValue>]val mutablepublicPetalWidth:float32[<Column("4")>][<ColumnName("Label")>][<DefaultValue>]val mutablepublicLabel:string//Result returned from the prediction operationtypeIrisPrediction()=[<ColumnName("PredictedLabel")>][<DefaultValue>]val mutablepublicPredictedLabel:string[<EntryPoint>]letmain argv =//Create a pipelineletpipeline=new LearningPipeline()letdataPath="iris-data.txt"//Loads CSV data
pipeline.Add(new TextLoader<IrisData>(dataPath,separator =","))//Transforms the label into an "enum" because only numbers can be processed during training
pipeline.Add(new Transforms.Dictionarizer("Label"))//Transforms all features into one vector
pipeline.Add(new Transforms.ColumnConcatenator("Features","SepalLength","SepalWidth","PetalLength","PetalWidth"))//applies a learning algorithm
pipeline.Add(new Trainers.StochasticDualCoordinateAscentClassifier())//Transforms the label back into the original text
pipeline.Add(new Transforms.PredictedLabelColumnOriginalValueConverter(PredictedLabelColumn ="PredictedLabel"))//Train the modelletmodel= pipeline.Train<IrisData, IrisPrediction>()//Initialize the data we hope to testletx= IrisData()
x.SepalLength <-3.3f
x.SepalWidth <-1.6f
x.PetalLength <-0.2f
x.PetalWidth <-5.1f
//predict the label from the trained modelletprediction= model.Predict(x)
printfn "Predicted flower type is: %s" prediction.PredictedLabel
Console.ReadLine ()|> ignore
0// return an integer exit code
I prefixed Transforms and Trainers because I thought the organization helped.
Unhandled Exception: System.InvalidOperationException: Training set has 0 instances, aborting training.
at Microsoft.ML.Trainers.SdcaTrainerBase3.TrainCore(IChannel ch, RoleMappedData data, LinearModelParameters predictor, Int32 weightSetCount) at Microsoft.ML.Learners.StochasticTrainerBase2.TrainModelCore(TrainContext context)
at Microsoft.ML.Training.TrainerEstimatorBase2.Fit(IDataView input) at Microsoft.ML.Data.EstimatorChain1.Fit(IDataView input)
at mlTut2.Program.Main(String[] args) in C:\Users******\source\repos\ml.net-quickstart\mlTut2\Program.cs:line 64
After chasing my tail for several hours I noticed that in the Iris class I wrote the Label Property to have a type of float. He doesn't seem to have done the same but it may be noteworthy due to the fact that in both cases the training set is said to have 0 instances. In my case it seemed to have been due to an inability to parse a string as a float.
Activity
dotChris90 commentedon May 14, 2018
Awesome! Especially the thoughts about asp.net app. For the easy examples should not forget other languages : powershell, F#, VB.NET and Python? Python has an extrem nice .NET interface. Just to show : ML.NET for any language. ;)
1 remaining item
voronoipotato commentedon May 31, 2018
I prefixed Transforms and Trainers because I thought the organization helped.
shauheen commentedon Jul 5, 2018
This work was moved to its own proper repo here. Closing the issue.
DannyZaca84 commentedon Oct 31, 2018
I'm having this problem and I can't find a solution
gethari commentedon Dec 24, 2018
Any update on this ? I'm facing same thing too
jwood803 commentedon Dec 25, 2018
@DannyZaca84 @hariharan618 The error looks like the training data may not have any data in it, from what I can tell.
leot42 commentedon Jan 28, 2019
I ran into same issue in C#. With the error of:
Microsoft.ML.Data.TextLoader+BoundLoader
Unhandled Exception: System.InvalidOperationException: Training set has 0 instances, aborting training.
at Microsoft.ML.Trainers.SdcaTrainerBase
3.TrainCore(IChannel ch, RoleMappedData data, LinearModelParameters predictor, Int32 weightSetCount) at Microsoft.ML.Learners.StochasticTrainerBase2.TrainModelCore(TrainContext context)at Microsoft.ML.Training.TrainerEstimatorBase
2.Fit(IDataView input) at Microsoft.ML.Data.EstimatorChain1.Fit(IDataView input)at mlTut2.Program.Main(String[] args) in C:\Users******\source\repos\ml.net-quickstart\mlTut2\Program.cs:line 64
After chasing my tail for several hours I noticed that in the Iris class I wrote the Label Property to have a type of float. He doesn't seem to have done the same but it may be noteworthy due to the fact that in both cases the training set is said to have 0 instances. In my case it seemed to have been due to an inability to parse a string as a float.
changed CreateTextLoader to ReadFromTextFile method. (dotnet#140)
code migration from machinelearning-automl to machinelearning repo fe…
changed CreateTextLoader to ReadFromTextFile method. (dotnet#140)
Added onnx export functionality for LpNormNormalizingTransformer (#4161)
Added Onnx export functionality to PCATransformer (#4188)