Project 16 · Machine Learning

Neural Networks · Weather Event Damage

⚠️ in developmentdata:2025

Classification model applied to NOAA Storm Events data to estimate the probability of recorded economic damage in weather events. The project uses information from 2010 to 2025, compares logistic regression with a neural network, and evaluates their performance on years after those used for training.

Python
Keras
Scikit-learn
Machine Learning
Supervised model
Neural Network

CONTEXT AND OBJECTIVE

The project uses 1,037,691 weather events recorded by NOAA Storm Events between 2010 and 2025. Each record includes information on the observed phenomenon, date and location, together with weather characteristics and property and crop damage amounts when reported.

These data were used to define a target variable identifying events with recorded economic damage. The analysis estimates the probability of this outcome using temporal, geographical and weather information for each event. To make predictions depend on these characteristics, damage amounts and other variables that directly reveal the outcome were excluded from the predictors.

Two supervised classification models were compared. Logistic regression provides a statistical baseline through coefficients associated with the variables; the neural network offers greater flexibility to learn relationships between them. The models were trained on data from 2010 to 2021, validated on 2022 and 2023, and finally evaluated on events from 2024 and 2025. This temporal split measures their performance on records more recent than those used to fit each model.

MODEL AND VALIDATION

Data preparation and definition of recorded damage

The annual NOAA Storm Events files were first downloaded and integrated into a single dataset. Column names and types, missing values and consistency across years were reviewed before preparing the model variables.

Property and crop damage appear in the files in different units, such as thousands or millions. They were converted into comparable numerical amounts and added together to construct the variable indicating whether each event has recorded economic damage.

TARGET VARIABLE · RECORDED ECONOMIC DAMAGE
y_i=\mathbb{1}\left(D_{\text{property},i}+D_{\text{crops},i}>0\right)

The indicator equals 1 when the sum of recorded property and crop damage is greater than zero, and 0 otherwise. Amounts without a reported value were treated as zero when constructing it. The model therefore identifies damage recorded by NOAA, which does not necessarily represent all damage that may have occurred.

Predictions used 19 source variables: ten numerical and nine categorical. These include dates, locations, event types, magnitudes and coordinates. Indicators of missing information were also created. Damage amounts and columns directly revealing the outcome were excluded from the predictors so that the model would learn from event characteristics.

Temporal split and variable preparation

Records were split chronologically into three sets: 2010-2021 for training, 2022-2023 for validation and 2024-2025 for the final test. The first period was used to estimate the models; the second to monitor their performance during development; and the third was reserved for the final comparison on later data.

Common preprocessing was applied before training the models. Missing numerical values were filled with the training set median, and values were standardized to work on comparable scales. Categorical variables were transformed using one-hot encoding, which creates indicator columns for observed categories. Preprocessing was fitted on the training data and then applied to validation and test data without recalculating its parameters.

Logistic regression as the baseline model

Logistic regression served as the analysis baseline. During training, it estimates a coefficient for each transformed variable and combines these contributions into a score summarizing an event’s tendency to have recorded damage. Each coefficient’s sign indicates whether a variable increases or decreases this score, holding the others constant; its magnitude reflects the weight of that contribution on the model’s scale. The sigmoid function transforms the result into a probability between 0 and 1.

PROBABILITY ESTIMATED WITH LOGISTIC REGRESSION
\hat{p}_i=\frac{1}{1+e^{-(\beta_0+\sum_j\beta_jx_{ij})}}

In the equation, x represents the variables after preprocessing and β represents the coefficients estimated from the training data. The sigmoid transforms the linear combination into a probability of recorded economic damage between 0 and 1.

Training includes L2 regularization to moderate excessively large coefficients and encourage more stable estimation when working with many transformed variables. Logistic regression thus provides a concrete point of comparison: its probabilities, correct predictions and errors are compared with those of the neural network over the same periods to assess the contribution of the latter’s greater flexibility.

Neural network and comparison of results

A neural network with dense layers was trained using the same prepared variables. Unlike logistic regression, the network combines signals in several stages using weights learned during training. ReLU activations allow it to capture nonlinear relationships; dropout helps reduce overfitting, and the final layer uses a sigmoid to express the prediction as a probability of recorded damage.

TRANSFORMATION IN THE HIDDEN LAYERS
h^{(l)}=\mathrm{ReLU}\left(W^{(l)}h^{(l-1)}+b^{(l)}\right)

In each layer, weights W and biases b transform the incoming information. The ReLU function allows the network to learn relationships that cannot be described by a purely linear combination.

NEURAL NETWORK PROBABILITY
\hat{p}_i=\sigma\left(w^\top h_i+b\right)

The final layer applies the sigmoid function σ to the information learned by the network and returns a probability of recorded damage for each event.

The network was trained using Adam, which adjusts weights based on model errors, and binary cross-entropy to measure the difference between predicted probabilities and observed outcomes. Monitoring validation performance allowed the learning rate to be adjusted and training to stop when improvement ceased, limiting overfitting.

LOSS · BINARY CROSS-ENTROPY
\mathcal{L}=-\frac{1}{n}\sum_{i=1}^{n}\left[y_i\log(\hat{p}_i)+(1-y_i)\log(1-\hat{p}_i)\right]

Cross-entropy compares the observed outcome y with the estimated probability p̂. The lower its value, the better the probabilities fit the actual outcomes.

The final comparison used ROC AUC and PR AUC, which evaluate how well each model separates events with recorded damage from other events. PR AUC is especially important because events with positive damage are less frequent. Precision, recall, F1 and confusion matrices were also calculated to review how many positive cases each model detects and how many alerts are correct.

PRECISION AND RECALL OF EVENTS WITH DAMAGE
\mathrm{Precision}=\frac{VP}{VP+FP}
\mathrm{Recall}=\frac{VP}{VP+FN}

VP denotes damage cases correctly detected by the model; FP denotes positive alerts for events without recorded damage; and FN denotes damage cases the model failed to identify. Precision measures the proportion of positive alerts that were correct, while recall measures the proportion of events with damage that were detected.

DELIVERY AND LEARNING

In the final test on events from 2024-2025, the neural network achieved a ROC AUC of 0.9324 and a PR AUC of 0.8004. Logistic regression achieved 0.8961 and 0.6691, respectively. The neural network better distinguished events with recorded damage, with a particularly clear advantage in PR AUC.

Considering only events with recorded damage, the neural network achieved precision of 0.7942, recall of 0.6243 and F1 of 0.6991. Logistic regression achieved 0.7580, 0.5023 and 0.6042. In practical terms, the neural network identified a larger proportion of these events while maintaining higher precision in its positive alerts.

F1 METRIC · BALANCE BETWEEN PRECISION AND RECALL
F_1=2\,\frac{\mathrm{Precision}\cdot\mathrm{Recall}}{\mathrm{Precision}+\mathrm{Recall}}

F1 combines precision and recall into a single indicator. It is useful for comparing models when detecting the positive class matters while avoiding too many incorrect alerts.

The comparison provides estimated probabilities for each event, predictions from both models, confusion matrices, comparative metrics and training plots. The preprocessing and models were retained to apply the same criteria to new records with the same variables. When data from later years are added, their predictions can be compared with recorded damage to check whether performance is maintained or retraining is advisable.