A clustering technique for the identification of piecewise affine and hybrid systems