This paper addresses the problem of identification of piecewise affine (PWA) models. This problem involves the estimation
from data of both the parameters of the affine submodels and the partition of the PWA map. The procedure that we propose for PWA identification exploits a greedy strategy for partitioning
an infeasible system of linear inequalities into a minimum number of feasible subsystems: this provides an initial clustering
of the datapoints. Then a refinement procedure is applied repeatedly to the estimated clusters in order to improve both the
data classification and the parameter estimation. The partition of the PWA map is finally estimated by considering pairwise
the clusters of regression vectors, and by finding a separating hyperplane for each of such pairs. We show that our procedure
does not require to fix a priori the number of affine submodels, which is instead automatically estimated from the data.