What is sum encoding?
Sum encoding is similar to one-hot encoding but the difference is that in sum encoding we take one value as '-1' and it is not compared to other value. Whereas in one-hot encoding we create one column for each value to compare against all other values.
It is referred as sum encoding because the intercept represents the grand mean and the contrast estimate is the mean for level 1 minus the grand mean.
In one-hot encoding intercept represents the mean for the baseline condition and contrast estimate represents simple the difference between one particular condition and the baseline.