public void TestExpectedWeightedConfusion() { double expectedAbsoluteErrorAsWeightedConfusion = this.evaluator.ExpectedWeightedConfusion( this.dataset, this.uncertainPredictions, RatingMatrix.AbsoluteErrorLossMatrix(this.starRatingInfo.MinStarRating, this.starRatingInfo.MaxStarRating)); Assert.Equal( this.evaluator.ModelDomainRatingPredictionMetricExpectation(this.dataset, this.uncertainPredictions, Metrics.AbsoluteError), expectedAbsoluteErrorAsWeightedConfusion, CompareEps); double expectedSquaredErrorAsWeightedConfusion = this.evaluator.ExpectedWeightedConfusion( this.dataset, this.uncertainPredictions, RatingMatrix.SquaredErrorLossMatrix(this.starRatingInfo.MinStarRating, this.starRatingInfo.MaxStarRating)); Assert.Equal( this.evaluator.ModelDomainRatingPredictionMetricExpectation(this.dataset, this.uncertainPredictions, Metrics.SquaredError), expectedSquaredErrorAsWeightedConfusion, CompareEps); double expectedZeroOneErrorAsWeightedConfusion = this.evaluator.ExpectedWeightedConfusion( this.dataset, this.uncertainPredictions, RatingMatrix.ZeroOneErrorLossMatrix(this.starRatingInfo.MinStarRating, this.starRatingInfo.MaxStarRating)); Assert.Equal( this.evaluator.ModelDomainRatingPredictionMetricExpectation(this.dataset, this.uncertainPredictions, Metrics.ZeroOneError), expectedZeroOneErrorAsWeightedConfusion, CompareEps); }
public void TestWeightedConfusion() { Assert.Equal( this.evaluator.ModelDomainRatingPredictionMetric(this.dataset, this.predictions, Metrics.AbsoluteError), this.evaluator.WeightedConfusion(this.dataset, this.predictions, RatingMatrix.AbsoluteErrorLossMatrix(this.starRatingInfo.MinStarRating, this.starRatingInfo.MaxStarRating)), CompareEps); Assert.Equal( this.evaluator.ModelDomainRatingPredictionMetric(this.dataset, this.predictions, Metrics.SquaredError), this.evaluator.WeightedConfusion(this.dataset, this.predictions, RatingMatrix.SquaredErrorLossMatrix(this.starRatingInfo.MinStarRating, this.starRatingInfo.MaxStarRating)), CompareEps); Assert.Equal( this.evaluator.ModelDomainRatingPredictionMetric(this.dataset, this.predictions, Metrics.ZeroOneError), this.evaluator.WeightedConfusion(this.dataset, this.predictions, RatingMatrix.ZeroOneErrorLossMatrix(this.starRatingInfo.MinStarRating, this.starRatingInfo.MaxStarRating)), CompareEps); }