<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _ss(self, class_def):
 """calculates sum of squares for a class"""

        yc = self.y[class_def]
        css = yc - yc.mean()
        css *= css
        return sum(css)