diff --git a/config_jingbo.py b/config_jingbo.py index adde041..db3255d 100644 --- a/config_jingbo.py +++ b/config_jingbo.py @@ -167,12 +167,12 @@ upload_data = { ### 开关 is_train = True # 是否训练 -is_debug = False # 是否调试 -is_eta = True # 是否使用eta接口 +is_debug = True # 是否调试 +is_eta = False # 是否使用eta接口 is_timefurture = True # 是否使用时间特征 -is_fivemodels = False # 是否使用之前保存的最佳的5个模型 -is_edbcode = False # 特征使用edbcoding列表中的 -is_edbnamelist = False # 自定义特征,对应上面的edbnamelist +is_fivemodels = True # 是否使用之前保存的最佳的5个模型 +is_edbcode = True # 特征使用edbcoding列表中的 +is_edbnamelist = True # 自定义特征,对应上面的edbnamelist is_update_eta = False # 预测结果上传到eta is_update_report = False # 是否上传报告 diff --git a/debugdemo.ipynb b/debugdemo.ipynb new file mode 100644 index 0000000..da48355 --- /dev/null +++ b/debugdemo.ipynb @@ -0,0 +1,2611 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "31c0e11d-c87a-4e95-92a0-d1d09625e255", + "metadata": {}, + "outputs": [], + "source": [ + "# 读取配置\n", + "from config_jingbo import *\n", + "# from config_tansuanli import *\n", + "# from config_juxiting import *\n", + "from lib.dataread import *\n", + "from lib.tools import *\n", + "from models.nerulforcastmodels import ex_Model,model_losss,brent_export_pdf,tansuanli_export_pdf,pp_export_pdf\n", + "\n", + "import glob\n", + "import torch\n", + "torch.set_float32_matmul_precision(\"high\")\n", + "\n", + "sqlitedb = SQLiteHandler(db_name) \n", + "sqlitedb.connect()\n", + "\n", + "\n", + "signature = BinanceAPI(APPID, SECRET)\n", + "etadata = EtaReader(signature=signature,\n", + " classifylisturl = classifylisturl,\n", + " classifyidlisturl=classifyidlisturl,\n", + " edbcodedataurl=edbcodedataurl,\n", + " edbcodelist=edbcodelist,\n", + " edbdatapushurl=edbdatapushurl,\n", + " edbdeleteurl=edbdeleteurl,\n", + " edbbusinessurl=edbbusinessurl\n", + " )\n", + "# 获取数据\n", + "if is_eta:\n", + " # eta数据\n", + " logger.info('从eta获取数据...')\n", + " signature = BinanceAPI(APPID, SECRET)\n", + " etadata = EtaReader(signature=signature,\n", + " classifylisturl = classifylisturl,\n", + " classifyidlisturl=classifyidlisturl,\n", + " edbcodedataurl=edbcodedataurl,\n", + " edbcodelist=edbcodelist,\n", + " edbdatapushurl=edbdatapushurl,\n", + " edbdeleteurl=edbdeleteurl,\n", + " edbbusinessurl=edbbusinessurl,\n", + " )\n", + "\n", + " df_zhibiaoshuju,df_zhibiaoliebiao = etadata.get_eta_api_yuanyou_data(data_set=data_set,dataset=dataset) # 原始数据,未处理\n", + " # df_zhibiaoshuju,df_zhibiaoliebiao = etadata.get_eta_api_pp_data(data_set=data_set,dataset=dataset) # 原始数据,未处理\n", + "\n", + " \n", + " # 数据处理\n", + " df = datachuli(df_zhibiaoshuju,df_zhibiaoliebiao,y = y,dataset=dataset,add_kdj=add_kdj,is_timefurture=is_timefurture,end_time=end_time) \n", + "\n", + "else:\n", + " logger.info('读取本地数据:'+os.path.join(dataset,data_set))\n", + " df = getdata(filename=os.path.join(dataset,data_set),y=y,dataset=dataset,add_kdj=add_kdj,is_timefurture=is_timefurture,end_time=end_time) # 原始数据,未处理\n", + "\n", + "# 更改预测列名称\n", + "df.rename(columns={y:'y'},inplace=True)\n", + " \n", + "if is_edbnamelist:\n", + " df = df[edbnamelist] \n", + "df.to_csv(os.path.join(dataset,'指标数据.csv'), index=False)\n", + "# 保存最新日期的y值到数据库\n", + "# 取第一行数据存储到数据库中\n", + "first_row = df[['ds','y']].tail(1)\n", + "# 将最新真实值保存到数据库\n", + "if not sqlitedb.check_table_exists('trueandpredict'):\n", + " first_row.to_sql('trueandpredict',sqlitedb.connection,index=False)\n", + "else:\n", + " for row in first_row.itertuples(index=False):\n", + " row_dict = row._asdict()\n", + " check_query = sqlitedb.select_data('trueandpredict',where_condition = f\"ds = '{row.ds}'\")\n", + " if len(check_query) > 0:\n", + " set_clause = \", \".join([f\"{key} = '{value}'\" for key, value in row_dict.items()])\n", + " sqlitedb.update_data('trueandpredict',set_clause,where_condition = f\"ds = '{row.ds}'\")\n", + " continue\n", + " sqlitedb.insert_data('trueandpredict',tuple(row_dict.values()),columns=row_dict.keys())\n", + "\n", + "import datetime\n", + "# 判断当前日期是不是周一\n", + "is_weekday = datetime.datetime.now().weekday() == 3\n", + "if is_weekday:\n", + " logger.info('今天是周一,更新预测模型')\n", + " # 计算最近20天预测残差最低的模型名称\n", + "\n", + " model_results = sqlitedb.select_data('trueandpredict',order_by = \"ds DESC\",limit = \"20\")\n", + " model_results = model_results.dropna()\n", + " modelnames = model_results.columns.to_list()[2:] \n", + " for col in model_results[modelnames].select_dtypes(include=['object']).columns:\n", + " model_results[col] = model_results[col].astype(np.float32)\n", + " # 计算每个预测值与真实值之间的偏差率\n", + " for model in modelnames:\n", + " model_results[f'{model}_abs_error_rate'] = abs(model_results['y'] - model_results[model]) / model_results['y']\n", + "\n", + " # 获取每行对应的最小偏差率值\n", + " min_abs_error_rate_values = model_results.apply(lambda row: row[[f'{model}_abs_error_rate' for model in modelnames]].min(), axis=1)\n", + " # 获取每行对应的最小偏差率值对应的列名\n", + " min_abs_error_rate_column_name = model_results.apply(lambda row: row[[f'{model}_abs_error_rate' for model in modelnames]].idxmin(), axis=1)\n", + " # 将列名索引转换为列名\n", + " min_abs_error_rate_column_name = min_abs_error_rate_column_name.map(lambda x: x.split('_')[0])\n", + " # 取出现次数最多的模型名称\n", + " most_common_model = min_abs_error_rate_column_name.value_counts().idxmax()\n", + " logger.info(f\"最近20天预测残差最低的模型名称:{most_common_model}\")\n", + "\n", + " # 保存结果到数据库\n", + " \n", + " if not sqlitedb.check_table_exists('most_model'):\n", + " sqlitedb.create_table('most_model',columns=\"ds datetime, most_common_model TEXT\")\n", + " sqlitedb.insert_data('most_model',(datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'),most_common_model,),columns=('ds','most_common_model',))\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "if is_corr:\n", + " df = corr_feature(df=df)\n", + "\n", + "df1 = df.copy() # 备份一下,后面特征筛选完之后加入ds y 列用\n", + "logger.info(f\"开始训练模型...\")\n", + "row,col = df.shape\n", + "\n", + "now = datetime.datetime.now().strftime('%Y%m%d%H%M%S')\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2b330ee3-c006-4ab1-8558-59c51ac8d86f", + "metadata": {}, + "outputs": [], + "source": [ + "model_results3 = model_losss(sqlitedb)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "dcb6100a-ed2b-4077-a1a9-361c6cb565f9", + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "import matplotlib.dates as mdates\n", + "\n", + "def brent_export_pdf(num_indicators=475,num_models=21, num_dayindicator=202,inputsize=5,dataset='dataset',time = '2024-07-30',reportname='report.pdf',sqlitedb='jbsh_yuanyou.db'): \n", + " global y\n", + " # 创建内容对应的空列表\n", + " content = list()\n", + " # 获取特征的近一月值\n", + " import pandas as pd\n", + " feature_data_df = pd.read_csv(f'dataset/指标数据添加时间特征.csv', parse_dates=['ds']).tail(20)\n", + " def draw_feature_trend(feature_data_df, features):\n", + " # 画特征近一周的趋势图\n", + " feature_df = feature_data_df[['ds','y']+features]\n", + " # 遍历X每一列,和yy画散点图 ,\n", + " \n", + " for i, col in enumerate(features):\n", + " # try:\n", + " print(f'正在绘制第{i+1}个特征{col}与价格散点图...')\n", + " if col not in ['ds', 'y']:\n", + " fig, ax1 = plt.subplots(figsize=(10, 6))\n", + " # 在第一个坐标轴上绘制数据\n", + " sns.lineplot(data=feature_df, x='ds', y='y', ax=ax1, color='b')\n", + " ax1.set_xlabel('日期')\n", + " ax1.set_ylabel('y', color='b')\n", + " ax1.tick_params('y', colors='b')\n", + " # 在 ax1 上添加文本显示值,添加一定的偏移避免值与曲线重叠\n", + " for j in range(1, len(feature_df), 2):\n", + " value = feature_df['y'].iloc[j]\n", + " date = feature_df['ds'].iloc[j]\n", + " offset = 1.001\n", + " ax1.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='b', fontsize=10)\n", + " # 创建第二个坐标轴\n", + " ax2 = ax1.twinx()\n", + " # 在第二个坐标轴上绘制数据\n", + " sns.lineplot(data=feature_df, x='ds', y=col, ax=ax2, color='r')\n", + " ax2.set_ylabel(col, color='r')\n", + " ax2.tick_params('y', colors='r')\n", + " # 在 ax2 上添加文本显示值,添加一定的偏移避免值与曲线重叠\n", + " for j in range(0, len(feature_df), 2):\n", + " value = feature_df[col].iloc[j]\n", + " date = feature_df['ds'].iloc[j]\n", + " offset = 1.0003\n", + " ax2.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='r', fontsize=10)\n", + " # 添加标题\n", + " plt.title(col)\n", + " # 设置横坐标为日期格式并自动调整\n", + " locator = mdates.AutoDateLocator()\n", + " formatter = mdates.AutoDateFormatter(locator)\n", + " ax1.xaxis.set_major_locator(locator)\n", + " ax1.xaxis.set_major_formatter(formatter)\n", + " # 文件名特殊字符处理\n", + " col = col.replace('*', '-')\n", + " col = col.replace(':', '-')\n", + " col = col.replace(r'/', '-')\n", + " plt.savefig(os.path.join(dataset, f'{col}与价格散点图.png'))\n", + " content.append(Graphs.draw_img(os.path.join(dataset, f'{col}与价格散点图.png')))\n", + " plt.close()\n", + " # except Exception as e:\n", + " # print(f'绘制第{i+1}个特征{col}与价格散点图时出错:{e}')\n", + " \n", + " \n", + " \n", + " ### 添加标题\n", + " content.append(Graphs.draw_title(f'{y}{time}预测报告'))\n", + "\n", + " ### 预测结果\n", + " content.append(Graphs.draw_little_title('一、预测结果:'))\n", + " # 添加图片\n", + " # 找出后缀是历史价格-预测值.png的图片\n", + " # import glob\n", + " # imgs = glob.glob(os.path.join(dataset,'*历史价格-预测值.png'))\n", + " # for img in imgs:\n", + " # content.append(Graphs.draw_img(img))\n", + " content.append(Graphs.draw_img(os.path.join(dataset,'历史价格-预测值.png')))\n", + "\n", + " # 取df中y列为空的行\n", + " import pandas as pd\n", + " df = pd.read_csv(os.path.join(dataset,'predict.csv'),encoding='gbk') \n", + " df_true = pd.read_csv(os.path.join(dataset,'指标数据添加时间特征.csv'),encoding='utf-8') # 获取预测日期对应的真实值\n", + " df_true = df_true[['ds','y']]\n", + " eval_df = pd.read_csv(os.path.join(dataset,'model_evaluation.csv'),encoding='utf-8') \n", + " # 按评估指标排序,取前五\n", + " fivemodels_list = eval_df['模型(Model)'].values # 列表形式,后面当作列名索引使用\n", + " # 取 fivemodels_list 和 ds 列\n", + " df = df[['ds'] + fivemodels_list.tolist() ]\n", + " # 拼接预测日期对应的真实值\n", + " df = pd.merge(df, df_true, on='ds', how='left')\n", + " # 删除全部为nan的列\n", + " df = df.dropna(how='all', axis=1)\n", + " # 选择除 'ds' 列外的数值列,并进行类型转换和四舍五入\n", + " num_cols = [col for col in df.columns if col!= 'ds' and pd.api.types.is_numeric_dtype(df[col])]\n", + " for col in num_cols:\n", + " df[col] = df[col].astype(float).round(2)\n", + " # 添加最大值、最小值、平均值三列\n", + " df['平均值'] = df[num_cols].mean(axis=1).round(2)\n", + " df['最大值'] = df[num_cols].max(axis=1)\n", + " df['最小值'] = df[num_cols].min(axis=1)\n", + " # df转置\n", + " df = df.T\n", + " # df重置索引\n", + " df = df.reset_index()\n", + " # 添加预测值表格\n", + " data = df.values.tolist()\n", + " col_width = 500/len(df.columns)\n", + " content.append(Graphs.draw_table(col_width,*data))\n", + " content.append(Graphs.draw_little_title('二、上一预测周期偏差率分析:'))\n", + " df = pd.read_csv(os.path.join(dataset,'testandpredict_groupby.csv'),encoding='utf-8')\n", + " df4 = df.copy() # 计算偏差率使用\n", + " # 计算模型偏差率\n", + " #计算各列对于y列的差值百分比\n", + " df3 = pd.DataFrame() # 存储偏差率\n", + " \n", + " # 删除有null的行\n", + " df4 = df4.dropna()\n", + " df3['ds'] = df4['ds']\n", + " for col in fivemodels_list:\n", + " df3[col] = round(abs(df4[col] - df4['y']) / df4['y'] * 100,2) \n", + " # 找出决定系数前五的偏差率\n", + " df3 = df3[['ds']+fivemodels_list.tolist()][-inputsize:]\n", + " # 找出上一预测区间的时间\n", + " stime = df3['ds'].iloc[0]\n", + " etime = df3['ds'].iloc[-1]\n", + " # 添加偏差率表格\n", + " fivemodels = '、'.join(eval_df['模型(Model)'].values[:5]) # 字符串形式,后面写入字符串使用\n", + " content.append(Graphs.draw_text(f'预测使用了{num_models}个模型进行训练,使用评估结果MAE前五的模型分别是 {fivemodels} ,模型上一预测区间 {stime} -- {etime}的偏差率(%)分别是:'))\n", + " # # 添加偏差率表格\n", + " df3 = df3.T\n", + " df3 = df3.reset_index()\n", + " data = df3.values.tolist()\n", + " col_width = 500/len(df3.columns)\n", + " content.append(Graphs.draw_table(col_width,*data))\n", + "\n", + "\n", + " content.append(Graphs.draw_little_title('三、预测过程解析:'))\n", + " ### 特征、模型、参数配置\n", + " content.append(Graphs.draw_little_title('模型选择:'))\n", + " content.append(Graphs.draw_text(f'本次预测使用了一个专门收集时间序列的NeuralForecast库中的{num_models}个模型:'))\n", + " content.append(Graphs.draw_text(f'使用40天的数据预测未来{inputsize}天的数据。'))\n", + " content.append(Graphs.draw_little_title('指标情况:'))\n", + " with open(os.path.join(dataset,'特征频度统计.txt'),encoding='utf-8') as f:\n", + " for line in f.readlines():\n", + " content.append(Graphs.draw_text(line))\n", + "\n", + " data = pd.read_csv(os.path.join(dataset,'指标数据添加时间特征.csv'),encoding='utf-8') # 计算相关系数用\n", + " df_zhibiaofenlei = loadcsv(os.path.join(dataset,'特征处理后的指标名称及分类.csv')) # 气泡图用\n", + " df_zhibiaoshuju = data.copy() # 气泡图用\n", + "\n", + " # 绘制特征相关气泡图\n", + " content.append(Graphs.draw_text('气泡图中,横轴为指标名称,纵轴为指标名称,面积越大表示相关性越大,面积越小表示相关性越小。'))\n", + " grouped = df_zhibiaofenlei.groupby('指标分类')\n", + " grouped_corr = pd.DataFrame(columns=['指标分类', '指标数量', '相关性总和'])\n", + " \n", + " content.append(Graphs.draw_little_title('按指标分类分别与预测目标进行皮尔逊相关系数分析:'))\n", + " content.append(Graphs.draw_text('''皮尔逊相关系数说明:''')) \n", + " content.append(Graphs.draw_text('''衡量两个特征之间的线性相关性。''')) \n", + " content.append(Graphs.draw_text('''\n", + " 相关系数为1:表示两个变量之间存在完全正向的线性关系,即当一个变量增加时,另一个变量也相应增加,且变化是完全一致的。''')) \n", + " content.append(Graphs.draw_text('''相关系数为-1:表示两个变量之间存在完全负向的线性关系,即当一个变量增加时,另一个变量会相应减少,且变化是完全相反的''')) \n", + " content.append(Graphs.draw_text('''相关系数接近0:表示两个变量之间不存在线性关系,即它们的变化不会随着对方的变化而变化。''')) \n", + " for name, group in grouped:\n", + " cols = group['指标名称'].tolist()\n", + " logger.info(f'开始绘制{name}类指标的相关性直方图')\n", + " cols_subset = cols\n", + " feature_names = ['y'] + cols_subset\n", + " correlation_matrix = df_zhibiaoshuju[feature_names].corr()['y']\n", + "\n", + " # 绘制特征相关性直方分布图\n", + " plt.figure(figsize=(10,8))\n", + " sns.histplot(correlation_matrix.values.flatten(), bins=20, kde=True, color='skyblue')\n", + " plt.title(f'{name}类指标(共{len(cols_subset)}个)相关性直方分布图')\n", + " plt.xlabel('相关系数')\n", + " plt.ylabel('频数')\n", + " plt.savefig(os.path.join(dataset, f'{name}类指标相关性直方分布图.png'), bbox_inches='tight')\n", + " plt.close()\n", + " content.append(Graphs.draw_img(os.path.join(dataset,f'{name}类指标相关性直方分布图.png')))\n", + " content.append(Graphs.draw_text(f'{name}类指标(共{len(cols_subset)}个)的相关性直方分布图如上所示。'))\n", + " # 相关性大于0的特征\n", + " positive_corr_features = correlation_matrix[correlation_matrix > 0].sort_values(ascending=False).index.tolist()[1:]\n", + " \n", + " print(f'{name}下正相关的特征值有:',positive_corr_features)\n", + " if len(positive_corr_features) > 5:\n", + " positive_corr_features = positive_corr_features[0:5]\n", + " content.append(Graphs.draw_text(f'{name}类指标中,与预测目标y正相关前五的特征有:{positive_corr_features}'))\n", + " draw_feature_trend(feature_data_df, positive_corr_features)\n", + " elif len(positive_corr_features) == 0:\n", + " pass\n", + " else:\n", + " positive_corr_features = positive_corr_features\n", + " content.append(Graphs.draw_text(f'其中,与预测目标y正相关的特征有:{positive_corr_features}'))\n", + " draw_feature_trend(feature_data_df, positive_corr_features)\n", + " \n", + " # 相关性小于0的特征\n", + " negative_corr_features = correlation_matrix[correlation_matrix < 0].sort_values(ascending=True).index.tolist()\n", + " \n", + " print(f'{name}下负相关的特征值有:',negative_corr_features)\n", + " if len(negative_corr_features) > 5:\n", + " negative_corr_features = negative_corr_features[:5]\n", + " content.append(Graphs.draw_text(f'与预测目标y负相关前五的特征有:{negative_corr_features}'))\n", + " draw_feature_trend(feature_data_df, negative_corr_features)\n", + " elif len(negative_corr_features) == 0:\n", + " pass\n", + " else:\n", + " content.append(Graphs.draw_text(f'{name}类指标中,与预测目标y负相关的特征有:{negative_corr_features}'))\n", + " draw_feature_trend(feature_data_df, negative_corr_features)\n", + " \n", + " \n", + " # 计算correlation_sum 第一行的相关性的绝对值的总和\n", + " correlation_sum = correlation_matrix.abs().sum()\n", + " logger.info(f'{name}类指标的相关性总和为:{correlation_sum}')\n", + " # 分组的相关性总和拼接到grouped_corr\n", + " goup_corr = pd.DataFrame({'指标分类': [name], '指标数量': [len(cols_subset)], '相关性总和': [correlation_sum]})\n", + " grouped_corr = pd.concat([grouped_corr, goup_corr], axis=0, ignore_index=True)\n", + "\n", + " # 绘制相关性总和的气泡图\n", + " logger.info(f'开始绘制相关性总和的气泡图')\n", + " plt.figure(figsize=(10, 10))\n", + " sns.scatterplot(data=grouped_corr, x='相关性总和', y='指标数量', size='相关性总和', sizes=(grouped_corr['相关性总和'].min()*5, grouped_corr['相关性总和'].max()*5), hue='指标分类', palette='viridis')\n", + " plt.title('指标分类相关性总和的气泡图')\n", + " plt.ylabel('数量')\n", + " plt.savefig(os.path.join(dataset, '指标分类相关性总和的气泡图.png'), bbox_inches='tight')\n", + " plt.close()\n", + " content.append(Graphs.draw_img(os.path.join(dataset,'指标分类相关性总和的气泡图.png')))\n", + " logger.info(f'绘制相关性总和的气泡图结束')\n", + " \n", + "\n", + "\n", + " # # 计算特征相关性\n", + " # data.rename(columns={y: 'y'}, inplace=True) \n", + " # data['ds'] = pd.to_datetime(data['ds']) \n", + " # data.drop(columns=['ds'], inplace=True)\n", + " # # 创建一个空的 DataFrame 来保存相关系数\n", + " # correlation_df = pd.DataFrame(columns=['Feature', 'Correlation'])\n", + " # # 计算各特征与目标列的皮尔逊相关系数,并保存到新的 Data 中\n", + " # for col in data.columns:\n", + " # if col!= 'y':\n", + " # pearson_correlation = np.corrcoef(data[col], data['y'])[0, 1]\n", + " # spearman_correlation, _ = spearmanr(data[col], data['y'])\n", + " # new_row = {'Feature': col, 'Pearson_Correlation': round(pearson_correlation,3), 'Spearman_Correlation': round(spearman_correlation,2)}\n", + " # correlation_df = correlation_df._append(new_row, ignore_index=True)\n", + "\n", + " # correlation_df.drop('Correlation', axis=1, inplace=True)\n", + " # correlation_df.dropna(inplace=True)\n", + " # correlation_df.to_csv(os.path.join(dataset,'指标相关性分析.csv'), index=False)\n", + "\n", + " # data = correlation_df['Pearson_Correlation'].values.tolist()\n", + " # # 生成 -1 到 1 的 20 个区间\n", + " # bins = np.linspace(-1, 1, 21)\n", + " # # 计算每个区间的统计数(这里是区间内数据的数量)\n", + " # hist_values = [np.sum((data >= bins[i]) & (data < bins[i + 1])) for i in range(len(bins) - 1)]\n", + "\n", + " # #设置画布大小\n", + " # plt.figure(figsize=(10, 6))\n", + " # # 绘制直方图\n", + " # plt.bar(bins[:-1], hist_values, width=(bins[1] - bins[0]))\n", + "\n", + " # # 添加标题和坐标轴标签\n", + " # plt.title('皮尔逊相关系数分布图')\n", + " # plt.xlabel('区间')\n", + " # plt.ylabel('统计数')\n", + " # plt.savefig(os.path.join(dataset, '皮尔逊相关性系数.png'))\n", + " # plt.close()\n", + "\n", + "\n", + " # #设置画布大小\n", + " # plt.figure(figsize=(10, 6))\n", + " # data = correlation_df['Spearman_Correlation'].values.tolist()\n", + " # # 计算每个区间的统计数(这里是区间内数据的数量)\n", + " # hist_values = [np.sum((data >= bins[i]) & (data < bins[i + 1])) for i in range(len(bins) - 1)]\n", + "\n", + " # # 绘制直方图\n", + " # plt.bar(bins[:-1], hist_values, width=(bins[1] - bins[0]))\n", + "\n", + " # # 添加标题和坐标轴标签\n", + " # plt.title('斯皮尔曼相关系数分布图')\n", + " # plt.xlabel('区间')\n", + " # plt.ylabel('统计数')\n", + " # plt.savefig(os.path.join(dataset, '斯皮尔曼相关性系数.png'))\n", + " # plt.close()\n", + " # content.append(Graphs.draw_text(f'指标相关性分析--皮尔逊相关系数:'))\n", + " # # 皮尔逊正相关 不相关 负相关 的表格\n", + " # content.append(Graphs.draw_img(os.path.join(dataset,'皮尔逊相关性系数.png')))\n", + " # content.append(Graphs.draw_text('''皮尔逊相关系数说明:''')) \n", + " # content.append(Graphs.draw_text('''衡量两个特征之间的线性相关性。''')) \n", + " # content.append(Graphs.draw_text('''\n", + " # 相关系数为1:表示两个变量之间存在完全正向的线性关系,即当一个变量增加时,另一个变量也相应增加,且变化是完全一致的。''')) \n", + " # content.append(Graphs.draw_text('''当前特征中正相关前十的有:''')) \n", + " # top10_columns = correlation_df.sort_values(by='Pearson_Correlation',ascending=False).head(10)['Feature'].to_list()\n", + " # top10 = ','.join(top10_columns)\n", + " # content.append(Graphs.draw_text(f'''{top10}''')) \n", + "\n", + " # feature_df = feature_data_df[['ds','y']+top10_columns]\n", + " # # 遍历X每一列,和yy画散点图 ,\n", + " # for i, col in enumerate(feature_df.columns):\n", + " # print(f'正在绘制第{i+1}个特征{col}与价格散点图...')\n", + " # if col not in ['ds', 'y']:\n", + " # fig, ax1 = plt.subplots(figsize=(10, 6))\n", + " # # 在第一个坐标轴上绘制数据\n", + " # ax1.plot(feature_df['ds'], feature_df['y'], 'b-')\n", + " # ax1.set_xlabel('日期')\n", + " # ax1.set_ylabel('y', color='b')\n", + " # ax1.tick_params('y', colors='b')\n", + " # # 在 ax1 上添加文本显示值,添加一定的偏移避免值与曲线重叠\n", + " # for j in range(1,len(feature_df),2):\n", + " # value = feature_df['y'].iloc[j]\n", + " # date = feature_df['ds'].iloc[j]\n", + " # offset = 1.001\n", + " # ax1.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='b', fontsize=10)\n", + " # # 创建第二个坐标轴\n", + " # ax2 = ax1.twinx()\n", + " # # 在第二个坐标轴上绘制数据\n", + " # line2 = ax2.plot(feature_df['ds'], feature_df[col], 'r-')\n", + " # ax2.set_ylabel(col, color='r')\n", + " # ax2.tick_params('y', colors='r')\n", + " # # 在 ax2 上添加文本显示值,添加一定的偏移避免值与曲线重叠\n", + " # for j in range(0,len(feature_df),2):\n", + " # value = feature_df[col].iloc[j]\n", + " # date = feature_df['ds'].iloc[j]\n", + " # offset = 1.001\n", + " # ax2.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='r', fontsize=10)\n", + " # # 添加标题\n", + " # plt.title(col)\n", + " # # 设置横坐标为日期格式并自动调整\n", + " # locator = mdates.AutoDateLocator()\n", + " # formatter = mdates.AutoDateFormatter(locator)\n", + " # ax1.xaxis.set_major_locator(locator)\n", + " # ax1.xaxis.set_major_formatter(formatter)\n", + " # # 文件名特殊字符处理\n", + " # col = col.replace('*', '-')\n", + " # col = col.replace(':', '-')\n", + " # plt.savefig(os.path.join(dataset, f'{col}与价格散点图.png'))\n", + " # content.append(Graphs.draw_img(os.path.join(dataset, f'{col}与价格散点图.png')))\n", + " # plt.close()\n", + "\n", + "\n", + " # content.append(Graphs.draw_text(f'指标相关性分析--斯皮尔曼相关系数:'))\n", + " # # 皮尔逊正相关 不相关 负相关 的表格\n", + " # content.append(Graphs.draw_img(os.path.join(dataset,'斯皮尔曼相关性系数.png')))\n", + " # content.append(Graphs.draw_text('斯皮尔曼相关系数(Spearmans rank correlation coefficient)是一种用于衡量两个变量之间的单调关系(不一定是线性关系)的统计指标。'))\n", + " # content.append(Graphs.draw_text('它的计算基于变量的秩次(即变量值的排序位置)而非变量的原始值。'))\n", + " # content.append(Graphs.draw_text('斯皮尔曼相关系数的取值范围在 -1 到 1 之间。'))\n", + " # content.append(Graphs.draw_text('当系数为 1 时,表示两个变量之间存在完全正的单调关系;'))\n", + " # content.append(Graphs.draw_text('''当前特征中正单调关系前十的有:''')) \n", + " # top10_columns = correlation_df.sort_values(by='Spearman_Correlation',ascending=False).head(10)['Feature'].to_list()\n", + " # top10 = ','.join(top10_columns)\n", + " # content.append(Graphs.draw_text(f'''{top10}''')) \n", + "\n", + " # feature_df = feature_data_df[['ds','y']+top10_columns]\n", + " # # 遍历X每一列,和yy画散点图 ,\n", + " # for i, col in enumerate(feature_df.columns):\n", + " # print(f'正在绘制第{i+1}个特征{col}与价格散点图...')\n", + " # if col not in ['ds', 'y']:\n", + " # fig, ax1 = plt.subplots(figsize=(10, 6))\n", + " # # 在第一个坐标轴上绘制数据\n", + " # ax1.plot(feature_df['ds'], feature_df['y'], 'b-')\n", + " # ax1.set_xlabel('日期')\n", + " # ax1.set_ylabel('y', color='b')\n", + " # ax1.tick_params('y', colors='b')\n", + " # # 在 ax1 上添加文本显示值,添加一定的偏移避免值与曲线重叠\n", + " # for j in range(1,len(feature_df),2):\n", + " # value = feature_df['y'].iloc[j]\n", + " # date = feature_df['ds'].iloc[j]\n", + " # offset = 1.001\n", + " # ax1.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='b', fontsize=10)\n", + " # # 创建第二个坐标轴\n", + " # ax2 = ax1.twinx()\n", + " # # 在第二个坐标轴上绘制数据\n", + " # line2 = ax2.plot(feature_df['ds'], feature_df[col], 'r-')\n", + " # ax2.set_ylabel(col, color='r')\n", + " # ax2.tick_params('y', colors='r')\n", + " # # 在 ax2 上添加文本显示值,添加一定的偏移避免值与曲线重叠\n", + " # for j in range(0,len(feature_df),2):\n", + " # value = feature_df[col].iloc[j]\n", + " # date = feature_df['ds'].iloc[j]\n", + " # offset = 1.001\n", + " # ax2.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='r', fontsize=10)\n", + " # # 添加标题\n", + " # plt.title(col)\n", + " # # 设置横坐标为日期格式并自动调整\n", + " # locator = mdates.AutoDateLocator()\n", + " # formatter = mdates.AutoDateFormatter(locator)\n", + " # ax1.xaxis.set_major_locator(locator)\n", + " # ax1.xaxis.set_major_formatter(formatter)\n", + " # # 文件名特殊字符处理\n", + " # col = col.replace('*', '-')\n", + " # col = col.replace(':', '-')\n", + " # plt.savefig(os.path.join(dataset, f'{col}与价格散点图.png'))\n", + " # content.append(Graphs.draw_img(os.path.join(dataset, f'{col}与价格散点图.png')))\n", + " # plt.close()\n", + "\n", + " # content.append(Graphs.draw_text('当系数为 -1 时,表示存在完全负的单调关系;'))\n", + " # content.append(Graphs.draw_text('''当前特征中负单调关系前十的有:''')) \n", + " # tail10_columns = correlation_df.sort_values(by='Spearman_Correlation',ascending=True).head(10)['Feature'].to_list()\n", + " # top10 = ','.join(tail10_columns)\n", + " # content.append(Graphs.draw_text(f'''{top10}''')) \n", + " # # 获取特征的近一周值\n", + " # feature_df = feature_data_df[['ds','y']+tail10_columns]\n", + " # # 遍历X每一列,和yy画散点图 ,\n", + " # for i, col in enumerate(feature_df.columns):\n", + " # print(f'正在绘制第{i+1}个特征{col}与价格散点图...')\n", + " # if col not in ['ds', 'y']:\n", + " # fig, ax1 = plt.subplots(figsize=(10, 6))\n", + " # # 在第一个坐标轴上绘制数据\n", + " # ax1.plot(feature_df['ds'], feature_df['y'], 'b-')\n", + " # ax1.set_xlabel('日期')\n", + " # ax1.set_ylabel('y', color='b')\n", + " # ax1.tick_params('y', colors='b')\n", + " # # 在 ax1 上添加文本显示值,添加一定的偏移避免值与曲线重叠\n", + " # for j in range(len(feature_df)):\n", + " # if j%2 == 1:\n", + " # value = feature_df['y'].iloc[j]\n", + " # date = feature_df['ds'].iloc[j]\n", + " # offset = 1.001\n", + " # ax1.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='b', fontsize=10)\n", + " # # 创建第二个坐标轴\n", + " # ax2 = ax1.twinx()\n", + " # # 在第二个坐标轴上绘制数据\n", + " # line2 = ax2.plot(feature_df['ds'], feature_df[col], 'r-')\n", + " # ax2.set_ylabel(col, color='r')\n", + " # ax2.tick_params('y', colors='r')\n", + " # # 在 ax2 上添加文本显示值,添加一定的偏移避免值与曲线重叠\n", + " # for j in range(1,len(feature_df),2):\n", + " # value = feature_df[col].iloc[j]\n", + " # date = feature_df['ds'].iloc[j]\n", + " # offset = 1.001\n", + " # ax2.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='r', fontsize=10)\n", + " # # 添加标题\n", + " # plt.title(col)\n", + " # # 设置横坐标为日期格式并自动调整\n", + " # locator = mdates.AutoDateLocator()\n", + " # formatter = mdates.AutoDateFormatter(locator)\n", + " # ax1.xaxis.set_major_locator(locator)\n", + " # ax1.xaxis.set_major_formatter(formatter)\n", + " # # 文件名特殊字符处理\n", + " # col = col.replace('*', '-')\n", + " # col = col.replace(':', '-')\n", + " # plt.savefig(os.path.join(dataset, f'{col}与价格散点图.png'))\n", + " # content.append(Graphs.draw_img(os.path.join(dataset, f'{col}与价格散点图.png')))\n", + " # plt.close()\n", + " # content.append(Graphs.draw_text('当系数为 0 时,表示两个变量之间不存在单调关系。'))\n", + " # content.append(Graphs.draw_text('与皮尔逊相关系数相比,斯皮尔曼相关系数对于数据中的异常值不敏感,更适用于处理非线性关系或存在极端值的数据。'))\n", + " content.append(Graphs.draw_little_title('模型选择:'))\n", + " content.append(Graphs.draw_text(f'预测使用了{num_models}个模型进行训练拟合,通过评估指标MAE从小到大排列,前5个模型的简介如下:'))\n", + "\n", + " ### 读取模型简介\n", + " with open(os.path.join(dataset,'model_introduction.txt'), 'r', encoding='utf-8') as f:\n", + " for line in f:\n", + " line_split = line.strip().split('--')\n", + " if line_split[0] in fivemodels_list:\n", + " for introduction in line_split:\n", + " content.append(Graphs.draw_text(introduction))\n", + "\n", + " content.append(Graphs.draw_little_title('模型评估:'))\n", + " \n", + " df = pd.read_csv(os.path.join(dataset,'model_evaluation.csv'),encoding='utf-8') \n", + " # 判断 df 的数值列转为float\n", + " for col in eval_df.columns:\n", + " if col not in ['模型(Model)']:\n", + " eval_df[col] = eval_df[col].astype(float)\n", + " eval_df[col] = eval_df[col].round(3)\n", + " # 筛选 fivemodels_list.tolist() 的行\n", + " eval_df = eval_df[eval_df['模型(Model)'].isin(fivemodels_list)]\n", + " # df转置\n", + " eval_df = eval_df.T\n", + " # df重置索引\n", + " eval_df = eval_df.reset_index()\n", + " eval_df = eval_df.T\n", + " # # 添加表格\n", + " data = eval_df.values.tolist()\n", + " col_width = 500/len(eval_df.columns)\n", + " content.append(Graphs.draw_table(col_width,*data))\n", + " content.append(Graphs.draw_text('评估指标释义:'))\n", + " content.append(Graphs.draw_text('1. 均方根误差(RMSE):均方根误差是衡量预测值与实际值之间误差的一种方法,取值越小,误差越小,预测效果越好。'))\n", + " content.append(Graphs.draw_text('2. 平均绝对误差(MAE):平均绝对误差是衡量预测值与实际值之间误差的一种方法,取值越小,误差越小,预测效果越好。'))\n", + " content.append(Graphs.draw_text('3. 平均平方误差(MSE):平均平方误差是衡量预测值与实际值之间误差的一种方法,取值越小,误差越小,预测效果越好。'))\n", + " content.append(Graphs.draw_text('模型拟合:'))\n", + " # 添加图片\n", + " content.append(Graphs.draw_img(os.path.join(dataset,'预测值与真实值对比图.png')))\n", + "\n", + " # 附1,特征列表\n", + " content.append(Graphs.draw_little_title('附1、特征列表:'))\n", + " df_fuyi = pd.read_csv(os.path.join(dataset,'特征频度统计.csv'),encoding='utf-8') \n", + " for col in df_fuyi.columns:\n", + " fuyi = df_fuyi[col]\n", + " fuyi = fuyi.dropna()\n", + " content.append(Graphs.draw_text(f'{col}:'))\n", + " for i in range(len(fuyi)):\n", + " content.append(Graphs.draw_text(f'{i+1}、{fuyi[i]}'))\n", + " \n", + "\n", + "\n", + " ### 生成pdf文件\n", + " doc = SimpleDocTemplate(os.path.join(dataset,reportname), pagesize=letter)\n", + " # doc = SimpleDocTemplate(os.path.join(dataset,'reportname.pdf'), pagesize=letter)\n", + " doc.build(content)\n", + " # pdf 上传到数字化信息平台\n", + " # 读取pdf并转为base64\n", + " try:\n", + " if is_update_report:\n", + " with open(os.path.join(dataset,reportname), 'rb') as f:\n", + " base64_data = base64.b64encode(f.read()).decode('utf-8')\n", + " upload_data[\"data\"][\"fileBase64\"] = base64_data\n", + " upload_data[\"data\"][\"fileName\"] = reportname\n", + " token = get_head_auth_report()\n", + " upload_report_data(token, upload_data)\n", + " except TimeoutError as e:\n", + " print(f\"请求超时: {e}\")\n", + " \n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "id": "a97ed0d6-72c5-4747-a0cf-1d61a67c6efb", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "开始绘制Kpler数据--原油出口类指标的相关性直方图\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Kpler数据--原油出口下正相关的特征值有: []\n", + "Kpler数据--原油出口下负相关的特征值有: ['Libya', 'Malaysia']\n", + "正在绘制第1个特征Libya与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征Malaysia与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "Kpler数据--原油出口类指标的相关性总和为:1.2195460245793044\n", + "C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_516556\\1834129600.py:209: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", + " grouped_corr = pd.concat([grouped_corr, goup_corr], axis=0, ignore_index=True)\n", + "开始绘制价格类指标的相关性直方图\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "价格下正相关的特征值有: ['收盘价:原油指数', '阿曼原油 (湛江交割) 到岸入库成本', 'SC c4夜盘收盘价滞后1天', 'SC c4夜盘收盘价', 'SC c3夜盘收盘价滞后1天', 'SC c3夜盘收盘价', '美国取暖油HOC12', 'SC c2夜盘收盘价滞后1天', '美国取暖油HOC11', '美国取暖油HOC10', 'SC理论估值-巴中', 'SC c2夜盘收盘价', '美国取暖油HOC9', 'SC c1 夜盘收盘价滞后1天', '美国取暖油HOC8', 'Brent c4 结算', 'Dubai连3合约价格', 'SC c1 夜盘收盘价', '美国取暖油HOC7', '现货价:原油(中国大庆)', 'RBOB+HO平均', 'Brent c3 结算', 'HO12合约算术平均', 'Dubai FOB M3', 'WTI 近12月合约均价', '美国取暖油HOC6', 'Brent12期合约均价', '美国取暖油HOC5', 'Dubai FOB M2', 'Brent c2 结算', '美国取暖油HOC4', '欧洲柴油现货价格', 'RBOB12合约算术平均', 'WTI c4 结算', 'Brent c1 结算', '美国车用汽油零售价格', '阿曼原油 (湛江交割) 到岸入罐成本', '现货价:原油(中国胜利)', '现货价:原油(印尼杜里)', 'Dubai FOB M1', '现货价:原油(阿联酋迪拜)', '现货价:原油(阿曼)', 'Oman FOB M1', 'WTI c3 结算', '现货价:原油:科威特能源公司', '美国柴油零售价格', 'Brent主力收盘价', 'OPEC:一揽子原油价格', 'Dubai swap c2', 'Midland原油现货价格', 'WTI c2 结算', 'Dubai swap c3', '现货价:原油(西德克萨斯中级轻质原油(WTI)):FOB库欣', '巴重FOB出口亚洲现货价格', 'WTI c1 结算', '现货价:原油:美国西德克萨斯中级轻质原油(WTI)', 'WTI原油现货价格Cushing', '现货价:原油:英国布伦特Dtd', 'Brent原油现货价格', 'LLS原油现货价格', '现货价:原油(布伦特):FOB欧洲', '现货价:原油(马来西亚塔皮斯)', 'Forties FOB', '美国MARS原油现货价格', '美国MEH轻原油现货价格(美湾)', '马瑞原油:现货价:山东(日)', '现货价:马瑞原油:山东', '现货价:原油(印尼米纳斯)', '新加坡航煤裂解', '美湾WTI211裂解价差', 'WTI 3:2:1裂解价差', '欧洲Brent成品油裂解价差(领先一周)', '欧洲Brent成品油裂解价差', '欧洲柴油裂解', '美国取暖油裂解价差', '现货价:原油(印尼辛塔)', 'Brent连6-连12', '美国汽油裂解价差', '沙轻欧洲OSP(日度)', '欧洲汽油裂解', 'Brent连1-连9月差', '新加坡汽油裂解价差', 'WTI 3:2:1裂解价差超季节性/5年', 'Brent连1-连6月差', 'Dubai 连2-连3', '沙特中质OSP(日度)', 'Brent 连2-连3', 'Asia Tapis 211 裂解价差', 'Brent连1-连4', '原油运输指数(BDTI)', '沙轻OSP(日度)', '沙特轻质日度osp', '新加坡汽油裂解', 'Iraq SOMO Basrah Medium Crude Oil Official Selling Price Asia(日度)', 'WTI 连2-连3月差', 'Brent连1-连2月差', 'BrentC1-C2', 'Brent现货价格-Brent连4', 'WTI连1-连4', 'Brent连1-WTI连4', 'Brent现货价格-Brent连3', 'DFL(Dated-主力布伦特)', 'DFL(即期布伦特-布伦特期货C1)', '布伦特现货价格-Brent连2', 'Dubai FOB M1-M2', 'Brent连2-WTI连4', 'SC C1-C2月差', 'Brent连1-WTI连3', '迪拜原油211裂解价差', 'SC c1-SC c2 (夜盘)滞后1天', 'SC c2夜盘-理论估值(巴中)', 'SC c1-SC c2 (夜盘)', 'DFL', 'WTIC1-C2', 'WTI连1-连2月差', 'SC主力-阿曼入库成本', 'Forties - Brent c1', 'Brent连2-WTI连2超季节性/3年', 'Brent连2-WTI连3', 'Brent连3-WTI连4', 'Brent连1-WTI连2', 'Brent连3-WTI连2超季节性/3年', 'WTI原油Cushing-C1', 'Brent 连2-连3超季节性/3年', 'Brent-LLS价差', 'WTI-LLS价差', '美湾低硫柴油现货价格', 'SC c1-阿曼入库成本', 'B-W价差(均价)', 'Brent连4-WTI连4', 'SC-Brent*汇率', 'Brent c2 16:30收盘价', 'Brent连3-WT连3', '中国:一揽子原油价格变化率']\n", + "正在绘制第1个特征收盘价:原油指数与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征阿曼原油 (湛江交割) 到岸入库成本与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征SC c4夜盘收盘价滞后1天与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征SC c4夜盘收盘价与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征SC c3夜盘收盘价滞后1天与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "价格下负相关的特征值有: ['SC c5 -估值', '马瑞原油:重质:DES价:委内瑞拉(日)', '中东原油强弱程度-巴中', 'Dubai原油强弱程度(Dubai FOB M1-Dubai FOB M2-EFS)', '美国MARS贴水(WTI)', 'SC c3夜盘-阿曼入库湛江成本', 'Brent连4-WTI连1', 'CFTC Crude Oil Furtures', 'SC c3-阿曼到岸入罐成本', 'Brent连4-WTI连2', 'Brent连3-WTI连1', 'Forties - Dated Brent', '丙烷CFR华南/布伦特原油比价', 'EFS c1 02:30收盘价', 'EFS c1 02:30收盘价滞后1天', '国内马瑞与SC比价', 'Dubai-WTI价差', 'SC c2夜盘-Brent c1*汇率', 'SC c2夜盘-阿曼入库湛江成本', 'Brent连2-WTI连1', 'Brent c2 - WTI c1', 'Brent连3-WTI连2', 'EFS c2 02:30收盘价', 'EFS c2 02:30收盘价滞后1天', 'SC c3夜盘-理论估值(巴中)', 'Brent连4-WTI连3', '美国汽油裂解价差超季节性/3年', 'LLS-Brent价差', 'SC c2夜盘-Brent c2*汇率', 'Brent c1 02:30收盘价', 'Brent c1 02:30收盘价滞后1天', 'SC c1夜盘-Brent c1*汇率', 'B-W价差', 'Brent c1 16:30收盘价', 'Brent连2-WTI连2', 'Brent c2 02:30收盘价滞后1天', 'Brent c2 02:30收盘价', 'Brent油价30日动能']\n", + "正在绘制第1个特征SC c5 -估值与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征马瑞原油:重质:DES价:委内瑞拉(日)与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征中东原油强弱程度-巴中与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征Dubai原油强弱程度(Dubai FOB M1-Dubai FOB M2-EFS)与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征美国MARS贴水(WTI)与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "价格类指标的相关性总和为:100.82932362894148\n", + "开始绘制供应类指标的相关性直方图\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "供应下正相关的特征值有: ['EIA周度NGL产量', '美国炼厂产能利用率超季节性/5年', '美国炼厂原油输入量超季节性/3年', '彭博西非海上浮仓', 'Lower48原油产量', '美国:产量:原油', '美国国内周度原油产量', '美国原油活跃钻机数同差', '航空燃料油产量', '美国炼厂产能利用率', '原油:主营炼厂:加工量:中国(周)', '彭博中东海上浮仓', '美国炼厂产能利用率同差', '加拿大原油活跃钻机数', 'Haynesville活跃钻机数', 'EagleFord钻机数', '彭博全球海上浮仓+在运原油', '美国炼厂原油输入量', '汽油产量', '美国原油周度调整项', 'Permian盆地钻机数', 'Williston盆地钻机数', '美国总钻机数', '美国原油和天然气钻机总数', '美国海上钻机数', 'ArkmoreWoodford钻机数', '美国陆上钻机数', '美国原油活跃钻机数', 'FracSpread完井数', 'US Oil & Gas Exploration & Drilling Frac Spread Count', '美国车用汽油混合成分净投入量', '柴油产量']\n", + "正在绘制第1个特征EIA周度NGL产量与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征美国炼厂产能利用率超季节性/5年与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征美国炼厂原油输入量超季节性/3年与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征彭博西非海上浮仓与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征Lower48原油产量与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "供应下负相关的特征值有: ['原油:常减压:产能利用率:山东:独立炼厂(周)', '中国32家地炼开工率', '原油:山东独立炼厂:开工率:新口径(周)', '美国汽油净进口(周度)', '原油:独立炼厂:加工量:中国(周)', '彭博北海海上浮仓', '彭博美国墨西哥湾海上浮仓', '原油:常减压:独立炼厂:产能利用率:中国(周)', '彭博欧洲海上浮仓', 'Marcellus钻机数', '彭博亚洲海上浮仓', '美国:企业债利差:美银美国高收益CCC或以下级企业债期权调整利差', '全球海上浮仓', '原油加工量/主营+独立', '原油:加工量:中国(周)', 'CanaWoodford活跃钻机数', 'DJ-Niobrara活跃钻机数', 'ArkomaWoodford活跃钻机数', 'Utica活跃钻机数', '美国可利用天然气库存(48州合计)']\n", + "正在绘制第1个特征原油:常减压:产能利用率:山东:独立炼厂(周)与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征中国32家地炼开工率与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征原油:山东独立炼厂:开工率:新口径(周)与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征美国汽油净进口(周度)与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征原油:独立炼厂:加工量:中国(周)与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "供应类指标的相关性总和为:15.840978265291456\n", + "开始绘制供应给类指标的相关性直方图\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "供应给下正相关的特征值有: ['美国原油周度产量']\n", + "正在绘制第1个特征美国原油周度产量与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "供应给类指标的相关性总和为:1.5494166338813118\n", + "开始绘制其他类指标的相关性直方图\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "供应给下负相关的特征值有: []\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "其他下正相关的特征值有: ['C2403150124', 'FVHCM1 INDEX', 'dxy curncy', 'lmcads03 lme comdty', 'GC1 COMB Comdty', 'C2403128043', 'doedtprd index']\n", + "正在绘制第1个特征C2403150124与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征FVHCM1 INDEX与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征dxy curncy与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征lmcads03 lme comdty与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征GC1 COMB Comdty与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "其他下负相关的特征值有: ['CFFDQMMN INDEX', 'C2404167855', 'C2404167878', 'ovx index', 'C2403083739']\n", + "正在绘制第1个特征CFFDQMMN INDEX与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征C2404167855与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征C2404167878与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征ovx index与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征C2403083739与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "其他类指标的相关性总和为:6.8961549515138625\n", + "开始绘制宏观类指标的相关性直方图\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "宏观下正相关的特征值有: ['10年期美国国债收益率', '2年期美国国债收益率']\n", + "正在绘制第1个特征10年期美国国债收益率与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征2年期美国国债收益率与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "宏观类指标的相关性总和为:2.6101416770520123\n", + "开始绘制库存类指标的相关性直方图\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "宏观下负相关的特征值有: []\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "库存下正相关的特征值有: ['全球原油陆上库容', '彭博全球海上在运原油', '中国陆上原油商业库存', '中国陆上原油炼厂库存', '美国PADD4原油库存', '原油PADD4商业库存', '中国陆上原油库存', '中国陆上和浮仓原油总量', '中国海陆原油总量', '全球海上原油', '美国取暖用油库存同差', '汽油库存差', 'DOE CBOB Gasoline Total Stocks Data']\n", + "正在绘制第1个特征全球原油陆上库容与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征彭博全球海上在运原油与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征中国陆上原油商业库存与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征中国陆上原油炼厂库存与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征美国PADD4原油库存与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "库存下负相关的特征值有: ['美国原油成品油总库存(含SPR)', '美国原油及成品油总库存', '美国原油总库存', '原油:山东独立炼厂:厂内库存:新口径(周)', '全球原油陆上SPR库存', '柴油PADD1库存', '美国战略储备原油库存', '美国原油战略库存', '汽油成品库存', '美国成品车用汽油库存', '美国成品车用汽油库存占比', '全球陆上岸罐原油库存', '美国PADD2原油库存', '原油PADD2商业库存', '美国原油库欣商业库存', '库欣原油库存', '美国柴油总库存', 'SC期货库存1000天百分位', '原油:库容比:山东:独立炼厂(周)', '汽油PADD1库存', 'EIA美国汽柴航煤库存', '美国成品油库存超季节性/5年', '美国PADD1原油库存', '原油PADD1商业库存', '全球海陆原油总量', 'EIA美国油品库存(含SPR)', '美国原油及成品油总库存(除SPR)', '美国EIA原油成品油总库存(不含SPR)', '美国商业原油库存超季节性/5年', '新加坡燃料油库存', '美国成品油库存超季节性/4年', '美国EIA原油成品油总库存(不含SPR)超季节性/4年(含今年)', 'EIA美国原油总库存(含SPR)', '美国原油商业库存', '美国商业原油库存', '原油PADD5商业库存', '美国PADD5原油库存', '美国汽油总库存', '美国成品油库存', '成品油总库存', '柴油PADD5库存', '美国商业原油库存超季节性/4年', '柴油PADD3库存', 'DOE RBOB Gasoline Total Stocks Data', '库欣+PADD3库存', 'ARA原油及成品油库存', '中国陆上原油SPR库存', 'SC仓单(百万桶)', '库欣原油库存超季节性/5年', '美国汽油库销比', '中国陆上原油库容率', '汽油PADD2库存', '全球原油浮仓总量', '美国汽油调和组分库存(周度)', '汽油调油组分库存', '美国调和汽油库存', '中国海上原油浮仓', '柴油PADD2库存', '汽油PADD5库存', '汽油PADD4库存', '中国海上原油总量', 'ARA原油库存', 'SC期货库存10期滚动标准差', '原油PADD3商业库存', '美国PADD3原油库存', '柴油PADD4库存', '汽油PADD3库存', '航空燃料油总库存', '全球原油陆上商业和炼厂库存']\n", + "正在绘制第1个特征美国原油成品油总库存(含SPR)与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征美国原油及成品油总库存与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征美国原油总库存与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征原油:山东独立炼厂:厂内库存:新口径(周)与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征全球原油陆上SPR库存与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "库存类指标的相关性总和为:39.8290452717341\n", + "开始绘制期货市场类指标的相关性直方图\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "期货市场下正相关的特征值有: ['WTI活跃合约', 'Brent主力*汇率', 'WTI连24合约', 'SC理论估值-Dubai原油', '印度原油连1合约价格', 'Oman c1 * 汇率', 'SC原油期货价格', '期货结算价(活跃合约):INE原油', 'SCc4夜盘收盘(日期调整)', '期货收盘价(连续):INE原油', '期货结算价(连续):INE原油', 'INE SC c1', 'HO连12合约', 'HO连11合约', 'SCc3夜盘收盘(日期调整)', 'HO连10合约', 'HO连9合约', 'SCc2夜盘收盘(日期调整)', 'HO连8合约', 'ICE Brent c14', 'ho连7合约', 'HO近12月合约均价', 'HO连6合约', 'SCc1夜盘收盘(日期调整)', 'ICE轻柴油连4合约价格', 'HO连5合约', 'B06.IPE结算价', 'B05.IPE结算价', '布油近12月合约均价', 'NYMWX WTI c5', 'Dubai连1合约价格', 'B04.IPE结算价', 'B03.IPE结算价', 'RBOB近12月合约均价', 'DME Oman c1', 'B02.IPE结算价', 'Dubai Swap c1', '期货结算价(活跃):布伦特原油', '期货收盘价(活跃):布伦特原油', 'IPE布油期货结算价', 'Oman Swap c1', 'CFD W6', 'Brent连1合约价格', 'B00.IPE结算价', '期货收盘价:WTI原油', 'CFD W1', 'WTI连1合约价格', 'Murban Futures c1', 'RBOB&HO近12月合约均价532裂解', 'HO近12月合约均价裂解', '可用库容量:INE原油:辽宁:合计', '可用库容量:INE原油', 'RBOB近12月合约均价裂解', '可用库容量:INE原油:山东:合计', 'SC连1-连6', 'Brent c1-c9', 'DFL M2', 'Brent c2-c3 (结算)', 'HO连1-连6', 'Brent c1-c6', 'Brent c2-c3 (结算B)', 'WTI c2-c3 (结算B)', 'Dubai连1-连4月差', 'SC连2-连3月差', 'Brent c2-c3', 'SC c2-c3 (夜盘)', 'DFL M1', 'WTI c1-c6', 'WTI c2-c3', 'Brent c1-c3', 'Oman连2-连3月差', 'HO连1-连3', 'SC连1-连3月差', 'Brent c1-c2', '可用库容量:INE原油:广东:合计', 'SC/ZC(活跃合约)', 'HO连1-连2合约', 'CFD W1-Brent c1', 'WTI c1-c3', '可用库容量:INE原油:广东:中国石化湛江', 'RBOB连1-连6', '期货成交额:INE原油', 'Dubai swap c1-c3', 'SC c1-c2', 'SC连1-连2', 'Dubai swap c1-c2', 'WTI c1-c2', 'RBOB连2-连3月差', 'SC主力-理论估值', 'RBOB连1-连3', 'RBOB连1-连2', '舟山:可用库容:原油', 'SC c2夜盘-阿曼入库湛江成本(Oman c1预估)', 'SC c2日盘-Brent c1(15:00)*汇率', 'SC c1日盘-Brent c1(15:00)*汇率', 'Brent-Oman价差', 'SC c3夜盘-阿曼入库湛江成本(Oman c1预估)', 'SC c1夜盘-理论估值(Dubai)', '布伦特迪拜掉期 EFS', '阿曼原油 (湛江交割) 到岸入库成本(Oman c1预估)', 'SC c2夜盘-Brent c2 (结算)*汇率', 'OMAN原油:中质:远期现货DES价:山东(日)', 'SC c1夜盘-Brent c1 (结算B)*汇率']\n", + "正在绘制第1个特征WTI活跃合约与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征Brent主力*汇率与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征WTI连24合约与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征SC理论估值-Dubai原油与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征印度原油连1合约价格与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "期货市场下负相关的特征值有: ['BU-SC(活跃合约)', 'SC期货库存', '库存期货:INE原油:总计-卡塔尔海洋油', 'SC c3夜盘-理论估值(Dubai)', '库存期货:INE原油:广东:合计', '库存期货:INE原油:山东:合计', 'SC c3-Oman c1*汇率', 'SC主力-Brent主力*汇率', 'SC c2夜盘-Brent c1 (结算B)*汇率', 'INE SC主力合约价格', 'SC c2夜盘-Brent c1 (结算)*汇率', '库存期货:INE原油:辽宁:合计', '库存期货:INE原油:广东:中国石化湛江', '库存期货:INE原油:辽宁:中油大连国际', 'DUBAI原油贴水', 'Brent c1 15:00收盘价', 'SC内外价差', 'SC c2-Oman c1*汇率', 'SC c2夜盘-Brent c2 (结算B)*汇率', 'Brent-TI', '阿曼原油贴水', 'Brent-SC价差', 'SC c2夜盘-理论估值(Dubai)', 'SC c1夜盘-Brent c1 (结算)*汇率', 'Brent-WTI', 'Brent c2 15:00收盘价', '期货成交量(活跃合约):INE原油', 'SC c2日盘-Brent c2(15:00)*汇率']\n", + "正在绘制第1个特征BU-SC(活跃合约)与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征SC期货库存与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征库存期货:INE原油:总计-卡塔尔海洋油与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征SC c3夜盘-理论估值(Dubai)与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征库存期货:INE原油:广东:合计与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "期货市场类指标的相关性总和为:75.58279163176265\n", + "开始绘制西北欧市场类指标的相关性直方图\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "西北欧市场下正相关的特征值有: ['丹麦陆上原油库存', '德国陆上原油库存', '比利时陆上原油库存', '西班牙陆上原油库存']\n", + "正在绘制第1个特征丹麦陆上原油库存与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征德国陆上原油库存与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征比利时陆上原油库存与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征西班牙陆上原油库存与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "西北欧市场下负相关的特征值有: ['挪威陆上原油库存', '西北欧陆上原油浮仓', '西北欧陆上原油库存和浮仓总量', '英国陆上原油库存', '荷兰陆上原油库存', '波兰陆上原油库存', '西北欧陆上原油炼厂库存', '西北欧陆上原油库存', '西北欧陆上原油SPR库存', '法国陆上原油库存', '爱尔兰陆上原油库存', '立陶宛陆上原油库存', '西北欧陆上原油商业库存', '葡萄牙陆上原油库存', '瑞典陆上原油库存']\n", + "正在绘制第1个特征挪威陆上原油库存与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征西北欧陆上原油浮仓与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征西北欧陆上原油库存和浮仓总量与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征英国陆上原油库存与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征荷兰陆上原油库存与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "西北欧市场类指标的相关性总和为:6.178802143557726\n", + "开始绘制运输类指标的相关性直方图\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "运输下正相关的特征值有: ['莱茵河水位']\n", + "正在绘制第1个特征莱茵河水位与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "运输类指标的相关性总和为:1.0271999586909926\n", + "开始绘制进出口类指标的相关性直方图\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "运输下负相关的特征值有: []\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "进出口下正相关的特征值有: ['成品油周度出口', '原油和成品油周度出口', 'Suezmax:阿拉伯海湾-地中海', '原油周度出口', '美国原油总出口', '汽油周度出口', 'DOE-美国汽油出口', 'EIA美国汽油净出口', 'EIA美国航煤净出口', 'EIA美国原油净出口', 'DOE-航煤出口', '航空燃料油周度出口', 'EIA美国柴油净出口', '柴油周度出口', 'DOE-美国馏分燃料油出口', 'VLCC:中东-中国', 'DOE-美国汽油进口', '汽油周度进口', '美国原油总进口(含SPR)', '美国原油进口(除SPR)', '原油周度进口']\n", + "正在绘制第1个特征成品油周度出口与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征原油和成品油周度出口与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征Suezmax:阿拉伯海湾-地中海与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征原油周度出口与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征美国原油总出口与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "进出口下负相关的特征值有: ['成品油周度净进口', '原油和成品油周度净进口', 'DOE-美国汽油净进口', 'DOE-航煤净进口', '航空燃料油周度净进口', '原油周度净进口', '美国原油周度净进口', '汽油周度净进口', '航空燃料油周度进口', 'DOE-航煤进口', 'DOE-馏分燃料油进口', '柴油周度进口', '柴油周度净进口', 'DOE-美国馏分燃料油净进口', '成品油周度进口', '原油和成品油周度进口']\n", + "正在绘制第1个特征成品油周度净进口与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征原油和成品油周度净进口与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征DOE-美国汽油净进口与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征DOE-航煤净进口与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征航空燃料油周度净进口与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "进出口类指标的相关性总和为:12.348335094621218\n", + "开始绘制需求类指标的相关性直方图\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "需求下正相关的特征值有: ['西北欧炼厂加工Brent原油FCC利润', '西北欧炼厂加工Brent原油CDU利润 M2', '美墨湾炼厂加工WTI原油HSK利润', '美国汽油单一利润', '新加坡炼厂加工Dubai原油FCC利润', '西北欧炼厂加工Brent原油CDU利润', '美墨湾炼厂加工WTI原油CDU利润 M2', '美墨湾炼厂加工WTI原油CDU利润', 'DOE-美国汽油产量超季节性/3年', '美国其他油品周度表需', '主营原油加工量(千桶/日)', '中国主营炼厂原油加工量-隆众', 'PADD2原油投料输入量', '原油PADD2炼厂输入量', '美国汽油表需超季节性/4年', '美国航空燃料油周度表需', '原油PADD3炼厂输入量', 'PADD3原油投料输入量', 'EIA美国柴油产量(千桶日)', 'EIA美国油品需求', '美国原油炼厂输入量', '美国成品油周度表需', '美国汽油产量(周度)', 'DOE-美国汽油产量', '新加坡炼厂加工Dubai原油CDU利润 M2', '美国油品表需', '美国原油周度表需', '新加坡炼厂加工Dubai原油CDU利润', '美国汽油表需(周度)', '美国汽油周度表需', '美国燃料油周度表需', '西北欧炼厂加工Brent原油CDU利润 M1-M2', 'DOE-柴油产量', 'PADD1原油投料输入量', '原油PADD1炼厂输入量']\n", + "正在绘制第1个特征西北欧炼厂加工Brent原油FCC利润与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征西北欧炼厂加工Brent原油CDU利润 M2与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征美墨湾炼厂加工WTI原油HSK利润与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征美国汽油单一利润与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征新加坡炼厂加工Dubai原油FCC利润与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "需求下负相关的特征值有: ['原油:山东独立炼厂:开工率:新口径(周)超季节性/3年', '山东地炼厂常减压开工率', '中国独立炼厂原油加工量(千桶/日)', '中国独立炼厂原油加工量-隆众', '美国柴油产量占比', '美国丙烷和丙烯周度表需', '中国汽柴油表需', '美国汽油产量占比', '中国炼厂原油加工量-隆众', '原油加工量:独立+主营', '原油PADD4炼厂输入量', 'PADD4原油投料输入量', 'PADD5原油投料输入量', '原油PADD5炼厂输入量']\n", + "正在绘制第1个特征原油:山东独立炼厂:开工率:新口径(周)超季节性/3年与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第2个特征山东地炼厂常减压开工率与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第3个特征中国独立炼厂原油加工量(千桶/日)与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第4个特征中国独立炼厂原油加工量-隆众与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "正在绘制第5个特征美国柴油产量占比与价格散点图...\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "d:\\ProgramData\\anaconda3\\Lib\\site-packages\\seaborn\\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.\n", + " with pd.option_context('mode.use_inf_as_na', True):\n", + "需求类指标的相关性总和为:15.860192534217708\n", + "开始绘制相关性总和的气泡图\n", + "绘制相关性总和的气泡图结束\n", + "模型训练完成\n" + ] + } + ], + "source": [ + " \n", + "title = f'{settings}--{now}-预测报告' # 报告标题\n", + "brent_export_pdf(dataset=dataset,num_models = 5 if is_fivemodels else 22,time=end_time,\n", + " reportname=reportname,sqlitedb=sqlitedb),\n", + "# pp_export_pdf(dataset=dataset,num_models = 5 if is_fivemodels else 22,time=end_time,\n", + " # reportname=reportname),\n", + "logger.info('模型训练完成')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "98830098-a2a3-4d70-976b-fdce2d54bc10", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "base", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.7" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/lib/dataread.py b/lib/dataread.py index 3605848..1ead0be 100644 --- a/lib/dataread.py +++ b/lib/dataread.py @@ -20,8 +20,8 @@ plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签 plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号 from datetime import timedelta -# from config_jingbo import * -from config_juxiting import * +from config_jingbo import * +# from config_juxiting import * from sklearn import metrics from reportlab.pdfbase import pdfmetrics # 注册字体 from reportlab.pdfbase.ttfonts import TTFont # 字体类 diff --git a/main.py b/main.py index e5435f3..b9c32cc 100644 --- a/main.py +++ b/main.py @@ -1,7 +1,7 @@ # 读取配置 -# from config_jingbo import * +from config_jingbo import * # from config_tansuanli import * -from config_juxiting import * +# from config_juxiting import * from lib.dataread import * from lib.tools import * from models.nerulforcastmodels import ex_Model,model_losss,brent_export_pdf,tansuanli_export_pdf,pp_export_pdf @@ -39,8 +39,8 @@ def predict_main(): edbbusinessurl=edbbusinessurl, ) - # df_zhibiaoshuju,df_zhibiaoliebiao = etadata.get_eta_api_yuanyou_data(data_set=data_set,dataset=dataset) # 原始数据,未处理 - df_zhibiaoshuju,df_zhibiaoliebiao = etadata.get_eta_api_pp_data(data_set=data_set,dataset=dataset) # 原始数据,未处理 + df_zhibiaoshuju,df_zhibiaoliebiao = etadata.get_eta_api_yuanyou_data(data_set=data_set,dataset=dataset) # 原始数据,未处理 + # df_zhibiaoshuju,df_zhibiaoliebiao = etadata.get_eta_api_pp_data(data_set=data_set,dataset=dataset) # 原始数据,未处理 # 数据处理 diff --git a/models/nerulforcastmodels.py b/models/nerulforcastmodels.py index 009e0db..365e788 100644 --- a/models/nerulforcastmodels.py +++ b/models/nerulforcastmodels.py @@ -249,11 +249,9 @@ def model_losss(sqlitedb): df_combined3['quantile_10'] = df_combined3['volatility'].rolling(60).quantile(0.1) df_combined3['quantile_90'] = df_combined3['volatility'].rolling(60).quantile(0.9) df_combined3 = df_combined3.round(4) - # 计算分位数对应的价格,并移动到第二天 + # 计算分位数对应的价格 df_combined3['quantile_10_price'] = df_combined3['y'] * (1 + df_combined3['quantile_10']) - # df_combined3['quantile_10_price'] = df_combined3['quantile_10_price'].shift(1) df_combined3['quantile_90_price'] = df_combined3['y'] * (1 + df_combined3['quantile_90']) - # df_combined3['quantile_90_price'] = df_combined3['quantile_90_price'].shift(1) # 遍历行 def find_min_max_within_quantile(row): @@ -485,11 +483,68 @@ def model_losss(sqlitedb): plt.close() return model_results3 + +import matplotlib.dates as mdates + def brent_export_pdf(num_indicators=475,num_models=21, num_dayindicator=202,inputsize=5,dataset='dataset',time = '2024-07-30',reportname='report.pdf',sqlitedb='jbsh_yuanyou.db'): global y # 创建内容对应的空列表 content = list() - + # 获取特征的近一月值 + import pandas as pd + feature_data_df = pd.read_csv(f'dataset/指标数据添加时间特征.csv', parse_dates=['ds']).tail(20) + def draw_feature_trend(feature_data_df, features): + # 画特征近一周的趋势图 + feature_df = feature_data_df[['ds','y']+features] + # 遍历X每一列,和yy画散点图 , + + for i, col in enumerate(features): + # try: + print(f'正在绘制第{i+1}个特征{col}与价格散点图...') + if col not in ['ds', 'y']: + fig, ax1 = plt.subplots(figsize=(10, 6)) + # 在第一个坐标轴上绘制数据 + sns.lineplot(data=feature_df, x='ds', y='y', ax=ax1, color='b') + ax1.set_xlabel('日期') + ax1.set_ylabel('y', color='b') + ax1.tick_params('y', colors='b') + # 在 ax1 上添加文本显示值,添加一定的偏移避免值与曲线重叠 + for j in range(1, len(feature_df), 2): + value = feature_df['y'].iloc[j] + date = feature_df['ds'].iloc[j] + offset = 1.001 + ax1.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='b', fontsize=10) + # 创建第二个坐标轴 + ax2 = ax1.twinx() + # 在第二个坐标轴上绘制数据 + sns.lineplot(data=feature_df, x='ds', y=col, ax=ax2, color='r') + ax2.set_ylabel(col, color='r') + ax2.tick_params('y', colors='r') + # 在 ax2 上添加文本显示值,添加一定的偏移避免值与曲线重叠 + for j in range(0, len(feature_df), 2): + value = feature_df[col].iloc[j] + date = feature_df['ds'].iloc[j] + offset = 1.0003 + ax2.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='r', fontsize=10) + # 添加标题 + plt.title(col) + # 设置横坐标为日期格式并自动调整 + locator = mdates.AutoDateLocator() + formatter = mdates.AutoDateFormatter(locator) + ax1.xaxis.set_major_locator(locator) + ax1.xaxis.set_major_formatter(formatter) + # 文件名特殊字符处理 + col = col.replace('*', '-') + col = col.replace(':', '-') + col = col.replace(r'/', '-') + plt.savefig(os.path.join(dataset, f'{col}与价格散点图.png')) + content.append(Graphs.draw_img(os.path.join(dataset, f'{col}与价格散点图.png'))) + plt.close() + # except Exception as e: + # print(f'绘制第{i+1}个特征{col}与价格散点图时出错:{e}') + + + ### 添加标题 content.append(Graphs.draw_title(f'{y}{time}预测报告')) @@ -578,295 +633,296 @@ def brent_export_pdf(num_indicators=475,num_models=21, num_dayindicator=202,inpu # 绘制特征相关气泡图 content.append(Graphs.draw_text('气泡图中,横轴为指标名称,纵轴为指标名称,面积越大表示相关性越大,面积越小表示相关性越小。')) grouped = df_zhibiaofenlei.groupby('指标分类') - for name, group in grouped: - cols = group['指标名称'].tolist() - for n in range(0, len(cols), 10): - logger.info(f'开始绘制{name}类指标{n}的气泡图') - cols_subset = cols[n:n+10] - feature_names = ['y'] + cols_subset - correlation_matrix = df_zhibiaoshuju[feature_names].corr() - plt.figure(figsize=(10, 10)) - for i in range(len(feature_names)): - for j in range(len(feature_names)): - plt.scatter(i, j, s=abs(correlation_matrix.iloc[i, j]) * 1000, c=correlation_matrix.iloc[i, j], cmap='coolwarm', marker='o') - for i in range(len(feature_names)): - for j in range(len(feature_names)): - plt.text(i, j, f'{correlation_matrix.iloc[i, j]:.2f}', ha='center', va='center', color='black') - plt.xticks(range(len(feature_names)), feature_names, rotation=90) - plt.yticks(range(len(feature_names)), feature_names) - plt.title(f'{name}类指标{n}') - plt.xlabel('指标名称') - plt.ylabel('指标名称') - plt.savefig(os.path.join(dataset, f'{name}{n}气泡图.png'), bbox_inches='tight') - plt.close() - content.append(Graphs.draw_img(os.path.join(dataset,f'{name}{n}气泡图.png'))) - logger.info(f'绘制指标相关性气泡图结束') - - # 计算特征相关性 - data.rename(columns={y: 'y'}, inplace=True) - data['ds'] = pd.to_datetime(data['ds']) - data.drop(columns=['ds'], inplace=True) - # 创建一个空的 DataFrame 来保存相关系数 - correlation_df = pd.DataFrame(columns=['Feature', 'Correlation']) - # 计算各特征与目标列的皮尔逊相关系数,并保存到新的 DataFrame 中 - for col in data.columns: - if col!= 'y': - pearson_correlation = np.corrcoef(data[col], data['y'])[0, 1] - spearman_correlation, _ = spearmanr(data[col], data['y']) - new_row = {'Feature': col, 'Pearson_Correlation': round(pearson_correlation,3), 'Spearman_Correlation': round(spearman_correlation,2)} - correlation_df = correlation_df._append(new_row, ignore_index=True) - - correlation_df.drop('Correlation', axis=1, inplace=True) - correlation_df.dropna(inplace=True) - correlation_df.to_csv(os.path.join(dataset,'指标相关性分析.csv'), index=False) - - data = correlation_df['Pearson_Correlation'].values.tolist() - # 生成 -1 到 1 的 20 个区间 - bins = np.linspace(-1, 1, 21) - # 计算每个区间的统计数(这里是区间内数据的数量) - hist_values = [np.sum((data >= bins[i]) & (data < bins[i + 1])) for i in range(len(bins) - 1)] - - #设置画布大小 - plt.figure(figsize=(10, 6)) - # 绘制直方图 - plt.bar(bins[:-1], hist_values, width=(bins[1] - bins[0])) - - # 添加标题和坐标轴标签 - plt.title('皮尔逊相关系数分布图') - plt.xlabel('区间') - plt.ylabel('统计数') - plt.savefig(os.path.join(dataset, '皮尔逊相关性系数.png')) - plt.close() - - - #设置画布大小 - plt.figure(figsize=(10, 6)) - data = correlation_df['Spearman_Correlation'].values.tolist() - # 计算每个区间的统计数(这里是区间内数据的数量) - hist_values = [np.sum((data >= bins[i]) & (data < bins[i + 1])) for i in range(len(bins) - 1)] - - # 绘制直方图 - plt.bar(bins[:-1], hist_values, width=(bins[1] - bins[0])) - - # 添加标题和坐标轴标签 - plt.title('斯皮尔曼相关系数分布图') - plt.xlabel('区间') - plt.ylabel('统计数') - plt.savefig(os.path.join(dataset, '斯皮尔曼相关性系数.png')) - plt.close() - content.append(Graphs.draw_text(f'指标相关性分析--皮尔逊相关系数:')) - # 皮尔逊正相关 不相关 负相关 的表格 - content.append(Graphs.draw_img(os.path.join(dataset,'皮尔逊相关性系数.png'))) + grouped_corr = pd.DataFrame(columns=['指标分类', '指标数量', '相关性总和']) + + content.append(Graphs.draw_little_title('按指标分类分别与预测目标进行皮尔逊相关系数分析:')) content.append(Graphs.draw_text('''皮尔逊相关系数说明:''')) content.append(Graphs.draw_text('''衡量两个特征之间的线性相关性。''')) content.append(Graphs.draw_text(''' 相关系数为1:表示两个变量之间存在完全正向的线性关系,即当一个变量增加时,另一个变量也相应增加,且变化是完全一致的。''')) - content.append(Graphs.draw_text('''当前特征中正相关前十的有:''')) - top10_columns = correlation_df.sort_values(by='Pearson_Correlation',ascending=False).head(10)['Feature'].to_list() - top10 = ','.join(top10_columns) - content.append(Graphs.draw_text(f'''{top10}''')) - # 获取特征的近一月值 - feature_data_df = pd.read_csv(f'dataset/指标数据添加时间特征.csv', parse_dates=['ds']).tail(20) - feature_df = feature_data_df[['ds','y']+top10_columns] - # 遍历X每一列,和yy画散点图 , - for i, col in enumerate(feature_df.columns): - print(f'正在绘制第{i+1}个特征{col}与价格散点图...') - if col not in ['ds', 'y']: - fig, ax1 = plt.subplots(figsize=(10, 6)) - # 在第一个坐标轴上绘制数据 - ax1.plot(feature_df['ds'], feature_df['y'], 'b-') - ax1.set_xlabel('日期') - ax1.set_ylabel('y', color='b') - ax1.tick_params('y', colors='b') - # 在 ax1 上添加文本显示值,添加一定的偏移避免值与曲线重叠 - for j in range(1,len(feature_df),2): - value = feature_df['y'].iloc[j] - date = feature_df['ds'].iloc[j] - offset = 1.001 - ax1.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='b', fontsize=10) - # 创建第二个坐标轴 - ax2 = ax1.twinx() - # 在第二个坐标轴上绘制数据 - line2 = ax2.plot(feature_df['ds'], feature_df[col], 'r-') - ax2.set_ylabel(col, color='r') - ax2.tick_params('y', colors='r') - # 在 ax2 上添加文本显示值,添加一定的偏移避免值与曲线重叠 - for j in range(0,len(feature_df),2): - value = feature_df[col].iloc[j] - date = feature_df['ds'].iloc[j] - offset = 1.001 - ax2.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='r', fontsize=10) - # 添加标题 - plt.title(col) - # 设置横坐标为日期格式并自动调整 - locator = mdates.AutoDateLocator() - formatter = mdates.AutoDateFormatter(locator) - ax1.xaxis.set_major_locator(locator) - ax1.xaxis.set_major_formatter(formatter) - # 文件名特殊字符处理 - col = col.replace('*', '-') - col = col.replace(':', '-') - plt.savefig(os.path.join(dataset, f'{col}与价格散点图.png')) - content.append(Graphs.draw_img(os.path.join(dataset, f'{col}与价格散点图.png'))) - plt.close() - content.append(Graphs.draw_text('''相关系数为-1:表示两个变量之间存在完全负向的线性关系,即当一个变量增加时,另一个变量会相应减少,且变化是完全相反的''')) - content.append(Graphs.draw_text('''当前特征中负相关前十的有:''')) - tail10_columns = correlation_df.sort_values(by='Pearson_Correlation',ascending=True).head(10)['Feature'].to_list() - top10 = ','.join(tail10_columns) - content.append(Graphs.draw_text(f'''{top10}''')) - # 获取特征的近一周值 - feature_df = feature_data_df[['ds','y']+tail10_columns] - # 遍历X每一列,和yy画散点图 , - for i, col in enumerate(feature_df.columns): - print(f'正在绘制第{i+1}个特征{col}与价格散点图...') - if col not in ['ds', 'y']: - fig, ax1 = plt.subplots(figsize=(10, 6)) - # 在第一个坐标轴上绘制数据 - ax1.plot(feature_df['ds'], feature_df['y'], 'b-') - ax1.set_xlabel('日期') - ax1.set_ylabel('y', color='b') - ax1.tick_params('y', colors='b') - # 在 ax1 上添加文本显示值,添加一定的偏移避免值与曲线重叠 - for j in range(len(feature_df)): - if j%2 == 1: - value = feature_df['y'].iloc[j] - date = feature_df['ds'].iloc[j] - offset = 1.001 - ax1.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='b', fontsize=10) - # 创建第二个坐标轴 - ax2 = ax1.twinx() - # 在第二个坐标轴上绘制数据 - line2 = ax2.plot(feature_df['ds'], feature_df[col], 'r-') - ax2.set_ylabel(col, color='r') - ax2.tick_params('y', colors='r') - # 在 ax2 上添加文本显示值,添加一定的偏移避免值与曲线重叠 - for j in range(1,len(feature_df),2): - value = feature_df[col].iloc[j] - date = feature_df['ds'].iloc[j] - offset = 1.001 - ax2.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='r', fontsize=10) - # 添加标题 - plt.title(col) - # 设置横坐标为日期格式并自动调整 - locator = mdates.AutoDateLocator() - formatter = mdates.AutoDateFormatter(locator) - ax1.xaxis.set_major_locator(locator) - ax1.xaxis.set_major_formatter(formatter) - # 文件名特殊字符处理 - col = col.replace('*', '-') - col = col.replace(':', '-') - col = col.replace('/', '-') - plt.savefig(os.path.join(dataset, f'{col}与价格散点图.png')) - content.append(Graphs.draw_img(os.path.join(dataset, f'{col}与价格散点图.png'))) - plt.close() content.append(Graphs.draw_text('''相关系数接近0:表示两个变量之间不存在线性关系,即它们的变化不会随着对方的变化而变化。''')) - content.append(Graphs.draw_text(f'指标相关性分析--斯皮尔曼相关系数:')) - # 皮尔逊正相关 不相关 负相关 的表格 - content.append(Graphs.draw_img(os.path.join(dataset,'斯皮尔曼相关性系数.png'))) - content.append(Graphs.draw_text('斯皮尔曼相关系数(Spearmans rank correlation coefficient)是一种用于衡量两个变量之间的单调关系(不一定是线性关系)的统计指标。')) - content.append(Graphs.draw_text('它的计算基于变量的秩次(即变量值的排序位置)而非变量的原始值。')) - content.append(Graphs.draw_text('斯皮尔曼相关系数的取值范围在 -1 到 1 之间。')) - content.append(Graphs.draw_text('当系数为 1 时,表示两个变量之间存在完全正的单调关系;')) - content.append(Graphs.draw_text('''当前特征中正单调关系前十的有:''')) - top10_columns = correlation_df.sort_values(by='Spearman_Correlation',ascending=False).head(10)['Feature'].to_list() - top10 = ','.join(top10_columns) - content.append(Graphs.draw_text(f'''{top10}''')) + for name, group in grouped: + cols = group['指标名称'].tolist() + logger.info(f'开始绘制{name}类指标的相关性直方图') + cols_subset = cols + feature_names = ['y'] + cols_subset + correlation_matrix = df_zhibiaoshuju[feature_names].corr()['y'] - feature_df = feature_data_df[['ds','y']+top10_columns] - # 遍历X每一列,和yy画散点图 , - for i, col in enumerate(feature_df.columns): - print(f'正在绘制第{i+1}个特征{col}与价格散点图...') - if col not in ['ds', 'y']: - fig, ax1 = plt.subplots(figsize=(10, 6)) - # 在第一个坐标轴上绘制数据 - ax1.plot(feature_df['ds'], feature_df['y'], 'b-') - ax1.set_xlabel('日期') - ax1.set_ylabel('y', color='b') - ax1.tick_params('y', colors='b') - # 在 ax1 上添加文本显示值,添加一定的偏移避免值与曲线重叠 - for j in range(1,len(feature_df),2): - value = feature_df['y'].iloc[j] - date = feature_df['ds'].iloc[j] - offset = 1.001 - ax1.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='b', fontsize=10) - # 创建第二个坐标轴 - ax2 = ax1.twinx() - # 在第二个坐标轴上绘制数据 - line2 = ax2.plot(feature_df['ds'], feature_df[col], 'r-') - ax2.set_ylabel(col, color='r') - ax2.tick_params('y', colors='r') - # 在 ax2 上添加文本显示值,添加一定的偏移避免值与曲线重叠 - for j in range(0,len(feature_df),2): - value = feature_df[col].iloc[j] - date = feature_df['ds'].iloc[j] - offset = 1.001 - ax2.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='r', fontsize=10) - # 添加标题 - plt.title(col) - # 设置横坐标为日期格式并自动调整 - locator = mdates.AutoDateLocator() - formatter = mdates.AutoDateFormatter(locator) - ax1.xaxis.set_major_locator(locator) - ax1.xaxis.set_major_formatter(formatter) - # 文件名特殊字符处理 - col = col.replace('*', '-') - col = col.replace(':', '-') - plt.savefig(os.path.join(dataset, f'{col}与价格散点图.png')) - content.append(Graphs.draw_img(os.path.join(dataset, f'{col}与价格散点图.png'))) - plt.close() + # 绘制特征相关性直方分布图 + plt.figure(figsize=(10,8)) + sns.histplot(correlation_matrix.values.flatten(), bins=20, kde=True, color='skyblue') + plt.title(f'{name}类指标(共{len(cols_subset)}个)相关性直方分布图') + plt.xlabel('相关系数') + plt.ylabel('频数') + plt.savefig(os.path.join(dataset, f'{name}类指标相关性直方分布图.png'), bbox_inches='tight') + plt.close() + content.append(Graphs.draw_img(os.path.join(dataset,f'{name}类指标相关性直方分布图.png'))) + content.append(Graphs.draw_text(f'{name}类指标(共{len(cols_subset)}个)的相关性直方分布图如上所示。')) + # 相关性大于0的特征 + positive_corr_features = correlation_matrix[correlation_matrix > 0].sort_values(ascending=False).index.tolist()[1:] + + print(f'{name}下正相关的特征值有:',positive_corr_features) + if len(positive_corr_features) > 5: + positive_corr_features = positive_corr_features[0:5] + content.append(Graphs.draw_text(f'{name}类指标中,与预测目标y正相关前五的特征有:{positive_corr_features}')) + draw_feature_trend(feature_data_df, positive_corr_features) + elif len(positive_corr_features) == 0: + pass + else: + positive_corr_features = positive_corr_features + content.append(Graphs.draw_text(f'其中,与预测目标y正相关的特征有:{positive_corr_features}')) + draw_feature_trend(feature_data_df, positive_corr_features) + + # 相关性小于0的特征 + negative_corr_features = correlation_matrix[correlation_matrix < 0].sort_values(ascending=True).index.tolist() + + print(f'{name}下负相关的特征值有:',negative_corr_features) + if len(negative_corr_features) > 5: + negative_corr_features = negative_corr_features[:5] + content.append(Graphs.draw_text(f'与预测目标y负相关前五的特征有:{negative_corr_features}')) + draw_feature_trend(feature_data_df, negative_corr_features) + elif len(negative_corr_features) == 0: + pass + else: + content.append(Graphs.draw_text(f'{name}类指标中,与预测目标y负相关的特征有:{negative_corr_features}')) + draw_feature_trend(feature_data_df, negative_corr_features) + + + # 计算correlation_sum 第一行的相关性的绝对值的总和 + correlation_sum = correlation_matrix.abs().sum() + logger.info(f'{name}类指标的相关性总和为:{correlation_sum}') + # 分组的相关性总和拼接到grouped_corr + goup_corr = pd.DataFrame({'指标分类': [name], '指标数量': [len(cols_subset)], '相关性总和': [correlation_sum]}) + grouped_corr = pd.concat([grouped_corr, goup_corr], axis=0, ignore_index=True) - content.append(Graphs.draw_text('当系数为 -1 时,表示存在完全负的单调关系;')) - content.append(Graphs.draw_text('''当前特征中负单调关系前十的有:''')) - tail10_columns = correlation_df.sort_values(by='Spearman_Correlation',ascending=True).head(10)['Feature'].to_list() - top10 = ','.join(tail10_columns) - content.append(Graphs.draw_text(f'''{top10}''')) - # 获取特征的近一周值 - feature_df = feature_data_df[['ds','y']+tail10_columns] - # 遍历X每一列,和yy画散点图 , - for i, col in enumerate(feature_df.columns): - print(f'正在绘制第{i+1}个特征{col}与价格散点图...') - if col not in ['ds', 'y']: - fig, ax1 = plt.subplots(figsize=(10, 6)) - # 在第一个坐标轴上绘制数据 - ax1.plot(feature_df['ds'], feature_df['y'], 'b-') - ax1.set_xlabel('日期') - ax1.set_ylabel('y', color='b') - ax1.tick_params('y', colors='b') - # 在 ax1 上添加文本显示值,添加一定的偏移避免值与曲线重叠 - for j in range(len(feature_df)): - if j%2 == 1: - value = feature_df['y'].iloc[j] - date = feature_df['ds'].iloc[j] - offset = 1.001 - ax1.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='b', fontsize=10) - # 创建第二个坐标轴 - ax2 = ax1.twinx() - # 在第二个坐标轴上绘制数据 - line2 = ax2.plot(feature_df['ds'], feature_df[col], 'r-') - ax2.set_ylabel(col, color='r') - ax2.tick_params('y', colors='r') - # 在 ax2 上添加文本显示值,添加一定的偏移避免值与曲线重叠 - for j in range(1,len(feature_df),2): - value = feature_df[col].iloc[j] - date = feature_df['ds'].iloc[j] - offset = 1.001 - ax2.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='r', fontsize=10) - # 添加标题 - plt.title(col) - # 设置横坐标为日期格式并自动调整 - locator = mdates.AutoDateLocator() - formatter = mdates.AutoDateFormatter(locator) - ax1.xaxis.set_major_locator(locator) - ax1.xaxis.set_major_formatter(formatter) - # 文件名特殊字符处理 - col = col.replace('*', '-') - col = col.replace(':', '-') - plt.savefig(os.path.join(dataset, f'{col}与价格散点图.png')) - content.append(Graphs.draw_img(os.path.join(dataset, f'{col}与价格散点图.png'))) - plt.close() - content.append(Graphs.draw_text('当系数为 0 时,表示两个变量之间不存在单调关系。')) - content.append(Graphs.draw_text('与皮尔逊相关系数相比,斯皮尔曼相关系数对于数据中的异常值不敏感,更适用于处理非线性关系或存在极端值的数据。')) + # 绘制相关性总和的气泡图 + logger.info(f'开始绘制相关性总和的气泡图') + plt.figure(figsize=(10, 10)) + sns.scatterplot(data=grouped_corr, x='相关性总和', y='指标数量', size='相关性总和', sizes=(grouped_corr['相关性总和'].min()*5, grouped_corr['相关性总和'].max()*5), hue='指标分类', palette='viridis') + plt.title('指标分类相关性总和的气泡图') + plt.ylabel('数量') + plt.savefig(os.path.join(dataset, '指标分类相关性总和的气泡图.png'), bbox_inches='tight') + plt.close() + content.append(Graphs.draw_img(os.path.join(dataset,'指标分类相关性总和的气泡图.png'))) + logger.info(f'绘制相关性总和的气泡图结束') + + + + # # 计算特征相关性 + # data.rename(columns={y: 'y'}, inplace=True) + # data['ds'] = pd.to_datetime(data['ds']) + # data.drop(columns=['ds'], inplace=True) + # # 创建一个空的 DataFrame 来保存相关系数 + # correlation_df = pd.DataFrame(columns=['Feature', 'Correlation']) + # # 计算各特征与目标列的皮尔逊相关系数,并保存到新的 Data 中 + # for col in data.columns: + # if col!= 'y': + # pearson_correlation = np.corrcoef(data[col], data['y'])[0, 1] + # spearman_correlation, _ = spearmanr(data[col], data['y']) + # new_row = {'Feature': col, 'Pearson_Correlation': round(pearson_correlation,3), 'Spearman_Correlation': round(spearman_correlation,2)} + # correlation_df = correlation_df._append(new_row, ignore_index=True) + + # correlation_df.drop('Correlation', axis=1, inplace=True) + # correlation_df.dropna(inplace=True) + # correlation_df.to_csv(os.path.join(dataset,'指标相关性分析.csv'), index=False) + + # data = correlation_df['Pearson_Correlation'].values.tolist() + # # 生成 -1 到 1 的 20 个区间 + # bins = np.linspace(-1, 1, 21) + # # 计算每个区间的统计数(这里是区间内数据的数量) + # hist_values = [np.sum((data >= bins[i]) & (data < bins[i + 1])) for i in range(len(bins) - 1)] + + # #设置画布大小 + # plt.figure(figsize=(10, 6)) + # # 绘制直方图 + # plt.bar(bins[:-1], hist_values, width=(bins[1] - bins[0])) + + # # 添加标题和坐标轴标签 + # plt.title('皮尔逊相关系数分布图') + # plt.xlabel('区间') + # plt.ylabel('统计数') + # plt.savefig(os.path.join(dataset, '皮尔逊相关性系数.png')) + # plt.close() + + + # #设置画布大小 + # plt.figure(figsize=(10, 6)) + # data = correlation_df['Spearman_Correlation'].values.tolist() + # # 计算每个区间的统计数(这里是区间内数据的数量) + # hist_values = [np.sum((data >= bins[i]) & (data < bins[i + 1])) for i in range(len(bins) - 1)] + + # # 绘制直方图 + # plt.bar(bins[:-1], hist_values, width=(bins[1] - bins[0])) + + # # 添加标题和坐标轴标签 + # plt.title('斯皮尔曼相关系数分布图') + # plt.xlabel('区间') + # plt.ylabel('统计数') + # plt.savefig(os.path.join(dataset, '斯皮尔曼相关性系数.png')) + # plt.close() + # content.append(Graphs.draw_text(f'指标相关性分析--皮尔逊相关系数:')) + # # 皮尔逊正相关 不相关 负相关 的表格 + # content.append(Graphs.draw_img(os.path.join(dataset,'皮尔逊相关性系数.png'))) + # content.append(Graphs.draw_text('''皮尔逊相关系数说明:''')) + # content.append(Graphs.draw_text('''衡量两个特征之间的线性相关性。''')) + # content.append(Graphs.draw_text(''' + # 相关系数为1:表示两个变量之间存在完全正向的线性关系,即当一个变量增加时,另一个变量也相应增加,且变化是完全一致的。''')) + # content.append(Graphs.draw_text('''当前特征中正相关前十的有:''')) + # top10_columns = correlation_df.sort_values(by='Pearson_Correlation',ascending=False).head(10)['Feature'].to_list() + # top10 = ','.join(top10_columns) + # content.append(Graphs.draw_text(f'''{top10}''')) + + # feature_df = feature_data_df[['ds','y']+top10_columns] + # # 遍历X每一列,和yy画散点图 , + # for i, col in enumerate(feature_df.columns): + # print(f'正在绘制第{i+1}个特征{col}与价格散点图...') + # if col not in ['ds', 'y']: + # fig, ax1 = plt.subplots(figsize=(10, 6)) + # # 在第一个坐标轴上绘制数据 + # ax1.plot(feature_df['ds'], feature_df['y'], 'b-') + # ax1.set_xlabel('日期') + # ax1.set_ylabel('y', color='b') + # ax1.tick_params('y', colors='b') + # # 在 ax1 上添加文本显示值,添加一定的偏移避免值与曲线重叠 + # for j in range(1,len(feature_df),2): + # value = feature_df['y'].iloc[j] + # date = feature_df['ds'].iloc[j] + # offset = 1.001 + # ax1.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='b', fontsize=10) + # # 创建第二个坐标轴 + # ax2 = ax1.twinx() + # # 在第二个坐标轴上绘制数据 + # line2 = ax2.plot(feature_df['ds'], feature_df[col], 'r-') + # ax2.set_ylabel(col, color='r') + # ax2.tick_params('y', colors='r') + # # 在 ax2 上添加文本显示值,添加一定的偏移避免值与曲线重叠 + # for j in range(0,len(feature_df),2): + # value = feature_df[col].iloc[j] + # date = feature_df['ds'].iloc[j] + # offset = 1.001 + # ax2.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='r', fontsize=10) + # # 添加标题 + # plt.title(col) + # # 设置横坐标为日期格式并自动调整 + # locator = mdates.AutoDateLocator() + # formatter = mdates.AutoDateFormatter(locator) + # ax1.xaxis.set_major_locator(locator) + # ax1.xaxis.set_major_formatter(formatter) + # # 文件名特殊字符处理 + # col = col.replace('*', '-') + # col = col.replace(':', '-') + # plt.savefig(os.path.join(dataset, f'{col}与价格散点图.png')) + # content.append(Graphs.draw_img(os.path.join(dataset, f'{col}与价格散点图.png'))) + # plt.close() + + + # content.append(Graphs.draw_text(f'指标相关性分析--斯皮尔曼相关系数:')) + # # 皮尔逊正相关 不相关 负相关 的表格 + # content.append(Graphs.draw_img(os.path.join(dataset,'斯皮尔曼相关性系数.png'))) + # content.append(Graphs.draw_text('斯皮尔曼相关系数(Spearmans rank correlation coefficient)是一种用于衡量两个变量之间的单调关系(不一定是线性关系)的统计指标。')) + # content.append(Graphs.draw_text('它的计算基于变量的秩次(即变量值的排序位置)而非变量的原始值。')) + # content.append(Graphs.draw_text('斯皮尔曼相关系数的取值范围在 -1 到 1 之间。')) + # content.append(Graphs.draw_text('当系数为 1 时,表示两个变量之间存在完全正的单调关系;')) + # content.append(Graphs.draw_text('''当前特征中正单调关系前十的有:''')) + # top10_columns = correlation_df.sort_values(by='Spearman_Correlation',ascending=False).head(10)['Feature'].to_list() + # top10 = ','.join(top10_columns) + # content.append(Graphs.draw_text(f'''{top10}''')) + + # feature_df = feature_data_df[['ds','y']+top10_columns] + # # 遍历X每一列,和yy画散点图 , + # for i, col in enumerate(feature_df.columns): + # print(f'正在绘制第{i+1}个特征{col}与价格散点图...') + # if col not in ['ds', 'y']: + # fig, ax1 = plt.subplots(figsize=(10, 6)) + # # 在第一个坐标轴上绘制数据 + # ax1.plot(feature_df['ds'], feature_df['y'], 'b-') + # ax1.set_xlabel('日期') + # ax1.set_ylabel('y', color='b') + # ax1.tick_params('y', colors='b') + # # 在 ax1 上添加文本显示值,添加一定的偏移避免值与曲线重叠 + # for j in range(1,len(feature_df),2): + # value = feature_df['y'].iloc[j] + # date = feature_df['ds'].iloc[j] + # offset = 1.001 + # ax1.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='b', fontsize=10) + # # 创建第二个坐标轴 + # ax2 = ax1.twinx() + # # 在第二个坐标轴上绘制数据 + # line2 = ax2.plot(feature_df['ds'], feature_df[col], 'r-') + # ax2.set_ylabel(col, color='r') + # ax2.tick_params('y', colors='r') + # # 在 ax2 上添加文本显示值,添加一定的偏移避免值与曲线重叠 + # for j in range(0,len(feature_df),2): + # value = feature_df[col].iloc[j] + # date = feature_df['ds'].iloc[j] + # offset = 1.001 + # ax2.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='r', fontsize=10) + # # 添加标题 + # plt.title(col) + # # 设置横坐标为日期格式并自动调整 + # locator = mdates.AutoDateLocator() + # formatter = mdates.AutoDateFormatter(locator) + # ax1.xaxis.set_major_locator(locator) + # ax1.xaxis.set_major_formatter(formatter) + # # 文件名特殊字符处理 + # col = col.replace('*', '-') + # col = col.replace(':', '-') + # plt.savefig(os.path.join(dataset, f'{col}与价格散点图.png')) + # content.append(Graphs.draw_img(os.path.join(dataset, f'{col}与价格散点图.png'))) + # plt.close() + + # content.append(Graphs.draw_text('当系数为 -1 时,表示存在完全负的单调关系;')) + # content.append(Graphs.draw_text('''当前特征中负单调关系前十的有:''')) + # tail10_columns = correlation_df.sort_values(by='Spearman_Correlation',ascending=True).head(10)['Feature'].to_list() + # top10 = ','.join(tail10_columns) + # content.append(Graphs.draw_text(f'''{top10}''')) + # # 获取特征的近一周值 + # feature_df = feature_data_df[['ds','y']+tail10_columns] + # # 遍历X每一列,和yy画散点图 , + # for i, col in enumerate(feature_df.columns): + # print(f'正在绘制第{i+1}个特征{col}与价格散点图...') + # if col not in ['ds', 'y']: + # fig, ax1 = plt.subplots(figsize=(10, 6)) + # # 在第一个坐标轴上绘制数据 + # ax1.plot(feature_df['ds'], feature_df['y'], 'b-') + # ax1.set_xlabel('日期') + # ax1.set_ylabel('y', color='b') + # ax1.tick_params('y', colors='b') + # # 在 ax1 上添加文本显示值,添加一定的偏移避免值与曲线重叠 + # for j in range(len(feature_df)): + # if j%2 == 1: + # value = feature_df['y'].iloc[j] + # date = feature_df['ds'].iloc[j] + # offset = 1.001 + # ax1.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='b', fontsize=10) + # # 创建第二个坐标轴 + # ax2 = ax1.twinx() + # # 在第二个坐标轴上绘制数据 + # line2 = ax2.plot(feature_df['ds'], feature_df[col], 'r-') + # ax2.set_ylabel(col, color='r') + # ax2.tick_params('y', colors='r') + # # 在 ax2 上添加文本显示值,添加一定的偏移避免值与曲线重叠 + # for j in range(1,len(feature_df),2): + # value = feature_df[col].iloc[j] + # date = feature_df['ds'].iloc[j] + # offset = 1.001 + # ax2.text(date, value * offset, str(round(value, 2)), ha='center', va='bottom', color='r', fontsize=10) + # # 添加标题 + # plt.title(col) + # # 设置横坐标为日期格式并自动调整 + # locator = mdates.AutoDateLocator() + # formatter = mdates.AutoDateFormatter(locator) + # ax1.xaxis.set_major_locator(locator) + # ax1.xaxis.set_major_formatter(formatter) + # # 文件名特殊字符处理 + # col = col.replace('*', '-') + # col = col.replace(':', '-') + # plt.savefig(os.path.join(dataset, f'{col}与价格散点图.png')) + # content.append(Graphs.draw_img(os.path.join(dataset, f'{col}与价格散点图.png'))) + # plt.close() + # content.append(Graphs.draw_text('当系数为 0 时,表示两个变量之间不存在单调关系。')) + # content.append(Graphs.draw_text('与皮尔逊相关系数相比,斯皮尔曼相关系数对于数据中的异常值不敏感,更适用于处理非线性关系或存在极端值的数据。')) content.append(Graphs.draw_little_title('模型选择:')) content.append(Graphs.draw_text(f'预测使用了{num_models}个模型进行训练拟合,通过评估指标MAE从小到大排列,前5个模型的简介如下:')) @@ -934,6 +990,8 @@ def brent_export_pdf(num_indicators=475,num_models=21, num_dayindicator=202,inpu except TimeoutError as e: print(f"请求超时: {e}") + + def pp_export_pdf(num_indicators=475,num_models=21, num_dayindicator=202,inputsize=5,dataset='dataset',time = '2024-07-30',reportname='report.pdf'): global y # 创建内容对应的空列表