Naive Bayes Classifier in C#
HeightWeightSize



This doesn't make a good class name. What if you add another property? You'd need to change its name again.

I guess Person or something alike would be much better.




Gaussian gaussian = new Gaussian();
gaussian.Sex = key;
gaussian.Count = gaussianDataSet[key].Height.Count;

gaussian.HeightMean = Statistics.Mean(gaussianDataSet[key].Height);
gaussian.WeightMean = Statistics.Mean(gaussianDataSet[key].Weight);
gaussian.FootSizeMean = Statistics.Mean(gaussianDataSet[key].FootSize);

gaussian.HeightVariance = Statistics.Variance(gaussianDataSet[key].Height);
gaussian.WeightVariance = Statistics.Variance(gaussianDataSet[key].Weight);
gaussian.FootSizeVariance = Statistics.Variance(gaussianDataSet[key].FootSize);



You could simplify this by putting it inside the Gaussian class.

class Gaussian 
{
    public Gaussian(string sex, int count, double height, double weight, double footSize) 
    {
        HeightMean = Statistics.Mean(Height);
        // ...
    }

    public double HeightMean { get; }
    // ...
}


Adding it to a dictionary would then can be reduced to:

gaussianList.Add(key, new Gaussian(
    sex, 
    gaussianDataSet[key].Count
    gaussianDataSet[key].Height, 
    ...,
    ...)
);




There is still too much redundancy and you could improve more then the above but I don't know how the HeightWeightSize type looks like.