1. A data processing method for controlling a computer to learn classification of instances having a structure, the method comprising: a first step of inputting the instances to compute their inner product and storing the computation result in memory, the structure of the instances being vector-representable with its substructures as attributes; and a second step of learning classification of the instances based on the computation result stored in the memory; wherein the first step comprises, if the given substructures includes lower substructures, computing a sum of matches for the lower substructure.