Python unkown operand type - for custom class : I have a custom class in my Python code, that handles k-means clustering. The class takes some arguments to customize the clustering, however when subtracting two values from a list passed to the class, I get the following error:

    TypeError: unsupported operand type(s) for -: 'KMeans' and 'KMeans'

Here is the code of my custom class:

    import KMeansClusterer
    from math import sqrt, fabs
    from matplotlib import pyplot as plp
    
    class ClusterCalculator:
        m = 0
        b = 0
        sum_squared_dist = []
        derivates = []
        distances = []
        line_coordinates = []
    
        def __init__(self, calc_border, data):
            self.calc_border = calc_border
            self.data = data
    
        def calculate_optimum_clusters(self):
            self.calculate_squared_dist()
            self.init_opt_line()
            self.calc_distances()
            self.calc_line_coordinates()
            opt_clusters = self.get_optimum_clusters()
            print("Evaluated", opt_clusters, "as optimum number of clusters")
            return opt_clusters
    
    
        def calculate_squared_dist(self):
            for k in range(1, self.calc_border):
                kmeans = KMeansClusterer.KMeansClusterer(k, self.data)
                self.sum_squared_dist.append(kmeans.calc_custom_params(self.data, k))
     
        def init_opt_line(self):
            #here the error is thrown
            self. m = (self.sum_squared_dist[0] - self.sum_squared_dist[1]) / (1 - self.calc_border)
            self.b = (1 * self.sum_squared_dist[0] - self.calc_border*self.sum_squared_dist[0]) / (1 - self.calc_border)
    
        def calc_y_value(self, x_calc):
            return self.m * x_calc + self.b
    
        def calc_line_coordinates(self):
            for i in range(1, self.calc_border):
                self.line_coordinates.append(self.calc_y_value(i))
    
        def calc_distances(self):
            for i in range(1, self.calc_border):
                self.distances.append(sqrt(fabs(self.calc_y_value(i))))
            print("For border", self.calc_border, ", calculated the following distances: \n", self.distances)
    
        def get_optimum_clusters(self):
            return self.distances.index((max(self.distances)))
    
        def plot_results(self):
            plp.plot(range(1, self.calc_border), self.sum_squared_dist, "bx-")
            plp.plot(range(1, self.calc_border), self.line_coordinates, "bx-")
            plp.xlabel("Number of clusters")
            plp.ylabel("Sum of squared distances")
            plp.show()

I append the KMeansClusterer as well, because `sum_squared_dist` is filled with values of there:  

    from sklearn.cluster import KMeans
    from matplotlib import pyplot as plp
    class KMeansClusterer:
        def __init__(self, clusters, data):
            self.clusters = clusters
            self.data = data
    
        def cluster(self):
            kmeans = KMeans(n_clusters=self.cluster(), random_state=0).fit(self.data)
            print("Clustered", len(kmeans.labels_), "GTINs")
            for i, cluster_center in enumerate(kmeans.cluster_centers_):
                plp.plot(cluster_center, label="Center {0}".format(i))
            plp.legend(loc="best")
            plp.show()
    
        def calc_custom_params(self, data_frame, clusters):
            kmeans = KMeans(n_clusters=clusters, random_state=0).fit(data_frame)
            return kmeans
    
        def cluster_without_plot(self):
            return KMeans(n_clusters=self.cluster(), random_state=0).fit(self.data)



I cannot imagine why '-' should be unsupported, i trie to subtract two list values of type integer and 1 and a integer variable.  
Can someone help me?
