Skip to content

Commit 673faf4

Browse files
Apply batched suggestions from code review
Co-authored-by: priya-sundaram-dev <oc-409d01@agentmail.to>
1 parent 996a928 commit 673faf4

1 file changed

Lines changed: 0 additions & 19 deletions

File tree

  • machine_learning/forecasting

‎machine_learning/forecasting/run.py‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
from warnings import simplefilter
1515

16-
import matplotlib.pyplot as plt
1716
import numpy as np
1817
import pandas as pd
1918
from sklearn.ensemble import RandomForestRegressor
@@ -145,22 +144,6 @@ def data_safety_checker(list_vote: list, actual_result: float) -> bool:
145144
return safe > not_safe
146145

147146

148-
def plot_forecast(actual, predictions):
149-
plt.figure(figsize=(10, 5))
150-
plt.plot(range(len(actual)), actual, label="Actual")
151-
plt.plot(len(actual), predictions[0], "ro", label="Linear Reg")
152-
plt.plot(len(actual), predictions[1], "go", label="SARIMAX")
153-
plt.plot(len(actual), predictions[2], "bo", label="SVR")
154-
plt.plot(len(actual), predictions[3], "yo", label="RF")
155-
plt.legend()
156-
plt.title("Data Safety Forecast")
157-
plt.xlabel("Days")
158-
plt.ylabel("Normalized User Count")
159-
plt.grid(True)
160-
plt.tight_layout()
161-
plt.show()
162-
163-
164147
if __name__ == "__main__":
165148
"""
166149
data column = total user in a day, how much online event held in one day,
@@ -202,5 +185,3 @@ def plot_forecast(actual, predictions):
202185
# check the safety of today's data
203186
not_str = "" if data_safety_checker(res_vote, test_user[0]) else "not "
204187
print(f"Today's data is {not_str}safe.")
205-
206-
plot_forecast(train_user, res_vote)

0 commit comments

Comments
 (0)