CryptoMarketParser/old/new_data_prediction.py
Simon Moisy 302be95ce7 init
2025-03-13 15:21:06 +08:00

22 lines
751 B
Python

from BitcoinPricePredictor import BitcoinPricePredictor
from tensorflow.keras.models import load_model
from sklearn.metrics import confusion_matrix
if __name__ == "__main__":
model = load_model('models/model_2025-01-21_04-49-43.h5')
predictor = BitcoinPricePredictor(model=model, db_path='bitcoin_historical_data.db')
missing_data = predictor.load_new_data_from_model()
print(f"missing data {len(missing_data)}")
if not missing_data.empty:
predictions, reality = predictor.make_predictions_w_reality(missing_data)
print(f"predictions {len(predictions)}")
cm = confusion_matrix(reality, predictions[1:])
print("Confusion Matrix:")
print(cm)
else:
print("No new data found.")