#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 2 18:38:32 2017
@author: lu
"""
import time
import pandas as pd
from sklearn.cluster import KMeans
"""
programmer_1--> Clustering discretization is carried out
programmer_2-->None
find_rule--> Define association rules
connect_string--> String connection
"""
def programmer_1():
datafile = "data/data.xls"
processedfile = "tmp/data_processed.xls"
typelabel = {
u" Syndrome type coefficient of liver qi stagnation ": "A",
u" Syndrome type coefficient of heat toxin accumulation ": "B",
u" Syndrome type coefficient of Chong Ren imbalance ": "C",
u" Coefficient of deficiency of both qi and blood ": "D",
u" Syndrome type coefficient of spleen stomach weakness ": "E",
u" Syndrome coefficient of yin deficiency of liver and kidney ": "F",
}
k = 4
data = pd.read_excel(datafile)
result = pd.DataFrame()
for key, item in typelabel.items():
print(u" Underway “%s” The clustering ..." % key)
# Clustering discretization is carried out
kmodel = KMeans(n_clusters&#