# Path: malss/algorithm.py
# class Algorithm(object):
#     def __init__(self, estimator, parameters, name, link=None):
#         self.estimator = estimator
#         self.parameters = parameters
#         self.best_score = None
#         self.best_params = None
#         self.is_best_algorithm = False
#         self.grid_scores = None
#         self.classification_report = None
#         self.name = name
#         self.link = link
#         self.results = {}
# 
# Path: malss/hierarchy.py
# class HierarchicalClustering(object):
#     def __init__(self, n_clusters=3, random_state=None, method='complete', metric='euclidean'):
#         self.n_clusters = n_clusters
#         self.random_state = random_state
#         self.method = method
#         self.metric = metric
#         self.model = None
# 
#     def fit_predict(self, X, y=None):
#         self.model = linkage(X, method=self.method, metric=self.metric)
#         return fcluster(self.model, t=self.n_clusters, criterion='maxclust') - 1
#     
#     def fit(self, X, y=None):
#         self.model = linkage(X, method=self.method, metric=self.metric)
#         return self.model
#     
#     def dendrogram(self):
#         return dendrogram(self.model, truncate_mode='lastp', p=min(12, len(self.model)))


import os
import io
import shutil
import numpy as np
import pandas
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_score, davies_bouldin_score, calinski_harabasz_score
from jinja2 import Environment, FileSystemLoader
from .algorithm import Algorithm
from .hierarchy import HierarchicalClustering




class Clustering(object):
    @staticmethod
    def choose_algorithm(min_clusters, max_clusters, random_state):
        algorithms = []
        algorithms.append(
            Algorithm(
                KMeans(random_state=random_state),
                [],
                'K-Means',
                ('https://scikit-learn.org/stable/modules/generated/'
                 'sklearn.cluster.KMeans.html')
            )
        )
        algorithms.append(
            Algorithm(

# Path: malss/algorithm.py
# class Algorithm(object):
#     def __init__(self, estimator, parameters, name, link=None):
#         self.estimator = estimator
#         self.parameters = parameters
#         self.best_score = None
#         self.best_params = None
#         self.is_best_algorithm = False
#         self.grid_scores = None
#         self.classification_report = None
#         self.name = name
#         self.link = link
#         self.results = {}
# 
# Path: malss/hierarchy.py
# class HierarchicalClustering(object):
#     def __init__(self, n_clusters=3, random_state=None, method='complete', metric='euclidean'):
#         self.n_clusters = n_clusters
#         self.random_state = random_state
#         self.method = method
#         self.metric = metric
#         self.model = None
# 
#     def fit_predict(self, X, y=None):
#         self.model = linkage(X, method=self.method, metric=self.metric)
#         return fcluster(self.model, t=self.n_clusters, criterion='maxclust') - 1
#     
#     def fit(self, X, y=None):
#         self.model = linkage(X, method=self.method, metric=self.metric)
#         return self.model
#     
#     def dendrogram(self):
#         return dendrogram(self.model, truncate_mode='lastp', p=min(12, len(self.model)))


# Path: malss/clustering.py
import os
import io
import shutil
import numpy as np
import pandas
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_score, davies_bouldin_score, calinski_harabasz_score
from jinja2 import Environment, FileSystemLoader
from .algorithm import Algorithm
from .hierarchy import HierarchicalClustering




class Clustering(object):
    @staticmethod
    def choose_algorithm(min_clusters, max_clusters, random_state):
        algorithms = []
        algorithms.append(
            Algorithm(
                KMeans(random_state=random_state),
                [],
                'K-Means',
                ('https://scikit-learn.org/stable/modules/generated/'
                 'sklearn.cluster.KMeans.html')
            )
        )
        algorithms.append(
            Algorithm(

                HierarchicalClustering(random_state=random_state),
