Beispiel #1
0
def Em(name1,feature,n1,n2):
    data = pd.read_csv('E:\\feature.csv', encoding='gbk')
    datafeature = data[feature]
    data2values = datafeature[feature].values
    emval = EM()
    datacompete = emval.solve(data2values)
    return datacompete
Beispiel #2
0
def EMmake(name1, name2):
    trafficflow, b, ind = share.Csvopreation(name1, name2)
    datavalue = trafficflow.values
    datavalue = share.Standardize(datavalue, np.nanmean(datavalue, axis=0),
                                  np.nanstd(datavalue, axis=0))
    #print(trafficflow.values.dtype)
    em = EM()  # EM算法
    model = em.solve(datavalue)
    return model