Implementation of ID3 with gain ratio