1. An information processing apparatus for generating a tree structured discriminator which has a plurality of nodes, comprising: an obtaining unit configured to obtain a plurality of learning patterns; a query obtaining unit configured to obtain a predetermined number of queries, wherein the queries classify the plurality of patterns; a determination unit configured to determine whether there is an obtained query which corresponds with a layer of a target node; a first allocation unit configured to allocate obtained query to the target node in a case that the determination unit determines that there is the obtained query which corresponds with the layer of the target node; a query generation unit configured to generate a query when the determination unit determines that there is not the obtained query which corresponds with the layer of the target node; and a second allocation unit configured to allocate the generated query to the target node in a case that the determination unit determines that there is not the obtained query which corresponds with the layer of the target node.