Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Update ConfusionMatrix.cs #2213

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ public ConfusionMatrix(bool[] predicted, bool[] expected)
///
public ConfusionMatrix(int[] predicted, int[] expected)
{
int[] expectedSymbols = expected.Distinct();
if (expectedSymbols.Length != 2)
if (expected.DistinctCount() > 2)
{
throw new Exception("The vector of expected values contains more than two possible symbols. Please make sure the " +
"expected vector contains only values 0 or 1, or -1 and +1. If you have a multi-class decision problem, please " +
Expand Down