BP_LDA.LDA_Learn.ComputeNumberOfErrors C# (CSharp) Method

ComputeNumberOfErrors() public static method

public static ComputeNumberOfErrors ( SparseMatrix Dt, DenseMatrix y ) : int
Dt LinearAlgebra.SparseMatrix
y LinearAlgebra.DenseMatrix
return int
		public static int ComputeNumberOfErrors(SparseMatrix Dt, DenseMatrix y)
		{
			if (Dt.nCols != y.nCols)
			{
				throw new Exception("The numbers of samples from label and prediction do not match.");
			}
			int nTotError = 0;
			int[] PredictedClass = y.IndexOfVerticalMax();
			for (int IdxCol = 0; IdxCol < Dt.nCols; IdxCol++)
			{
				if (Dt.SparseColumnVectors[IdxCol].Key[0] != PredictedClass[IdxCol])
				{
					nTotError++;
				}
			}
			return nTotError;
		}
		public static int ComputeNumberOfErrors(SparseMatrix Dt, SparseMatrix y)

Same methods

LDA_Learn::ComputeNumberOfErrors ( SparseMatrix Dt, SparseMatrix y ) : int