I've been enjoying prototyping erased union types for F# with @SwoorupJ , combining it with a new set of relaxations regarding implicit upcasts (so fewer explicit upcasts are needed if types are known).
Happy new year #fsharp! Did you know that we have a fairly extensive document on F# coding conventions? It was written in collaboration with several F# engineers writing F# professionally in large codebases: https://t.co/NKL7ErjHvJ
— Phillip Carter – F# and left-wing politics (@_cartermp) January 5, 2021
Thanks a lot to delneg for porting Mozilla's source map library to #fsharp. Find instructions to use source maps in a Fable 3 app with Webpack here: https://t.co/fe7uvSyfUi
If you have sophisticated user feedback like rating (or likes and most importantly dislikes) then we can use Matrix Factorization algorithm to estimate unknown ratings.
If we have not only rating but other product fields, we can use more advanced algorithm called “Field-Aware Factorization Machine”
If we have no rating at all then “One Class Matrix Factorization” is the only option for us.
In this post I would like to focus on the last option.
One-Class Matrix Factorization
This algorithm can be used when data is limited. For example:
Books store: We have history of purchases (list of pairs userId + bookId) without user’s feedback and want to recommend new books for existing users.
Amazon store: We have history of co-purchases (list of pairs productId + productId) and want to recommend products in section “Customers Who Bought This Item Also Bought”.
Social network: We have information about user friendship (list of pairs userId + userId) and want to recommend users in section “People You May Know”.
As you already understood, it is applicable for a pair of 2 categorical variables, not only for userId + productId pairs.
Google showed several relevant posts about the usage of ML.NET One Class Matrix Factorizarion:
After reading all these 3 samples I realised that I do not fully understand what is Label column is used for. Later I came to a conclusion that all three samples most likely are incorrect and here is why.
There are three input columns required, one for matrix row indexes, one for matrix column indexes, and one for values (i.e., labels) in matrix. They together define a matrix in COO format. The type for label column is a vector of Single (float) while the other two columns are key type scalar.
COO stores a list of (row, column, value) tuples. Ideally, the entries are sorted first by row index and then by column index, to improve random access times. This is another format that is good for incremental matrix construction
So anyway we need three columns. If in the classic Matrix Factorization the Label column is the rating, then for One-Class Matrix Factorization we need to fill it with something else.
The second gem is
The coordinate descent method included is specifically for one-class matrix factorization where all observed ratings are positive signals (that is, all rating values are 1). Notice that the only way to invoke one-class matrix factorization is to assign one-class squared loss to loss function when calling MatrixFactorization(Options). See Page 6 and Page 28 here for a brief introduction to standard matrix factorization and one-class matrix factorization. The default setting induces standard matrix factorization. The underlying library used in ML.NET matrix factorization can be found on a Github repository.
As you see, Label is expected to be always 1, because we watched only One Class (positive rating): user downloaded a book, user purchased 2 items together, there is a friendship between two users.
In the case when data set does not provide rating to us, it is our responsibility to provide 1s to MatrixFactorizationTrainer and specify MatrixFactorizationTrainer.LossFunctionType as loss function.
tforkmann/AzureTackle.Analyzer – F# analyzer that provides embedded syntax analysis, type-checking for parameters and result sets and nullable column detection when writing queries using AzureTackle.
ionide/playground – Empty F# project that can be opened in Visual Studio Online or Gitpod
Microsoft Machine Learning Studio is one of the best tools to help you learn #AI and #MachineLearning. Its a visual tool with tons of examples and datasets. It accepts #Python, #CSharp and #FSharp. Completely free and cloud based 🤙🔥😀👌https://t.co/pee3kJhDwu
New major version of our #fsharp@code plugin is out.
Ionide-fsharp 5.0 brings huge changes, including: * new implementation of the project system * running only .NET 5 (no more support for running FSAC on mono/full framework) * changes in default configuration.#fsharp
FsLab is back! We are now an F# community incubation space for data science and analytics, with contributors from across the F# ecosystem including FSharp Stats, Flips, Deedle and more https://t.co/TJ4bm1qpko
Strongly typed SQL without the drawbacks of type providers? You better believe it: Introducing Facil, a friendly, flexible, and full-featured fabricator of files for fluent and frictionless facades facilitating the facile and functional fetching of facts https://t.co/a3Ix0vQL2d
Another fun #fsharp quick fix coming to a VS near you soon: fix up that pesky "right, I need to mark it as `rec`" error! Also handles nested cases correctly. pic.twitter.com/tuJssWANLx
— Phillip Carter – F# and left-wing politics (@_cartermp) December 10, 2020