A computer-implemented sample class prediction method comprising: a) generating a discriminant function by analysing data of a training sample set constructed from a plurality of samples, each known to belong to class 1 or class 2, on the basis of a plurality of explanatory variables generated for said each training sample, said discriminant function being used to assign samples to said class 1 or said class 2, wherein said each training sample is a chemical compound, said class 1 is a class of chemical compounds having a given toxicity, and said class 2 is a class of chemical compounds not having said toxicity; b) calculating (S2, S3) a discriminant score for said each training sample and a discriminant score for an unknown sample by using said generated discriminant function, said unknown sample being unknown as to whether it belongs to said class 1 or said class 2; c) determining whether the discriminant score of said unknown sample is either not smaller than the largest discriminant score or not larger than the smallest discriminant score taken among all of said training samples; d) if the determination in said c) is affirmative, then determining the class to which said unknown sample belongs in accordance with the discriminant score of said unknown sample; e) if the determination in said c) is negative, then removing at least the training sample having said largest discriminant score and the training sample having said smallest discriminant score from said training sample set, and constructing a new training sample set by using remaining training samples; and f) repeating said a) to e) for said new training sample set until a number of samples contained in said new training sample set has decreased to or below a predetermined number, wherein in said e), a first number of training samples taken in decreasing order of said discriminant score starting from the training sample having said largest discriminant score and a second number of training samples taken in increasing order of said discriminant score starting from the training sample having said smallest discriminant score are removed from said training sample set, characterised in that said first number and said second number are determined based on the ratio of the number of training samples whose measured values indicate said class 1 to the number of training samples whose measured values indicate said class 2 in said training sample set, or said first number and said second number are determined based on the total number of samples contained in said training sample set in said a) and on a value preset as a maximum number for the number of times of said repeating in said f). a) generating a discriminant function by analysing data of a training sample set constructed from a plurality of samples, each known to belong to class 1 or class 2, on the basis of a plurality of explanatory variables generated for said each training sample, said discriminant function being used to assign samples to said class 1 or said class 2, wherein said each training sample is a chemical compound, said class 1 is a class of chemical compounds having a given toxicity, and said class 2 is a class of chemical compounds not having said toxicity; b) calculating (S2, S3) a discriminant score for said each training sample and a discriminant score for an unknown sample by using said generated discriminant function, said unknown sample being unknown as to whether it belongs to said class 1 or said class 2; c) determining whether the discriminant score of said unknown sample is either not smaller than the largest discriminant score or not larger than the smallest discriminant score taken among all of said training samples; d) if the determination in said c) is affirmative, then determining the class to which said unknown sample belongs in accordance with the discriminant score of said unknown sample; e) if the determination in said c) is negative, then removing at least the training sample having said largest discriminant score and the training sample having said smallest discriminant score from said training sample set, and constructing a new training sample set by using remaining training samples; and f) repeating said a) to e) for said new training sample set until a number of samples contained in said new training sample set has decreased to or below a predetermined number,