<jupyter_start><jupyter_text><jupyter_code>from tensorflow import keras

# Recreate the exact same model
new_model = keras.models.load_model('my_model.h5')
new_model.summary()
import datetime

date_time_str = "2005-01-01 00:00:00.00"
#date_time_obj = datetime.datetime.strptime(date_time_str, '%Y-%m-%d %H:%M:%S.%f')


date_time_obj = datetime.datetime.strptime(date_time_str, '%Y-%m-%d %H:%M:%S.%f')

print('Date:', date_time_obj.date())
print('Time:', date_time_obj.time())
print('Date-time:', date_time_obj)
print(date_time_obj)
from tensorflow import keras

# Recreate the exact same model
renew_model = keras.models.load_model('recreate_model.h5')
renew_model.summary()
import pandas as pd
import numpy as np
from sklearn.preprocessing import MinMaxScaler
#scale the data
scaler = MinMaxScaler(feature_range = (0,1))

new_df = pd.read_csv(
  "dateindex1.csv", parse_dates=['datetime'],   index_col="datetime"
)
new_df = new_df.filter(['G'])
last_24_hours = new_df[-24:].values

scaled_data = scaler.fit_transform(last_24_hours)

last_24_hours_scaled = scaler.transform(last_24_hours)

X_test = []
#apend the past 24 hours
X_test.append(last_24_hours_scaled)
#convert the X_test to numpy

X_test = np.array(X_test)
X_test = np.reshape(X_test,(X_test.shape[0],X_test.shape[1],1))
pred_irradiance = renew_model.predict(X_test)
pred_irradiance = scaler.inverse_transform(pred_irradiance)
print(pred_irradiance)<jupyter_output>[[-2.7130182]]
{'fraction_non_alphanumeric': 0.13809854267869534, 'fraction_numerical': 0.031922276197085354, 'mean_word_length': 7.335260115606936, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '326929', 'license': 'CC0-1.0', 'n_tokens_mistral': 596, 'n_tokens_neox': 560, 'n_words': 96, 'path': 'datascience/models/Test0.ipynb', 'repo_name': 'VimeshShahama/Cyber---SDGP', 'size': '1441'}