图片报告相关性系数保留两位小数
This commit is contained in:
		
							parent
							
								
									fc05840cf8
								
							
						
					
					
						commit
						538ef426f9
					
				| @ -959,7 +959,7 @@ def find_best_models(date='', global_config=None): | ||||
|             ciridate = last_trading_day_str | ||||
|             global_config['logger'].info(f'计算预测{last_trading_day}的次日{last_trading_day}最佳模型') | ||||
|             global_config['logger'].info( | ||||
|                 f'{date}真实价格:{true_price[true_price["ds"] == last_trading_day_str]["y"].values[0]}') | ||||
|                 f'{date}真实价格:{true_price[true_price["ds"] == ciridate]["y"].values[0]}') | ||||
|             price = df[['data_date', wd, 'model_id']] | ||||
|             price = price[(price['data_date'] == ciridate) | ||||
|                           | (price['data_date'] == date)] | ||||
| @ -1098,7 +1098,7 @@ def plot_pp_predict_result(y_hat, global_config,wd='yuedu'): | ||||
|         y = pd.read_csv('juxitingdataset/指标数据.csv')[['ds', 'y']][-30:] | ||||
|         xgx_df = pd.read_csv('juxitingdataset/相关系数.csv') | ||||
|     xgx_df = xgx_df.rename(columns={xgx_df.columns[0]: '指标', xgx_df.columns[1]: '系数'}) | ||||
|     top_10_correlations = xgx_df.sort_values(by='系数', ascending=False)[1:11].round().astype({'系数': int}) | ||||
|     top_10_correlations = xgx_df.sort_values(by='系数', ascending=False)[1:11].round(2) | ||||
|     y['ds'] = pd.to_datetime(y['ds']) | ||||
|     y = y[y['ds'] < y_hat['ds'].iloc[0]] | ||||
| 
 | ||||
| @ -1138,7 +1138,7 @@ def plot_pp_predict_result(y_hat, global_config,wd='yuedu'): | ||||
|                           'next_march_price': '次三月', 'next_april_price': '次四月', | ||||
|                           }, inplace=True) | ||||
|     columns = y_hat.columns.tolist() | ||||
|     data = [round(num) for num in y_hat.values.ravel().tolist()] | ||||
|     data = [[round(num) for num in y_hat.values.ravel().tolist()]] | ||||
| 
 | ||||
|     # 将日期转换为字符串格式 | ||||
|     for row in data: | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user