Kronos: A Foundation Model for the Language of Financial Markets
207 matches across 8 categories. Click a row to expand file-level details.
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | finetune/config.py | 9 | # ================================================================= |
| MEDIUM | finetune/config.py | 11 | # ================================================================= |
| MEDIUM | finetune/config.py | 30 | # ================================================================= |
| MEDIUM | finetune/config.py | 32 | # ================================================================= |
| MEDIUM | finetune/config.py | 43 | # ================================================================= |
| MEDIUM | finetune/config.py | 45 | # ================================================================= |
| MEDIUM | finetune/config.py | 72 | # ================================================================= |
| MEDIUM | finetune/config.py | 74 | # ================================================================= |
| MEDIUM | finetune/config.py | 96 | # ================================================================= |
| MEDIUM | finetune/config.py | 98 | # ================================================================= |
| MEDIUM | finetune/config.py | 109 | # ================================================================= |
| MEDIUM | finetune/config.py | 111 | # ================================================================= |
| MEDIUM | finetune/qlib_test.py | 28 | # ================================================================================= |
| MEDIUM | finetune/qlib_test.py | 30 | # ================================================================================= |
| MEDIUM | finetune/qlib_test.py | 92 | # ================================================================================= |
| MEDIUM | finetune/qlib_test.py | 94 | # ================================================================================= |
| MEDIUM | finetune/qlib_test.py | 203 | # ================================================================================= |
| MEDIUM | finetune/qlib_test.py | 205 | # ================================================================================= |
| MEDIUM | finetune/qlib_test.py | 298 | # ================================================================================= |
| MEDIUM | finetune/qlib_test.py | 300 | # ================================================================================= |
| MEDIUM | examples/get_akshare_date_2024-2025_x.py | 619 | # ===================================================== |
| MEDIUM | examples/get_date_new.py | 651 | # ===================================================== |
| MEDIUM | examples/prediction_akshare_2024-2025.py | 532 | # ========================================================= |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tests/test_kronos_regression.py | 46 | def test_kronos_predictor_regression(context_len): |
| LOW | tests/test_kronos_regression.py | 91 | def test_kronos_predictor_mse(context_len, expected_mse): |
| LOW | examples/get_akshare_date_2024-2025_x.py | 157 | def parse_kline_data_directly(response_text, stock_code, start_year, end_year): |
| LOW | examples/get_akshare_date_2024-2025_x.py | 353 | def get_stock_data_with_retry(stock_code="002354", start_year=2024, end_year=2025, retry_count=2): |
| LOW | examples/prediction_new.py | 664 | def _get_default_market_analysis(self): |
| LOW | examples/prediction_new.py | 672 | def _get_default_sector_analysis(self): |
| LOW | examples/prediction_new.py | 682 | def _get_default_macro_analysis(self): |
| LOW | examples/prediction_new.py | 689 | def _get_default_fundamental_analysis(self): |
| LOW | examples/prediction_new.py | 89 | def get_stock_data_with_retry_all_history(stock_code="600580", retry_count=2): |
| LOW | examples/prediction_new.py | 105 | def create_realistic_fallback_data(stock_code="600580"): |
| LOW | examples/prediction_new.py | 191 | def save_all_history_stock_data(df, stock_code, save_dir): |
| LOW | examples/prediction_new.py | 284 | def calculate_prediction_parameters(df, target_days=60): |
| LOW | examples/prediction_new.py | 333 | def calculate_optimal_interval(min_val, max_val): |
| LOW | examples/prediction_new.py | 363 | def get_stock_price_reference(stock_code, current_price): |
| LOW | examples/prediction_new.py | 600 | def analyze_company_fundamentals(self, stock_code): |
| LOW | examples/prediction_new.py | 651 | def _calculate_trend_strength(self, df): |
| LOW | examples/prediction_new.py | 702 | def enhance_prediction_with_market_factors( |
| LOW | examples/prediction_new.py | 757 | def calculate_enhanced_adjustment_factor(market_analysis, sector_analysis, macro_analysis, fundamental_analysis): |
| LOW | examples/prediction_new.py | 826 | def create_comprehensive_market_report(enhancement_info, output_dir, stock_code): |
| LOW | examples/prediction_new.py | 850 | def generate_analysis_summary(enhancement_info): |
| LOW | examples/prediction_new.py | 895 | def plot_comprehensive_prediction( |
| LOW | examples/prediction_new.py | 1148 | def run_comprehensive_kronos_prediction(stock_code, stock_name, data_dir, pred_days, output_dir, history_years=1): |
| LOW | examples/prediction_new_GUI.py | 959 | def _get_default_market_analysis(self): |
| LOW | examples/prediction_new_GUI.py | 967 | def _get_default_sector_analysis(self): |
| LOW | examples/prediction_new_GUI.py | 977 | def _get_default_macro_analysis(self): |
| LOW | examples/prediction_new_GUI.py | 984 | def _get_default_fundamental_analysis(self): |
| LOW | examples/prediction_new_GUI.py | 391 | def get_stock_data_with_retry_all_history(stock_code="600580", retry_count=2): |
| LOW | examples/prediction_new_GUI.py | 407 | def create_realistic_fallback_data(stock_code="600580"): |
| LOW | examples/prediction_new_GUI.py | 493 | def save_all_history_stock_data(df, stock_code, save_dir): |
| LOW | examples/prediction_new_GUI.py | 586 | def calculate_prediction_parameters(df, target_days=60): |
| LOW | examples/prediction_new_GUI.py | 616 | def generate_trading_dates_only(last_date, pred_len): |
| LOW | examples/prediction_new_GUI.py | 649 | def calculate_optimal_interval(min_val, max_val): |
| LOW | examples/prediction_new_GUI.py | 895 | def analyze_company_fundamentals(self, stock_code): |
| LOW | examples/prediction_new_GUI.py | 946 | def _calculate_trend_strength(self, df): |
| LOW | examples/prediction_new_GUI.py | 997 | def smooth_prediction_results(prediction_df, historical_df, smooth_factor=0.3): |
| LOW | examples/prediction_new_GUI.py | 1070 | def apply_post_holiday_adjustment(prediction_df, future_dates, holiday_periods): |
| LOW | examples/prediction_new_GUI.py | 1105 | def validate_prediction_results(historical_df, prediction_df, max_price_change=0.3): |
| LOW | examples/prediction_new_GUI.py | 1140 | def run_comprehensive_prediction_gui(stock_code, stock_name, data_dir, pred_days, output_dir, history_years=1, |
| LOW | examples/prediction_new_GUI.py | 1327 | def enhance_prediction_with_market_factors(historical_df, prediction_df, stock_code, market_analyzer): |
| LOW | examples/prediction_new_GUI.py | 1369 | def calculate_enhanced_adjustment_factor(market_analysis, sector_analysis, macro_analysis, fundamental_analysis): |
| LOW | examples/prediction_new_GUI.py | 1410 | def create_comprehensive_market_report(enhancement_info, output_dir, stock_code): |
| LOW | examples/prediction_new_GUI.py | 1433 | def plot_optimized_prediction_gui(historical_df, base_pred_df, enhanced_pred_df, future_trading_dates, |
| LOW | examples/get_date_new.py | 23 | def get_stock_data_eastmoney_all_history(stock_code="002354"): |
| LOW | examples/get_date_new.py | 147 | def parse_kline_data_directly_all_history(response_text, stock_code): |
| LOW | examples/get_date_new.py | 190 | def get_stock_data_akshare_all_history(stock_code="002354"): |
| LOW | examples/get_date_new.py | 243 | def get_stock_data_baostock_all_history(stock_code="002354"): |
| LOW | examples/get_date_new.py | 354 | def get_stock_data_with_retry_all_history(stock_code="002354", retry_count=2): |
| LOW | examples/get_date_new.py | 378 | def create_sample_data_all_history(stock_code="002354"): |
| LOW | examples/get_date_new.py | 504 | def display_all_history_data_info(df, stock_code): |
| LOW | examples/get_date_new.py | 566 | def save_all_history_stock_data(df, stock_code, save_dir="D:/lianghuajiaoyi/Kronos/examples/data"): |
| LOW | examples/prediction_akshare_2024-2025.py | 78 | def calculate_prediction_parameters(df, target_days=100): |
| LOW | examples/prediction_akshare_2024-2025.py | 112 | def generate_future_dates_with_holidays(last_date, pred_len): |
| LOW | examples/prediction_akshare_2024-2025.py | 152 | def plot_prediction_with_details(kline_df, pred_df, future_dates, stock_code="002354", stock_name="股票", pred_len=100, |
| LOW | examples/prediction_akshare_2024-2025.py | 312 | def generate_prediction_report(close_df, volume_df, pred_df, future_dates, stock_code="002354", stock_name="股票", |
| LOW | examples/run_backtest_kronos.py | 132 | def calculate_trading_signals(self, hist_df, pred_df, threshold=0.02): |
| LOW | examples/yuce/historical_backtest.py | 57 | def simulate_model_prediction(self, df, lookback_days=60, pred_days=30): |
| LOW | examples/yuce/historical_backtest.py | 104 | def calculate_prediction_accuracy(self, results_df): |
| LOW | model/kronos.py | 389 | def auto_regressive_inference(tokenizer, model, x, x_stamp, y_stamp, max_context, pred_len, clip=5, T=1.0, top_k=0, top_ |
| LOW | model/module.py | 157 | def get_hard_per_sample_entropy(self, zb_by_sample): |
| LOW | webui/templates/index.html | 843 | function setupSliderEventListeners() { |
| 3 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | examples/get_akshare_date_2024-2025_x.py | 152 | except Exception as e: |
| LOW | examples/get_akshare_date_2024-2025_x.py | 195 | except Exception as e: |
| LOW | examples/get_akshare_date_2024-2025_x.py | 256 | except Exception as e: |
| LOW | examples/get_akshare_date_2024-2025_x.py | 348 | except Exception as e: |
| LOW | examples/prediction_new.py | 84 | except Exception as e: |
| LOW | examples/prediction_new.py | 472 | except Exception as e: |
| LOW | examples/prediction_new.py | 543 | except Exception as e: |
| LOW | examples/prediction_new.py | 596 | except Exception as e: |
| LOW | examples/prediction_new.py | 647 | except Exception as e: |
| LOW | examples/prediction_new.py | 1172 | except Exception as e: |
| LOW | examples/prediction_new.py | 1295 | except Exception as e: |
| LOW | examples/prediction_new_GUI.py | 311 | except Exception as e: |
| LOW | examples/prediction_new_GUI.py | 386 | except Exception as e: |
| LOW | examples/prediction_new_GUI.py | 767 | except Exception as e: |
| LOW | examples/prediction_new_GUI.py | 838 | except Exception as e: |
| LOW | examples/prediction_new_GUI.py | 891 | except Exception as e: |
| LOW | examples/prediction_new_GUI.py | 942 | except Exception as e: |
| LOW | examples/prediction_new_GUI.py | 1176 | except Exception as e: |
| LOW | examples/prediction_new_GUI.py | 1319 | except Exception as e: |
| LOW | examples/prediction_new_GUI.py | 1611 | except Exception as e: |
| LOW | examples/get_date_new.py | 142 | except Exception as e: |
| LOW | examples/get_date_new.py | 184 | except Exception as e: |
| LOW | examples/get_date_new.py | 238 | except Exception as e: |
| LOW | examples/get_date_new.py | 349 | except Exception as e: |
| LOW | examples/prediction_akshare_2024-2025.py | 504 | except Exception as e: |
| LOW | examples/run_backtest_kronos.py | 408 | except Exception as e: |
| LOW | examples/prediction_cn_markets_day.py | 60 | except Exception as e: |
| LOW | examples/yuce/historical_backtest.py | 329 | except Exception as e: |
| LOW | webui/run.py | 84 | except Exception as e: |
| LOW | webui/app.py | 122 | except Exception as e: |
| LOW | webui/app.py | 205 | except Exception as e: |
| LOW | webui/app.py | 401 | except Exception as e: |
| LOW | webui/app.py | 489 | except Exception as e: |
| LOW | webui/app.py | 610 | except Exception as e: |
| LOW | webui/app.py | 623 | except Exception as e: |
| LOW | webui/app.py | 662 | except Exception as e: |
| LOW | finetune_csv/train_sequential.py | 308 | except Exception as e: |
| MEDIUM | finetune_csv/train_sequential.py | 310 | print(f"Error occurred during training: {str(e)}") |
| LOW | finetune_csv/train_sequential.py | 355 | except Exception: |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | finetune/config.py | 1 | |
| LOW | finetune/qlib_test.py | 11 | |
| LOW | finetune/qlib_test.py | 16 | |
| LOW | finetune/qlib_test.py | 19 | |
| LOW | finetune/train_tokenizer.py | 6 | |
| LOW | finetune/train_tokenizer.py | 7 | |
| LOW | examples/get_akshare_date_2024-2025_x.py | 4 | |
| LOW | examples/prediction_new.py | 8 | |
| LOW | examples/prediction_new.py | 10 | |
| LOW | examples/prediction_new.py | 13 | |
| LOW | examples/prediction_new.py | 13 | |
| LOW | examples/prediction_new.py | 13 | |
| LOW | examples/prediction_new.py | 13 | |
| LOW | examples/prediction_new_GUI.py | 8 | |
| LOW | examples/prediction_new_GUI.py | 10 | |
| LOW | examples/prediction_new_GUI.py | 13 | |
| LOW | examples/prediction_new_GUI.py | 13 | |
| LOW | examples/prediction_new_GUI.py | 13 | |
| LOW | examples/prediction_new_GUI.py | 13 | |
| LOW | examples/prediction_new_GUI.py | 17 | |
| LOW | examples/prediction_new_GUI.py | 19 | |
| LOW | examples/get_date_new.py | 4 | |
| LOW | examples/run_backtest_kronos.py | 6 | |
| LOW | examples/run_backtest_kronos.py | 6 | |
| LOW | examples/yuce/historical_backtest.py | 6 | |
| LOW | examples/yuce/historical_backtest.py | 6 | |
| LOW | model/kronos.py | 10 | |
| LOW | webui/run.py | 15 | |
| LOW | webui/run.py | 16 | |
| LOW | webui/run.py | 17 | |
| LOW | webui/run.py | 18 | |
| LOW | webui/run.py | 19 | |
| LOW | webui/run.py | 56 | |
| LOW | webui/run.py | 56 | |
| LOW | webui/run.py | 56 | |
| LOW | webui/app.py | 3 | |
| LOW | finetune_csv/train_sequential.py | 6 | |
| LOW | finetune_csv/train_sequential.py | 7 | |
| LOW | finetune_csv/train_sequential.py | 11 | |
| LOW | finetune_csv/train_sequential.py | 15 | |
| LOW | finetune_csv/finetune_tokenizer.py | 11 | |
| LOW | finetune_csv/finetune_base_model.py | 5 | |
| LOW | finetune_csv/finetune_base_model.py | 13 | |
| LOW | finetune_csv/finetune_base_model.py | 21 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | finetune/qlib_test.py | 239 | |
| LOW | finetune/train_tokenizer.py | 74 | |
| LOW | examples/get_akshare_date_2024-2025_x.py | 23 | |
| LOW | examples/get_akshare_date_2024-2025_x.py | 157 | |
| LOW | examples/get_akshare_date_2024-2025_x.py | 384 | |
| LOW | examples/get_akshare_date_2024-2025_x.py | 500 | |
| LOW | examples/prediction_new.py | 333 | |
| LOW | examples/prediction_new.py | 702 | |
| LOW | examples/prediction_new.py | 476 | |
| LOW | examples/prediction_new_GUI.py | 649 | |
| LOW | examples/prediction_new_GUI.py | 1070 | |
| LOW | examples/prediction_new_GUI.py | 1105 | |
| LOW | examples/prediction_new_GUI.py | 771 | |
| LOW | examples/get_date_new.py | 23 | |
| LOW | examples/get_date_new.py | 147 | |
| LOW | examples/get_date_new.py | 378 | |
| LOW | examples/get_date_new.py | 504 | |
| LOW | examples/prediction_akshare_2024-2025.py | 369 | |
| LOW | examples/run_backtest_kronos.py | 158 | |
| LOW | examples/run_backtest_kronos.py | 359 | |
| LOW | examples/yuce/historical_backtest.py | 264 | |
| LOW | model/kronos.py | 225 | |
| LOW | webui/app.py | 78 | |
| LOW | webui/app.py | 209 | |
| LOW | webui/app.py | 342 | |
| LOW | webui/app.py | 405 | |
| LOW | finetune_csv/config_loader.py | 25 | |
| LOW | finetune_csv/finetune_tokenizer.py | 151 | |
| LOW | finetune_csv/finetune_base_model.py | 239 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | finetune/qlib_data_preprocess.py | 43 | # Check if start_index lookbackw_window will cause negative index |
| LOW | finetune/qlib_data_preprocess.py | 47 | # Check if end_index exceeds the range of the array |
| LOW | finetune/qlib_data_preprocess.py | 53 | # Check if end_index+predictw_window will exceed the range of the array |
| LOW | webui/start.sh | 8 | # Check if Python is installed |
| LOW | webui/start.sh | 14 | # Check if in correct directory |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | finetune/qlib_test.py | 311 | # Create a dedicated dictionary for this run's configuration |
| MEDIUM | model/kronos.py | 129 | mask = 2 ** torch.arange(self.codebook_dim//2, device=x1.device, dtype=torch.long) # Create a mask for bit e |
| MEDIUM | model/kronos.py | 134 | mask = 2 ** torch.arange(self.codebook_dim, device=x.device, dtype=torch.long) # Create a mask for bit extra |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | finetune/dataset.py | 115 | # Apply normalization and robust clipping to the entire sequence |