<jupyter_start><jupyter_text>read estimator result<jupyter_code>pred_df = pd.read_pickle(estimator_dir.joinpath('pred.pkl'))
report_normal_df = pd.read_pickle(estimator_dir.joinpath('report_normal.pkl'))
report_normal_df.index.names = ['index']

analysis_df = pd.read_pickle(estimator_dir.joinpath('analysis.pkl'))
positions = pickle.load(estimator_dir.joinpath('positions.pkl').open('rb'))<jupyter_output><empty_output><jupyter_text>analyze graphs<jupyter_code>from qlib.data import D
from qlib.contrib.report import analysis_model, analysis_position
pred_df_dates = pred_df.index.get_level_values(level='datetime')<jupyter_output><empty_output><jupyter_text>analysis position<jupyter_code>stock_ret = D.features(D.instruments(MARKET), ['Ref($close, -1)/$close - 1'], pred_df_dates.min(), pred_df_dates.max())
stock_ret.columns = ['label']<jupyter_output><empty_output><jupyter_text>report<jupyter_code>analysis_position.report_graph(report_normal_df)<jupyter_output><empty_output><jupyter_text>risk analysis<jupyter_code>analysis_position.risk_analysis_graph(analysis_df, report_normal_df)<jupyter_output><empty_output><jupyter_text>analysis model<jupyter_code>label_df = D.features(D.instruments(MARKET), ['Ref($close, -2)/Ref($close, -1) - 1'], pred_df_dates.min(), pred_df_dates.max())
label_df.columns = ['label']<jupyter_output><empty_output><jupyter_text>score IC<jupyter_code>pred_label = pd.concat([label_df, pred_df], axis=1, sort=True).reindex(label_df.index)
analysis_position.score_ic_graph(pred_label)<jupyter_output><empty_output><jupyter_text>model performance<jupyter_code>analysis_model.model_performance_graph(pred_label)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13764213046080193, 'fraction_numerical': 0.003590664272890485, 'mean_word_length': 14.339449541284404, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '209346', 'license': 'MIT', 'n_tokens_mistral': 631, 'n_tokens_neox': 616, 'n_words': 51, 'path': 'examples/estimator/analyze_from_estimator.ipynb', 'repo_name': 'vanshg/qlib', 'size': '1671'}