++
This commit is contained in:
@@ -75,6 +75,11 @@ def expand_dict_columns(data: pd.DataFrame) -> pd.DataFrame:
|
||||
pandas.DataFrame: A new DataFrame with expanded columns.
|
||||
"""
|
||||
dict_columns = list(filter(lambda x: isinstance(data[x].iloc[0], dict), data.columns))
|
||||
|
||||
if not dict_columns:
|
||||
# 没有字典列,直接返回原数据
|
||||
return data
|
||||
|
||||
new_columns = pd.concat(
|
||||
[data[col].apply(pd.Series).rename(columns=lambda x: f"{col}_{x}") for col in dict_columns],
|
||||
axis=1,
|
||||
|
||||
@@ -0,0 +1,274 @@
|
||||
{
|
||||
"regression_neut(divide(<data_field/>, sqrt(<data_field/>)), log(cap))": {
|
||||
"template_explanation": "A direct variation of the seed alpha that transforms a generic investment\u2011quality metric using a square\u2011root compression and then removes any linear size effect via regression neutralization against log market cap. This isolates the residual quality signal that is orthogonal to firm size.",
|
||||
"seed_alpha_settings": {
|
||||
"instrumentType": "EQUITY",
|
||||
"region": "IND",
|
||||
"universe": "TOP500",
|
||||
"delay": 1,
|
||||
"decay": 6,
|
||||
"neutralization": "NONE",
|
||||
"truncation": 0.02,
|
||||
"pasteurization": "ON",
|
||||
"unitHandling": "VERIFY",
|
||||
"nanHandling": "ON",
|
||||
"maxTrade": "ON",
|
||||
"maxPosition": "OFF",
|
||||
"language": "FASTEXPR",
|
||||
"visualization": false,
|
||||
"startDate": "2014-01-01",
|
||||
"endDate": "2023-12-31"
|
||||
},
|
||||
"placeholder_candidates": {
|
||||
"<data_field/>": {
|
||||
"type": "data_field",
|
||||
"candidates": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"group_neutralize(ts_rank(<data_field/>, <integer_parameter/>), bucket(rank(cap), range=\"0,1,0.1\"))": {
|
||||
"template_explanation": "Constructs a time\u2011series rank of a fundamental metric over a short window, then removes the systematic size bias by neutralising against market\u2011cap buckets. The result is a size\u2011adjusted relative strength signal that can be compared across the universe.",
|
||||
"seed_alpha_settings": {
|
||||
"instrumentType": "EQUITY",
|
||||
"region": "IND",
|
||||
"universe": "TOP500",
|
||||
"delay": 1,
|
||||
"decay": 6,
|
||||
"neutralization": "NONE",
|
||||
"truncation": 0.02,
|
||||
"pasteurization": "ON",
|
||||
"unitHandling": "VERIFY",
|
||||
"nanHandling": "ON",
|
||||
"maxTrade": "ON",
|
||||
"maxPosition": "OFF",
|
||||
"language": "FASTEXPR",
|
||||
"visualization": false,
|
||||
"startDate": "2014-01-01",
|
||||
"endDate": "2023-12-31"
|
||||
},
|
||||
"placeholder_candidates": {
|
||||
"<data_field/>": {
|
||||
"type": "data_field",
|
||||
"candidates": []
|
||||
},
|
||||
"<integer_parameter/>": {
|
||||
"type": "integer_parameter",
|
||||
"candidates": [
|
||||
{
|
||||
"value": 5
|
||||
},
|
||||
{
|
||||
"value": 10
|
||||
},
|
||||
{
|
||||
"value": 20
|
||||
},
|
||||
{
|
||||
"value": 60
|
||||
},
|
||||
{
|
||||
"value": 120
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"regression_neut(signed_power(ts_zscore(<data_field/>, <integer_parameter/>), <float_parameter/>), log(cap))": {
|
||||
"template_explanation": "Standardises the investment metric with a rolling Z\u2011score, applies a signed power transformation to capture non\u2011linear relationships, and finally neutralises the effect of log market cap. This approach enhances sensitivity to extreme values while controlling for size.",
|
||||
"seed_alpha_settings": {
|
||||
"instrumentType": "EQUITY",
|
||||
"region": "IND",
|
||||
"universe": "TOP500",
|
||||
"delay": 1,
|
||||
"decay": 6,
|
||||
"neutralization": "NONE",
|
||||
"truncation": 0.02,
|
||||
"pasteurization": "ON",
|
||||
"unitHandling": "VERIFY",
|
||||
"nanHandling": "ON",
|
||||
"maxTrade": "ON",
|
||||
"maxPosition": "OFF",
|
||||
"language": "FASTEXPR",
|
||||
"visualization": false,
|
||||
"startDate": "2014-01-01",
|
||||
"endDate": "2023-12-31"
|
||||
},
|
||||
"placeholder_candidates": {
|
||||
"<data_field/>": {
|
||||
"type": "data_field",
|
||||
"candidates": []
|
||||
},
|
||||
"<integer_parameter/>": {
|
||||
"type": "integer_parameter",
|
||||
"candidates": [
|
||||
{
|
||||
"value": 5
|
||||
},
|
||||
{
|
||||
"value": 20
|
||||
},
|
||||
{
|
||||
"value": 60
|
||||
},
|
||||
{
|
||||
"value": 120
|
||||
},
|
||||
{
|
||||
"value": 252
|
||||
}
|
||||
]
|
||||
},
|
||||
"<float_parameter/>": {
|
||||
"type": "float_parameter",
|
||||
"candidates": [
|
||||
{
|
||||
"value": 0.25
|
||||
},
|
||||
{
|
||||
"value": 0.5
|
||||
},
|
||||
{
|
||||
"value": 1.0
|
||||
},
|
||||
{
|
||||
"value": 2.0
|
||||
},
|
||||
{
|
||||
"value": 3.0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"ts_zscore(ts_delta(<data_field/>, <integer_parameter/>), <integer_parameter/>) - regression_neut(<data_field/>, log(cap))": {
|
||||
"template_explanation": "Combines the short\u2011term change of a metric (captured by its rolling delta and Z\u2011score) with the size\u2011neutralised level of the metric. The difference isolates momentum in the metric that is not explained by firm size.",
|
||||
"seed_alpha_settings": {
|
||||
"instrumentType": "EQUITY",
|
||||
"region": "IND",
|
||||
"universe": "TOP500",
|
||||
"delay": 1,
|
||||
"decay": 6,
|
||||
"neutralization": "NONE",
|
||||
"truncation": 0.02,
|
||||
"pasteurization": "ON",
|
||||
"unitHandling": "VERIFY",
|
||||
"nanHandling": "ON",
|
||||
"maxTrade": "ON",
|
||||
"maxPosition": "OFF",
|
||||
"language": "FASTEXPR",
|
||||
"visualization": false,
|
||||
"startDate": "2014-01-01",
|
||||
"endDate": "2023-12-31"
|
||||
},
|
||||
"placeholder_candidates": {
|
||||
"<data_field/>": {
|
||||
"type": "data_field",
|
||||
"candidates": [
|
||||
{
|
||||
"id": "anl39_atanbvps",
|
||||
"description": "Book value (tangible) per share - most recent fiscal year"
|
||||
},
|
||||
{
|
||||
"id": "anl39_qtanbvps",
|
||||
"description": "Book value (tangible) per share - most recent quarter"
|
||||
},
|
||||
{
|
||||
"id": "anl39_spvba",
|
||||
"description": "Book value (Common Equity) per share - most recent fiscal year"
|
||||
},
|
||||
{
|
||||
"id": "anl39_spvbq",
|
||||
"description": "Book value (Common Equity) per share - most recent quarter"
|
||||
},
|
||||
{
|
||||
"id": "anl4_bvps_high",
|
||||
"description": "Book value - the highest estimation, per share"
|
||||
},
|
||||
{
|
||||
"id": "anl4_bvps_low",
|
||||
"description": "Book value - the lowest estimation, per share"
|
||||
},
|
||||
{
|
||||
"id": "anl4_bvps_median",
|
||||
"description": "Book value per share - Median value among forecasts"
|
||||
},
|
||||
{
|
||||
"id": "anl4_bvps_number",
|
||||
"description": "Book value per share - number of estimations"
|
||||
},
|
||||
{
|
||||
"id": "est_bookvalue_ps",
|
||||
"description": "Book value per share - average of estimations"
|
||||
}
|
||||
]
|
||||
},
|
||||
"<integer_parameter/>": {
|
||||
"type": "integer_parameter",
|
||||
"candidates": [
|
||||
{
|
||||
"value": 5
|
||||
},
|
||||
{
|
||||
"value": 10
|
||||
},
|
||||
{
|
||||
"value": 20
|
||||
},
|
||||
{
|
||||
"value": 60
|
||||
},
|
||||
{
|
||||
"value": 120
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"group_rank(ts_rank(<data_field/>, <integer_parameter/>), industry)": {
|
||||
"template_explanation": "First ranks the metric temporally within each stock, then applies a cross\u2011sectional industry ranking. This double\u2011ranking approach extracts the industry\u2011relative performance trend while abstracting from absolute magnitude.",
|
||||
"seed_alpha_settings": {
|
||||
"instrumentType": "EQUITY",
|
||||
"region": "IND",
|
||||
"universe": "TOP500",
|
||||
"delay": 1,
|
||||
"decay": 6,
|
||||
"neutralization": "NONE",
|
||||
"truncation": 0.02,
|
||||
"pasteurization": "ON",
|
||||
"unitHandling": "VERIFY",
|
||||
"nanHandling": "ON",
|
||||
"maxTrade": "ON",
|
||||
"maxPosition": "OFF",
|
||||
"language": "FASTEXPR",
|
||||
"visualization": false,
|
||||
"startDate": "2014-01-01",
|
||||
"endDate": "2023-12-31"
|
||||
},
|
||||
"placeholder_candidates": {
|
||||
"<data_field/>": {
|
||||
"type": "data_field",
|
||||
"candidates": []
|
||||
},
|
||||
"<integer_parameter/>": {
|
||||
"type": "integer_parameter",
|
||||
"candidates": [
|
||||
{
|
||||
"value": 10
|
||||
},
|
||||
{
|
||||
"value": 20
|
||||
},
|
||||
{
|
||||
"value": 60
|
||||
},
|
||||
{
|
||||
"value": 120
|
||||
},
|
||||
{
|
||||
"value": 252
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1,47 @@
|
||||
[
|
||||
"ts_zscore(ts_delta(est_bookvalue_ps, 10), 10) - regression_neut(est_bookvalue_ps, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_number, 120), 120) - regression_neut(anl4_bvps_number, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_low, 60), 60) - regression_neut(anl4_bvps_low, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_spvba, 20), 20) - regression_neut(anl39_spvba, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_spvbq, 20), 20) - regression_neut(anl39_spvbq, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_atanbvps, 120), 120) - regression_neut(anl39_atanbvps, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_spvbq, 120), 120) - regression_neut(anl39_spvbq, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_atanbvps, 10), 10) - regression_neut(anl39_atanbvps, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_spvba, 5), 5) - regression_neut(anl39_spvba, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_high, 120), 120) - regression_neut(anl4_bvps_high, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_qtanbvps, 20), 20) - regression_neut(anl39_qtanbvps, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_median, 5), 5) - regression_neut(anl4_bvps_median, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_atanbvps, 20), 20) - regression_neut(anl39_atanbvps, log(cap))",
|
||||
"ts_zscore(ts_delta(est_bookvalue_ps, 5), 5) - regression_neut(est_bookvalue_ps, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_qtanbvps, 120), 120) - regression_neut(anl39_qtanbvps, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_high, 5), 5) - regression_neut(anl4_bvps_high, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_high, 20), 20) - regression_neut(anl4_bvps_high, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_atanbvps, 5), 5) - regression_neut(anl39_atanbvps, log(cap))",
|
||||
"ts_zscore(ts_delta(est_bookvalue_ps, 20), 20) - regression_neut(est_bookvalue_ps, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_median, 20), 20) - regression_neut(anl4_bvps_median, log(cap))",
|
||||
"ts_zscore(ts_delta(est_bookvalue_ps, 60), 60) - regression_neut(est_bookvalue_ps, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_spvbq, 60), 60) - regression_neut(anl39_spvbq, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_spvba, 10), 10) - regression_neut(anl39_spvba, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_spvba, 60), 60) - regression_neut(anl39_spvba, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_spvbq, 10), 10) - regression_neut(anl39_spvbq, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_high, 60), 60) - regression_neut(anl4_bvps_high, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_spvba, 120), 120) - regression_neut(anl39_spvba, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_low, 120), 120) - regression_neut(anl4_bvps_low, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_median, 60), 60) - regression_neut(anl4_bvps_median, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_atanbvps, 60), 60) - regression_neut(anl39_atanbvps, log(cap))",
|
||||
"ts_zscore(ts_delta(est_bookvalue_ps, 120), 120) - regression_neut(est_bookvalue_ps, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_qtanbvps, 60), 60) - regression_neut(anl39_qtanbvps, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_number, 60), 60) - regression_neut(anl4_bvps_number, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_low, 10), 10) - regression_neut(anl4_bvps_low, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_low, 5), 5) - regression_neut(anl4_bvps_low, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_median, 120), 120) - regression_neut(anl4_bvps_median, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_number, 10), 10) - regression_neut(anl4_bvps_number, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_number, 5), 5) - regression_neut(anl4_bvps_number, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_low, 20), 20) - regression_neut(anl4_bvps_low, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_number, 20), 20) - regression_neut(anl4_bvps_number, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_spvbq, 5), 5) - regression_neut(anl39_spvbq, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_median, 10), 10) - regression_neut(anl4_bvps_median, log(cap))",
|
||||
"ts_zscore(ts_delta(anl4_bvps_high, 10), 10) - regression_neut(anl4_bvps_high, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_qtanbvps, 5), 5) - regression_neut(anl39_qtanbvps, log(cap))",
|
||||
"ts_zscore(ts_delta(anl39_qtanbvps, 10), 10) - regression_neut(anl39_qtanbvps, log(cap))"
|
||||
]
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"LLM_model_name": "MiniMax-M2.7",
|
||||
"LLM_model_name": "MiniMax-M2.7-highspeed",
|
||||
"LLM_API_KEY": "sk-cp-l_as8mjqPhsOIny9IFKZ8jzA92z1c0eRwchldhEf4KzQjs9cjVknV2o7VNCcvYUXsXFq7uF4aSgp2RxxmUHLXwPGKgIvzedM70_XUIXiBB3gu_UmLDQLfh4",
|
||||
"llm_base_url": "https://api.minimaxi.com/v1",
|
||||
"username": "jack0210_@hotmail.com",
|
||||
|
||||
Reference in New Issue
Block a user