Views
No views yet
LSTM -> Dropout -> Dense -> Dense (Sigmoid)IoT_Weather subset of ToN_IoT(batch_size, 10, 3) — features [temperature, pressure, humidity], normalized1import tensorflow as tf
2import numpy as np
3from huggingface_hub import hf_hub_download
4
5MODEL_PATH = hf_hub_download("Codelord01/sensor_binary", "sensor_binary.keras")
6model = tf.keras.models.load_model(MODEL_PATH)
7model.summary()
8
9sample_data = np.random.rand(1, 10, 3).astype(np.float32)
10prediction_prob = model.predict(sample_data)
11predicted_class = 1 if prediction_prob > 0.5 else 0
12print(f"Prediction Probability: {prediction_prob:.4f}")
13print("Anomaly Detected" if predicted_class == 1 else "Normal Conditions")