Skip to content

Fix zero based key input from C# classes for matrix factorization #1507

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

Merged
merged 9 commits into from
Nov 5, 2018

Conversation

wschin
Copy link
Member

@wschin wschin commented Nov 2, 2018

Because of the getter in IDataView created from C# classes doesn't handle key properly, matrix factorization fails whenever there is a zero-based key input. This PR fixes this issue by modifying getter upon peek, which doesn't care key type at all. The major fix occurs in src/Microsoft.ML.Api/DataViewConstructionUtils.cs.
In addition, a test based on matrix factorization is made for preventing such an error from happening again in test/Microsoft.ML.Tests/TrainerEstimators/MatrixFactorizationTests.cs.

In addition, matrix factorization also got polished. We clean up unnecessary fields and make its comments better.

Fix #1442.

@wschin wschin self-assigned this Nov 2, 2018
@wschin wschin added bug Something isn't working enhancement New feature or request labels Nov 2, 2018
@wschin wschin changed the title [WIP] Fix zero based key input from C# classes for matrix factorization Fix zero based key input from C# classes for matrix factorization Nov 2, 2018
Copy link
Contributor

@Zruty0 Zruty0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Contributor

@TomFinley TomFinley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wschin !!

@wschin wschin merged commit 73762a8 into dotnet:master Nov 5, 2018
@wschin wschin deleted the fix-mf-zero-based-key branch November 5, 2018 21:50
@ghost ghost locked as resolved and limited conversation to collaborators Mar 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Matrix Factorization Doesn't Support Key Starting with 0
3 participants