2 writes to ApproximationRank
Microsoft.ML.Recommender (2)
MatrixFactorizationPredictor.cs (2)
101
buffer.Get(out NumberOfRows, out NumberOfColumns, out
ApproximationRank
, out var leftFactorMatrix, out var rightFactorMatrix);
142
ApproximationRank
= ctx.Reader.ReadInt32();
24 references to ApproximationRank
Microsoft.ML.Recommender (20)
MatrixFactorizationPredictor.cs (20)
68
/// This is two dimensional matrix with size of <see cref="NumberOfRows"/> * <see cref="
ApproximationRank
"/> flattened into one-dimensional matrix.
78
/// This is two dimensional matrix with size of <see cref="
ApproximationRank
"/> * <see cref="NumberOfColumns"/> flattened into one-dimensional matrix.
106
_host.Assert(_leftFactorMatrix.Length == NumberOfRows *
ApproximationRank
);
107
_host.Assert(_rightFactorMatrix.Length ==
ApproximationRank
* NumberOfColumns);
143
_host.CheckDecode(
ApproximationRank
> 0);
145
_leftFactorMatrix = Utils.ReadSingleArray(ctx.Reader, checked(NumberOfRows *
ApproximationRank
));
146
_rightFactorMatrix = Utils.ReadSingleArray(ctx.Reader, checked(NumberOfColumns *
ApproximationRank
));
180
_host.Check(
ApproximationRank
> 0, "Number of latent factors must be positive");
183
ctx.Writer.Write(
ApproximationRank
);
184
_host.Check(Utils.Size(_leftFactorMatrix) == NumberOfRows *
ApproximationRank
, "Unexpected matrix size of a factor matrix (matrix P in LIBMF paper)");
185
_host.Check(Utils.Size(_rightFactorMatrix) == NumberOfColumns *
ApproximationRank
, "Unexpected matrix size of a factor matrix (matrix Q in LIBMF paper)");
196
writer.WriteLine("# P in R^({0} x {1}), rows correspond to Y item", NumberOfRows,
ApproximationRank
);
200
if (i %
ApproximationRank
==
ApproximationRank
- 1)
205
writer.WriteLine("# Q in R^({0} x {1}), rows correspond to X item", NumberOfColumns,
ApproximationRank
);
209
if (i %
ApproximationRank
==
ApproximationRank
- 1)
301
int rowOffset = rowIndex *
ApproximationRank
;
303
int columnOffset = columnIndex *
ApproximationRank
;
304
for (int i = 0; i <
ApproximationRank
; i++)
Microsoft.ML.Tests (4)
TrainerEstimators\MatrixFactorizationTests.cs (4)
90
Assert.Equal(model.Model.
ApproximationRank
, options.ApproximationRank);
93
Assert.Equal(leftMatrix.Count, model.Model.NumberOfRows * model.Model.
ApproximationRank
);
94
Assert.Equal(rightMatrix.Count, model.Model.NumberOfColumns * model.Model.
ApproximationRank
);
820
int k = model.Model.
ApproximationRank
;