-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add ML.NET notes from session 5 #81
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Microsoft.ML | ||
|
||
Status: **Needs more work** | ||
|
||
## Notes | ||
|
||
* `MLContext` | ||
- Solves two problems: the chaining for `IHostEnvironment` and the | ||
discoverability for finding implementations of common abstraction. | ||
- They are solved by offering extension methods | ||
- We should align the naming of `XxxCatalog` with `XxxContext` | ||
- It's a bit odd that the constructor uses nullability to indicate default, | ||
but sentinel values seem more problem. Overloads don't work very well | ||
because the types are the same and it will force people to specify value | ||
of the other. Easiest solution might be to make both nullable. Still not | ||
idiomatic API design, but at least consistent. | ||
* [Typical example](https://dotnet.microsoft.com/learn/machinelearning-ai/ml-dotnet-get-started-tutorial) | ||
- Most of the methods aren't verbs; instead of `TextReader()` it should be | ||
`CreateTextReader()` | ||
- We should have a pattern for the arguments: | ||
- Simple set of arguments should just be parameters | ||
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. This is captured in existing issues but to reinforce also mentioned it as a subitem in a new issue as well. |
||
- More complicated arguments should be an option class that is mutable | ||
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. Entered as this issue, this was a fairly lengthy discussion that went into more things than are captured in this paragraph so it's possible I forgot something in the issue, let me know if so. |
||
- Some types probably want to offer discrete parameters for convenience | ||
while also being able to accept more complex options. The overloads | ||
should never mix them as this would create conflicts which value | ||
"wins". | ||
- Example: | ||
```C# | ||
var options = new TextFileSource.Options(); | ||
options.Separator = ",", | ||
options.HasHeader = true, | ||
options.Column.Add("SepalLength", DataKind.R4, 0); | ||
options.Column.Add("SepalWidth", DataKind.R4, 1); | ||
options.Column.Add("PetalLength", DataKind.R4, 2); | ||
options.Column.Add("PetalWidth", DataKind.R4, 3); | ||
options.Column.Add("Label", DataKind.Text, 4); | ||
|
||
var reader = mlContext.Data.CreateTextFileSource(options); | ||
``` | ||
- Tom check what you were plan on checking :-) | ||
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. It turns out the answer was, "we did both." 😛 Issue here. |
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.
Issue here.