Skip to content

KeyType in example is invalid #3169

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

Closed
RileyAtWork opened this issue Apr 2, 2019 · 1 comment · Fixed by #3170
Closed

KeyType in example is invalid #3169

RileyAtWork opened this issue Apr 2, 2019 · 1 comment · Fixed by #3170
Assignees
Labels
documentation Related to documentation of ML.NET

Comments

@RileyAtWork
Copy link

[Enter feedback here]
In 0.11 KeyType only takes 1 parameter - 'ulong count'
class MatrixElement
{
// Matrix column index starts from firstColumnIndex and is at most firstColumnIndex+n-1.
// Contieuous=true means that all values from firstColumnIndex to firstColumnIndex+n-1 are allowed keys.
// [KeyType(Contiguous = true, Count = n, Min = firstColumnIndex)]
// public uint MatrixColumnIndex;
// Matrix row index starts from firstRowIndex and is at most firstRowIndex+m-1.
// Contieuous=true means that all values from firstRowIndex to firstRowIndex+m-1 are allowed keys.
[KeyType(Contiguous = true, Count = m, Min = firstRowIndex)]
public uint MatrixRowIndex;
// The rating at the MatrixColumnIndex-th column and the MatrixRowIndex-th row.
public float Value;
}

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@wschin wschin added the documentation Related to documentation of ML.NET label Apr 2, 2019
@wschin
Copy link
Member

wschin commented Apr 2, 2019

You're right. It should become something like this.

       // The following variables defines the shape of a (m+firstRowIndex)-by-(n+firstColumnIndex) matrix.
       const int firstRowIndex = 1;
       const int firstColumnIndex = 1;
       const int m = 60;
       const int n = 100;

       // A tuple of row index, column index, and rating. It specifies a value in the rating matrix.
       class MatrixElement
       {
           // Matrix column index starts from 0 and is at most firstColumnIndex+n-1.
           [KeyType(n + firstColumnIndex)]
           public uint MatrixColumnIndex;
           // Matrix row index starts from 0 and is at most firstRowIndex+m-1.
           [KeyType(m + firstRowIndex)]
           public uint MatrixRowIndex;
           // The rating at the MatrixColumnIndex-th column and the MatrixRowIndex-th row.
           public float Value;
       }

Basically, we now assume Contiguous is always true and Min is always zero.

@wschin wschin self-assigned this Apr 2, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Related to documentation of ML.NET
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants