In general, fuzzification is a way to account for noise in data by assigning "soft labels" instead of hard ones.
For instance, imagine a binary classification problem and one example where you are not sure whether it belongs to class 0 or 1. In that case, it may be detrimental to let your model learn a hard label (either 0 or 1), since you are not sure of its true value. So you may think to shift to consider fuzzy labels, which means you consider the example as belonging to different classes with given confidence (imagine this as degree of membership or fuzzy membership).
To do that, you have to assign a number between 0 and 1 to each of the classes. Of course you have multiple options in terms of
- different mappings (i.e., functions) from classes to fuzzy membership values
- specific parametrization of the above mapping
The code you provided refers to a commonly adopted family of functions for fuzzy membership called triangular membership and it works by assigning linearly increasing/decreasing membership values around a central point in the input. You can look at this picture for a more graphical explanation (see here for more details) :
The parameters determine the exact shape of the triangular function. Namely, the start of the rising path, the apex of its trajectory and the end point. Unfortunately, the choice of such parameters is application specific and there are no "magic" values that work always (at least to the best of my knowledge).