程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

python_ data_ analysis_ and_ mining_ action-master-8

編輯:Python
#!/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&#

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved