Open sergey-tihon opened 3 years ago
@luisquintanilla
Thanks for opening this issue @sergey-tihon. I've tagged myself and will take a look.
Thank you @lqdev ! Appreciate if you suggest simpler way for add Label columns to dataset with all 1s
The only option that found is
// define new type
type LabelColumn() =
member val Label = 1.0f with get, set
// define new mapping function that return 1.0f
let labelMapping = Action<_,_>(fun (input:Product) (output:LabelColumn) -> output.Label <- 1.0f)
// add custom mapping to pipeline
.Append(context.Transforms.CustomMapping<Product, LabelColumn>(labelMapping, contractName = null))
@lqdev / @luisquintanilla did you have a chance to take a look? ;)
There is a sample in this project MatrixFactorization_ProductRecommendation for "One-Class Matrix Factorization"
In this sample
traindata
loaded from 2 column file and added one moreLabel
column in the dataset https://github.com/dotnet/machinelearning-samples/blob/master/samples/csharp/getting-started/MatrixFactorization_ProductRecommendation/ProductRecommender/Program.cs#L31-L39when column added it is filled with
NaN
sAccording to documentation for MatrixFactorizationTrainer Class
Page 28 of linked paper also state that
'One-Class Matrix Factorization' method is used when we know only positive ratings/samples (1s)
Why
MatrixFactorization_ProductRecommendation
sample does not fillLabel
column with all 1s before matrix factorization?// cc @CESARDELATORRE
Update: Here is more detailed explanation