We consider the problem of discriminating two finite point sets in the n?dimensional space by a finite number of hyperplanes generating a piecewise linear function. If the intersection of these sets is empty, then they can be strictly separated by a max?min of linear functions. An error function is introduced. This function is nonconvex piecewise linear. We discuss an algorithm for its minimization. The results of numerical experiments using some real?world datasets are presented, which show the effectiveness of the proposed approach.