From ac68dc1128535b6798af256fcdab67340f6c0fd9 Mon Sep 17 00:00:00 2001 From: Adithya Awati <1ds21ai001@dsce.edu.in> Date: Mon, 14 Aug 2023 14:04:16 +0530 Subject: [PATCH] Fixed Pytest warnings for machine_learning/forecasting (#8958) * updating DIRECTORY.md * Fixed pyTest Warnings --------- Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> --- DIRECTORY.md | 1 + machine_learning/forecasting/run.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index 14152e4ab..384ce1b22 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -340,6 +340,7 @@ * [Rod Cutting](dynamic_programming/rod_cutting.py) * [Subset Generation](dynamic_programming/subset_generation.py) * [Sum Of Subset](dynamic_programming/sum_of_subset.py) + * [Tribonacci](dynamic_programming/tribonacci.py) * [Viterbi](dynamic_programming/viterbi.py) * [Word Break](dynamic_programming/word_break.py) diff --git a/machine_learning/forecasting/run.py b/machine_learning/forecasting/run.py index 88c4a537b..64e719daa 100644 --- a/machine_learning/forecasting/run.py +++ b/machine_learning/forecasting/run.py @@ -11,6 +11,8 @@ missing (the amount of data that u expected are not supposed to be) u can just adjust it for ur own purpose """ +from warnings import simplefilter + import numpy as np import pandas as pd from sklearn.preprocessing import Normalizer @@ -45,8 +47,10 @@ def sarimax_predictor(train_user: list, train_match: list, test_match: list) -> >>> sarimax_predictor([4,2,6,8], [3,1,2,4], [2]) 6.6666671111109626 """ + # Suppress the User Warning raised by SARIMAX due to insufficient observations + simplefilter("ignore", UserWarning) order = (1, 2, 1) - seasonal_order = (1, 1, 0, 7) + seasonal_order = (1, 1, 1, 7) model = SARIMAX( train_user, exog=train_match, order=order, seasonal_order=seasonal_order )