Example #1
0
        public override bool Equals(object obj)
        {
            Model test = obj as Model;

            if (test == null)
            {
                return(false);
            }

            bool same = ClassLabels.IsEqual(test.ClassLabels);

            same = same && NumberOfClasses == test.NumberOfClasses;
            same = same && NumberOfSVPerClass.IsEqual(test.NumberOfSVPerClass);
            if (PairwiseProbabilityA != null)
            {
                same = same && PairwiseProbabilityA.IsEqual(test.PairwiseProbabilityA);
            }
            if (PairwiseProbabilityB != null)
            {
                same = same && PairwiseProbabilityB.IsEqual(test.PairwiseProbabilityB);
            }
            same = same && Parameter.Equals(test.Parameter);
            same = same && Rho.IsEqual(test.Rho);
            same = same && SupportVectorCoefficients.IsEqual(test.SupportVectorCoefficients);
            same = same && SupportVectorCount == test.SupportVectorCount;
            same = same && SupportVectors.IsEqual(test.SupportVectors);
            return(same);
        }
Example #2
0
 public override int GetHashCode()
 {
     return(ClassLabels.ComputeHashcode() +
            NumberOfClasses.GetHashCode() +
            NumberOfSVPerClass.ComputeHashcode() +
            PairwiseProbabilityA.ComputeHashcode() +
            PairwiseProbabilityB.ComputeHashcode() +
            Parameter.GetHashCode() +
            Rho.ComputeHashcode() +
            SupportVectorCoefficients.ComputeHashcode() +
            SupportVectorCount.GetHashCode() +
            SupportVectors.ComputeHashcode());
 }