The present application discloses a classification model training method and device, in which a distance factor is introduced into a gradient loss function of an initial classification model. The distance factor represents a deviation between an actual class and a predicted class. In this way, when different classification errors occur, that is, if there are different degrees of deviation between predicted classes and actual classes, corresponding distance factors are different, resulting in different gradient loss functions, and thus resulting in different residuals between the actual classes and the predicted classes, as determined according to the gradient loss functions. Different sizes of residuals correspond to different degrees of classification error, such that the initial classification model can undergo targeted correction according to the different sizes of residuals, and accuracy of a classification model can be rapidly improved. Embodiments of the application further provide a corresponding data classification method and device.
展开▼