diff --git a/gamestonk_terminal/prediction_techniques/knn.py b/gamestonk_terminal/prediction_techniques/knn.py index 584c6f73d80..ba44c3dc887 100644 --- a/gamestonk_terminal/prediction_techniques/knn.py +++ b/gamestonk_terminal/prediction_techniques/knn.py @@ -145,9 +145,9 @@ def k_nearest_neighbors(l_args, s_ticker, df_stock): # Plotting plt.figure() plt.plot(df_stock.index, df_stock["5. adjusted close"], lw=2) + s_knn = f"{ns_parser.n_neighbors}-Nearest Neighbors on {s_ticker}" # BACKTESTING if ns_parser.s_end_date: - s_knn = f"{ns_parser.n_neighbors}-Nearest Neighbors on {s_ticker}" plt.title(f"BACKTESTING: {s_knn} - {ns_parser.n_days} days prediction") else: plt.title(f"{s_knn} - {ns_parser.n_days} days prediction") diff --git a/gamestonk_terminal/prediction_techniques/regression.py b/gamestonk_terminal/prediction_techniques/regression.py index 947914ae496..c454feededb 100644 --- a/gamestonk_terminal/prediction_techniques/regression.py +++ b/gamestonk_terminal/prediction_techniques/regression.py @@ -343,6 +343,8 @@ def regression(l_args, s_ticker, df_stock, polynomial): print_pretty_prediction(df_pred, df_stock["5. adjusted close"].values[-1]) print("") + except SystemExit: + print("") except Exception as e: print(e) print("")