-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Added Microsoft.ML.Benchmarks Project #62
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
Changes from 1 commit
1088d68
0f5ce0c
1647ef5
2b163cf
335ead1
cf144ab
63fcb8a
8db49d0
0a281b2
b9b91e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,28 @@ | |
// See the LICENSE file in the project root for more information. | ||
|
||
using BenchmarkDotNet.Attributes; | ||
using BenchmarkDotNet.Running; | ||
using Microsoft.ML.Models; | ||
using Microsoft.ML.Runtime.Api; | ||
using Microsoft.ML.Trainers; | ||
using Microsoft.ML.Transforms; | ||
|
||
|
||
namespace Microsoft.ML.Benchmarks | ||
{ | ||
[KeepBenchmarkFiles] | ||
public class TrainPredictionBench | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Split benchmarks by task (regression, binary, etc). You already have classification metrics as a field. Perhaps have a base class and then subclasses for each task. #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed the test to StochasticDualCoordinateAscentClassifierBench #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you please update the file name to match the class name? In reply to: 187243814 [](ancestors = 187243814,187092340) |
||
{ | ||
internal static ClassificationMetrics s_metrics; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Would also be awesome to figure out how to minimize the amount of code per dataset. so that you can just add a dataset and then not have to change much else There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this is a good idea, but I think such generalizations are best done when actually trying to develop the second, third, etc. test. i.e. I will try to do it when I am adding more tests. #Closed |
||
static PredictionModel<IrisData, IrisPrediction> s_trainedModel; | ||
|
||
[GlobalCleanup] | ||
public void Accuracy() | ||
{ | ||
var dataPath = Program.GetDataPath("iris.txt"); | ||
var testData = new TextLoader<IrisData>(dataPath, useHeader: true, separator: "tab"); | ||
var evaluator = new ClassificationEvaluator(); | ||
s_metrics = evaluator.Evaluate(s_trainedModel, testData); | ||
} | ||
|
||
[Benchmark] | ||
public void Iris() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible for us to mark a bunch of integration tests as benchmarks in this way? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They would need to be a part of an exe project (like this one). But maybe we can try to expose the integration tests in public APIs (of the test project) and then just run them from a benchmark stub in this project. @adamsitnik? #Pending There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now there are at least two possible ways to do this: Create those items as unit tests (comment above) OR, use a general-purpose command line tool to execute specific pipelines. In reply to: 186589537 [](ancestors = 186589537) |
||
{ | ||
|
@@ -50,6 +62,8 @@ public void Iris() | |
PetalLength = 1.2f, | ||
PetalWidth = 4.4f, | ||
}); | ||
|
||
s_trainedModel = model; | ||
} | ||
|
||
public class IrisData | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this used for? I've never seen this in new SDK-style projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I remove it, it tells me there is more than one entry point and so the one real one must be specified. Possibly one of the BDN dlls has a Main method? @adamsitnik?