public void calculateError()
    {
        int n11 = 0, n00 = 0, n01 = 0, n10 = 0;
        double error;
        for(int i = 0; i < expectedOutputs.length; i++)
        {
            if(expectedOutputs[i][0] == predictions[i] && predictions[i] ==1)
            {
                //Calculate class one
                n11 += 1;
            }
            else
            {
                if(expectedOutputs[i][0] == predictions[i] && predictions[i]==0)
               {
                    //calculate total of class 0
                    n00 += 1;
                }
                else
                {
                    if (expectedOutputs[i][0] == 0 && predictions[i] == 1)
                    {
                        //calculate the class of 0 that this in 1
                        n01 += 1;
                    }
                    else
                    {
                        //Calculate the class of 1 that this in 0
                        n10 +=1;
                    }
                }
            }
        }

        //Calculate the error Bayesiano
        error = ((n01 + n10) / (n00 + n01 + n10 + n11));
        System.out.println("The Error total of classification the patterns is: " + error+ "%");
    }