This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.cluster import KmeansClustering | |
from cluster_template import ClusterTemplate | |
class KmeansCluster(ClusterTemplate): | |
def __init__(self, path): | |
super(KmeansCluster, self).__init__(path) | |
# Implementation of abstract method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import numpy as np | |
from abc import abstractmethod | |
class ClusterTemplate(object): | |
def __init__(self, path): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import numpy as np | |
from sklearn.cluster import Kmeans | |
from cluster import Cluster | |
class KmeansCluster(Cluster): | |
def __init__(self, path): | |
super(KmeansCluster, self).__init__(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from abc import abstractmethod | |
class Cluster(object): | |
def __init__(self, path): | |
self.path = path | |
if not os.path.exists(self.path): | |
os.makedirs(self.path, exist_ok=True) |