Weather Condition Classifier

Random Forest classifier trained on synthetic sensor data from a Tiva C / ESP8266 / Firebase Weather Monitoring System (Embedded Systems Course Project).

Model Details

Property Value
Algorithm Random Forest
Trees 100
Max Depth 10
Export Format ONNX (opset 12)
Input Features 3 (temperature, humidity, light)
Output Classes 5

Label Map

Index Label
0 Cloudy
1 Hot_Dry
2 Humid_Rainy
3 Night
4 Sunny

Input Format

# Shape: [batch_size, 3]  dtype: float32
# Column order: [temperature_c, humidity_pct, light_lux_adc]
import numpy as np
sample = np.array([[35.0, 30.0, 900.0]], dtype=np.float32)

Inference (Python β€” ONNX Runtime)

import onnxruntime as rt
import numpy as np
import joblib

sess    = rt.InferenceSession("weather_model.onnx")
le      = joblib.load("label_encoder.pkl")

sample  = np.array([[35.0, 30.0, 900.0]], dtype=np.float32)
inp     = {sess.get_inputs()[0].name: sample}
pred    = sess.run(None, inp)[0]
label   = le.inverse_transform(pred)[0]
print(label)  # β†’ "Sunny"

Inference (Raspberry Pi β€” live sensor readings)

# Replace sample values with live DHT-11 + LDR ADC readings
sample = np.array([[temperature, humidity, light_adc]], dtype=np.float32)

Training Data

Dataset: tamimhassan05/weather-monitoring-dataset

Training Report

============================================================
WEATHER CLASSIFIER β€” TRAINING REPORT
============================================================

Model          : RandomForestClassifier
Dataset        : weather_dataset.csv
Features       : ['temperature_c', 'humidity_pct', 'light_lux_adc']
Train samples  : 4000
Test  samples  : 1000

Test  Accuracy : 98.70%
CV    Accuracy : 98.48% Β± 0.17%

Classification Report:
              precision    recall  f1-score   support

      Cloudy       1.00      1.00      1.00       200
     Hot_Dry       0.97      0.97      0.97       200
 Humid_Rainy       1.00      0.99      1.00       200
       Night       1.00      1.00      1.00       200
       Sunny       0.97      0.97      0.97       200

    accuracy                           0.99      1000
   macro avg       0.99      0.99      0.99      1000
weighted avg       0.99      0.99      0.99      1000

Confusion Matrix:
[[200   0   0   0   0]
 [  0 194   0   0   6]
 [  0   0 199   1   0]
 [  0   0   0 200   0]
 [  0   6   0   0 194]]

Feature Importances:
  temperature_c       : 0.2821
  humidity_pct        : 0.4157
  light_lux_adc       : 0.3022

Hyperparameters:
  n_estimators          : 100
  max_depth             : 10
  min_samples_leaf      : 4
  class_weight          : balanced
  random_state          : 42
  n_jobs                : -1
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support