public void Test_Cofi_CostFunction_Regularized()
{
Matrix rMat = Y.ToBinary(i => i > 0d);
ICostFunction costFunction = new CofiCostFunction() { R = rMat, X = X, Y = Y.Unshape(), Lambda = 1.5, Regularizer = null, CollaborativeFeatures = X.Cols };
costFunction.Initialize();
double cost = costFunction.ComputeCost(Vector.Combine(X.Unshape(), Theta.Unshape()));
Vector grad = costFunction.ComputeGradient(Vector.Combine(X.Unshape(), Theta.Unshape()));
Almost.Equal(55.172, System.Math.Round(cost, 3), 0.0011);
this.CheckCofiGradient(1.5);
}