MCPcopy Create free account

hub / github.com/AlphaFin-proj/AlphaFin / functions

Functions63 in github.com/AlphaFin-proj/AlphaFin

↓ 8 callersFunctionget_pivot_data
指定一个字段名,然后将数据变成index是日期,columns是该字段下的变量 输入df和需要按日期分行列名, 输出pivot后的df
src/stage1_trend_prediction/utils.py:398
↓ 6 callersFunctionget_data_by_sql
输入表名和股票篮子数组, 输出从数据库中读取的数据
src/stage1_trend_prediction/utils.py:380
↓ 3 callersFunctionget_adj_data
(code, freq='daily', start_date=None, end_date=None)
src/stage1_trend_prediction/utils.py:421
↓ 2 callersFunctionSMA
:param series_1: 一个pd.Series :param N:窗口长度,求均值时被当作分母 :param M:对新值分配的权重 :return:一个数组
src/stage1_trend_prediction/utils.py:721
↓ 2 callersMethodconcat_docs
(self, docs)
src/stage2_financial_qa/webui/run.py:93
↓ 2 callersFunctionget_指标
(rr, port)
src/stage1_trend_prediction/test_strategy.py:25
↓ 1 callersFunctionBARSLAST
(series_1)
src/stage1_trend_prediction/test_strategy.py:27
↓ 1 callersFunctionChatGLMPrompt
(instruction, inputs)
src/stage1_trend_prediction/stockgpt_inf.py:53
↓ 1 callersMethodadd_texts
( self, keys, values, metadatas=None, ids=None, **kwargs,
src/stage2_financial_qa/webui/run.py:34
↓ 1 callersFunctionaddfield
(dd, code)
src/stage1_trend_prediction/utils.py:704
↓ 1 callersFunctionchangeKey
(d, old_k, new_k)
src/stage1_trend_prediction/dataprocess_stockgpt.py:98
↓ 1 callersMethodcheckDate
(self, query)
src/stage2_financial_qa/webui/run.py:73
↓ 1 callersFunctionfactors1
(code)
src/stage1_trend_prediction/utils.py:749
↓ 1 callersFunctionfactors2
(folder, code)
src/stage1_trend_prediction/utils.py:790
↓ 1 callersFunctionfactors3
(code)
src/stage1_trend_prediction/utils.py:818
↓ 1 callersFunctionfactors4
(folder, code)
src/stage1_trend_prediction/utils.py:852
↓ 1 callersMethodfrom_texts
( cls, keys, values, embedding, metadatas=None,
src/stage2_financial_qa/webui/run.py:15
↓ 1 callersFunctiongetGtUpDown
从标准答案中提取涨跌结果 Args: gt: str Returns: up_down: "涨"/"跌",若无法提取出答案,返回 None
src/stage1_trend_prediction/dataprocess_stockgpt.py:5
↓ 1 callersFunctiongetModel
(base_model_path, lora_ckpt_path, embedding_model_path, faiss_config,
src/stage2_financial_qa/webui/run.py:122
↓ 1 callersFunctiongetPredUpDownStrict
从模型预测结果中提取涨跌结果(严格) Args: pred: str Returns: up_down: -1/0/1, -1表示跌,1表示涨,0表示无法提取出结果
src/stage1_trend_prediction/dataprocess_stockgpt.py:22
↓ 1 callersFunctionget_ST_dates
(df_calendar, dd_nameschange, code)
src/stage1_trend_prediction/utils.py:222
↓ 1 callersFunctionget_codes_by_date
给定交易日,根据上市退市时间,停复牌时间,ST股票时间,行业代码成分股时间,给出可选的股票篮子 the_date:'20201008' indus_code = '850531.SI' 或 None delete_ST = True 或 False
src/stage1_trend_prediction/utils.py:186
↓ 1 callersFunctionget_namechange
(file_path, dd_stocks)
src/stage1_trend_prediction/utils.py:261
↓ 1 callersMethodget_prompt
(self, doc, query)
src/stage2_financial_qa/webui/run.py:85
↓ 1 callersFunctionget_sw_members
(file_path)
src/stage1_trend_prediction/utils.py:329
↓ 1 callersFunctionget_停复牌
(file_path)
src/stage1_trend_prediction/utils.py:288
↓ 1 callersFunctionmain
()
src/stage1_trend_prediction/stockgpt_inf.py:88
↓ 1 callersFunctionparse_args
()
src/stage1_trend_prediction/stockgpt_inf.py:22
↓ 1 callersMethodprocess
process the request data
src/stage2_financial_qa/webui/run.py:101
↓ 1 callersFunctionprompt_eval
(args, model, tokenizer, data)
src/stage1_trend_prediction/stockgpt_inf.py:56
↓ 1 callersFunction获取指数
(df_ports)
src/stage1_trend_prediction/test_strategy.py:54
FunctionBARSLAST
处理一个bool序列 计算当前与上一次为True的距离
src/stage1_trend_prediction/utils.py:109
Method__init__
(self, embedding_model_path, faiss_config)
src/stage2_financial_qa/webui/run.py:47
Methodadd_qa_pairs
(self, qa_dict, database="news")
src/stage2_financial_qa/webui/run.py:61
Functioncalculate_accuracy
(df)
src/stage1_trend_prediction/test_strategy.py:82
Functioncombine_3_fin_data
(利润表, 现金流量表, 资产负债表)
src/stage1_trend_prediction/utils.py:523
Functionde_extreme
中位数去极值 进来的和出去的df都必须是纯数值,因此时间或日期列必须弃掉,用索引装载
src/stage1_trend_prediction/utils.py:939
Functionfunc_KDJ
(df)
src/stage1_trend_prediction/utils.py:70
Functionfunc_MACD
(df)
src/stage1_trend_prediction/utils.py:87
FunctiongetPredUpDownLoose
从模型预测结果中提取涨跌结果(宽松) Args: pred: str Returns: up_down: -1/0/1, -1表示跌,1表示涨,0表示无法提取出结果
src/stage1_trend_prediction/dataprocess_stockgpt.py:50
Functionget_agency_data
(ts_code)
src/stage1_trend_prediction/utils.py:691
Functionget_all_factors
(folder, code, start_date, end_date)
src/stage1_trend_prediction/utils.py:910
Functionget_calendar
(freq, start_date, end_date)
src/stage1_trend_prediction/utils.py:94
Functionget_close_data
(file_path, tp, code, start_date, end_date)
src/stage1_trend_prediction/utils.py:29
Functionget_codes
获取最新的指数成分股
src/stage1_trend_prediction/utils.py:359
Functionget_data
(code)
src/stage1_trend_prediction/utils.py:624
Functionget_fin_data
(end_date, report_type)
src/stage1_trend_prediction/utils.py:590
Functionget_holder_data
(ts_code)
src/stage1_trend_prediction/utils.py:672
Functionget_index_close
获取指数收盘价
src/stage1_trend_prediction/utils.py:370
Functionget_ret_stats
(df)
src/stage1_trend_prediction/utils.py:17
Functionget_stocks
()
src/stage1_trend_prediction/utils.py:117
Functionget_tradeable_stocks
(start_date, end_date, indus_code, delete_ST)
src/stage1_trend_prediction/utils.py:133
Functionhalflife_weighting
输入df和指定半衰期,对一个df或series计算指数加权均值
src/stage1_trend_prediction/utils.py:410
Functionmain
(base_model_path="", lora_ckpt_path="", embedding_model_path="")
src/stage2_financial_qa/webui/run.py:150
Functionmain
(stockgpt_pred_path, mldl_pred_path, save_path)
src/stage1_trend_prediction/dataprocess_stockgpt.py:102
Functionmain
(tushare_token, stockgpt_mldl_path, save_dir, file_name)
src/stage1_trend_prediction/test_strategy.py:91
Functionrespond
(message, chat_history, topk_slider, database_radio, method_radio)
src/stage2_financial_qa/webui/run.py:176
Functionupdate_dailyadj_data
(table_name, cal_dates, engine)
src/stage1_trend_prediction/utils.py:470
Functionupdate_dailybasic_data
(table_name, cal_dates, engine)
src/stage1_trend_prediction/utils.py:442
Functionupdate_dailykline_data
(table_name, cal_dates, engine)
src/stage1_trend_prediction/utils.py:456
Functionupdate_financial_data
(table_name, end_dates, engine)
src/stage1_trend_prediction/utils.py:484
Functionupdate_hkhold_data
(table_name, cal_dates, engine)
src/stage1_trend_prediction/utils.py:561
Functionupdate_moneyflow_data
(table_name, cal_dates, engine)
src/stage1_trend_prediction/utils.py:576