| 58 | |
| 59 | class OptimizationConfig: |
| 60 | def __init__(self, config, TUNER_CONFIG_MANAGER): |
| 61 | self.report_type = config.get("report_type", "pred_long") |
| 62 | if self.report_type not in [ |
| 63 | "pred_long", |
| 64 | "pred_long_short", |
| 65 | "pred_short", |
| 66 | "excess_return_without_cost", |
| 67 | "excess_return_with_cost", |
| 68 | "model", |
| 69 | ]: |
| 70 | raise ValueError( |
| 71 | "report_type should be one of pred_long, pred_long_short, pred_short, excess_return_without_cost, excess_return_with_cost and model" |
| 72 | ) |
| 73 | |
| 74 | self.report_factor = config.get("report_factor", "information_ratio") |
| 75 | if self.report_factor not in [ |
| 76 | "annualized_return", |
| 77 | "information_ratio", |
| 78 | "max_drawdown", |
| 79 | "mean", |
| 80 | "std", |
| 81 | "model_score", |
| 82 | "model_pearsonr", |
| 83 | ]: |
| 84 | raise ValueError( |
| 85 | "report_factor should be one of annualized_return, information_ratio, max_drawdown, mean, std, model_pearsonr and model_score" |
| 86 | ) |
| 87 | |
| 88 | self.optim_type = config.get("optim_type", "max") |
| 89 | if self.optim_type not in ["min", "max", "correlation"]: |
| 90 | raise ValueError("optim_type should be min, max or correlation") |