|
@@ -458,7 +458,7 @@ def prediction(datatest,kmeans1,kmeans2,kmeans3):
|
|
|
Xt11['cluster_db']=y_hat
|
|
|
Xt121=Xt11[(Xt11['cluster_db']==0)|(Xt11['cluster_db']==1)]
|
|
|
Xt121['charge_env']='室外'
|
|
|
- datatest=pd.merge(Xt121['charge_env'],datatest,how='outer',right_index=True,left_index=True)
|
|
|
+ datatest=pd.merge(datatest,Xt121['charge_env'],how='outer',right_index=True,left_index=True)
|
|
|
#KMeans2
|
|
|
Xt12=Xt11[(Xt11['cluster_db']==2)|(Xt11['cluster_db']==3)]
|
|
|
if len(Xt12)>0:
|