1. A method for defect classification comprising: storing, in a computer system, a definition of a region in a feature space, wherein the definition is associated with a class of defects and comprises a kernel function comprising a parameter, wherein the parameter determines a shape of the region; receiving, by the computer system, a confidence threshold for automatic classification of at least one defect associated with the class; selecting, by the computer system, a value of the parameter associated with the confidence threshold; receiving, by the computer system, inspection data for a plurality of defects detected in one or more samples under inspection; and automatically classifying, by the computer system, the plurality of defects for the class using the kernel function and the selected value of the parameter.