added fit func for ward
ward clusters for log reg