Started adding weather code

This commit is contained in:
2025-07-10 21:09:48 +00:00
parent 7f57befaee
commit 5ba8ae59d6
7 changed files with 197 additions and 111 deletions

21
main.py
View File

@@ -2,7 +2,7 @@ import numpy as np # helps with the math
import matplotlib.pyplot as plt # to plot error during training
from data.db_connect import Database
from data.stats_importer import Importer
from data.build_weather import Weather
from data.build_weather import get_weather
# input data
inputs = np.array([[0, 0, 1, 0],
@@ -59,23 +59,26 @@ class NeuralNetwork:
return prediction
if __name__ == '__main__':
build_db_path = "./data/sql/build_db.sql"
fill_parks_path = "./data/sql/prefill_parks.sql"
fill_teams_path = "./data/sql/prefill_teams.sql"
#build_db_path = "./data/sql/build_db.sql"
#fill_parks_path = "./data/sql/prefill_parks.sql"
#fill_teams_path = "./data/sql/prefill_teams.sql"
db_file = "./database/baseball.db"
db_conn = Database(db_file)
db_conn.run_sql_file(build_db_path)
db_conn.run_sql_file(fill_parks_path)
db_conn.run_sql_file(fill_teams_path)
#db_conn.run_sql_file(build_db_path)
#db_conn.run_sql_file(fill_parks_path)
#db_conn.run_sql_file(fill_teams_path)
imp = Importer(db_conn)
imp.parse_all_data("./data/stats/to_import", "./data/stats/imported/")
#imp = Importer(db_conn)
#imp.parse_all_data("./data/stats/to_import", "./data/stats/imported/")
#we = Weather()
#print(we.get_weather(39.26733000, -76.79831000, "20250706", 12))
park_data = db_conn.select("SELECT latitude, longitude FROM parks WHERE park_id = ? OR park_id = ?", ("ATL03","KAN06",))
print(park_data[0])
else:
# create neural network
NN = NeuralNetwork(inputs, outputs)