-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix creation of dataviews inferred with .NET types with sparse vectors #587
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
Conversation
Done(); | ||
} | ||
|
||
void GenericDenseDataView<T>(T[] v1, T[] v2) |
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.
void [](start = 8, length = 4)
Explicit access modifier please. Here and everywhere.
|
||
namespace Microsoft.ML.Runtime.RunTests | ||
{ | ||
public sealed partial class TestSparseDataView : TestDataViewBase |
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.
partial [](start = 18, length = 7)
Why partial?
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.
Copy paste without thinking :)
Hi @xadupre thanks for adding this fix plus the extensive tests. Right now the PR description is just the default description. Perhaps something real could be written there. If we were to merge right now it would be very hard to come up with an adequate commit message. (Complicated also by the fact that this PR appears to be based on merges rather than rebases.) Also if you write something like "fixes #586" in your description, then it will associate the issue and the PR, and close the issue when the PR is merged. You put the thing in the title, but if you check the issue page it was not actually associated. (Well, it will be now since I just mentioned it, but of course as the PR author it should be in the head description, rather than some random reviewer mentioning it in a comment far down the page. |
using System.Linq; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.ML.Runtime.Command; |
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.
I'm fairly certain not all of these are used.
new SparseExample<T>() { X = new VBuffer<T> (5, 3, v1, new int[] { 0, 2, 4 }) }, | ||
new SparseExample<T>() { X = new VBuffer<T> (5, 3, v2, new int[] { 0, 1, 3 }) } | ||
}; | ||
var host = new TlcEnvironment(); |
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.
var host = new TlcEnvironment(); [](start = 12, length = 32)
can you wrap it in using? #Resolved
GenericSparseDataView(new double[] { 1, 2, 3 }, new double[] { 1, 10, 100 }); | ||
GenericSparseDataView(new DvText[] { new DvText("a"), new DvText("b"), new DvText("c") }, | ||
new DvText[] { new DvText("aa"), new DvText("bb"), new DvText("cc") }); | ||
Done(); |
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.
Done(); [](start = 12, length = 7)
You don't have to call Done if you don't do any basefiles comparison #Resolved
Assert.True(n == 2); | ||
} | ||
|
||
[Fact] |
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.
Fact [](start = 9, length = 4)
Thank you for fixing my mess!
Your code definitely do right thing, and it's nice to have tests, but I want to point one thing. Your tests never hit TypedCursor changes.
There is two conversions: one from some collection to IDataview through code in DataViewConstructionUltis, and from IDataVIew to Collection via TypedCursor and your tests cover only first case.
In order to invoke second case you need to do something like:
dataView.AsEnumerable(env, false).GetEnumerator() and enumerate over it.
#Resolved
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.
I'll do it. #Resolved
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.
Hi @xadupre thanks for addressing the comment! Clarifying note for the future, when I asked to modify the description, I meant the PR's description, not the PR's title. The description is still the little "we are excited to review your PR" built in text that we intend for people to write. I hope you don't mind, just going to change it so we can get this in since otherwise it looks good. |
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.
Thanks @xadupre
Hi,
Sorry for that. I did not read this part, I just checked the checkboxes. I looked into the template used by scikit-learn and the text I forgot to replace was commented out (HTML comment) and here is the discussion about it (scikit-learn/scikit-learn#6470). That might be a good idea for us too.
Xavier
Sent from Outlook<http://aka.ms/weboutlook>
…________________________________
De : Tom Finley <notifications@github.com>
Envoyé : samedi 28 juillet 2018 16:59
À : dotnet/machinelearning
Cc : Xavier Dupre; Mention
Objet : Re: [dotnet/machinelearning] Fixes #586, the creation of getters on dataviews having sparse vectors (#587)
Hi @xadupre<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fxadupre&data=02%7C01%7Cxadupre%40microsoft.com%7Cbaa687d82f064276dfc808d5f49aa905%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636683867461378704&sdata=44hUPnHMRw855yU6XeDRnBVJqt5AbS8D47Xo3hpzsMU%3D&reserved=0> thanks for addressing the comment! Clarifying note for the future, when I asked to modify the description, I meant the PR's description, not the PR's title. The description is still the little "we are excited to review your PR" built in text that we intend for people to write. I hope you don't mind, just going to change it so we can get this in since otherwise it looks good.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fmachinelearning%2Fpull%2F587%23issuecomment-408613481&data=02%7C01%7Cxadupre%40microsoft.com%7Cbaa687d82f064276dfc808d5f49aa905%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636683867461378704&sdata=hTqY1KEejcLiOP%2FdPGGrE8PnSXAvHwMMHhQ%2BE8NgQp4%3D&reserved=0>, or mute the thread<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAVaaLWE3ZD_HevTsQpdsPZCEJWuaEyMOks5uLHw3gaJpZM4VjH0j&data=02%7C01%7Cxadupre%40microsoft.com%7Cbaa687d82f064276dfc808d5f49aa905%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636683867461388711&sdata=jZxqC736MCPKl4JydC0GK8w4F2XjXeR0BxY9eGZwnGo%3D&reserved=0>.
|
dotnet#587) `DataViewConstructionUtils`'s methods to create dataviews over .NET types will now have correctly inferred "getters" in the case of sparse vectors.
Fixes #586.
DataViewConstructionUtils
's methods to create dataviews over .NET types will now have correctly inferred getters in the case of sparse vectors.