Can machine learning help predict San Diego’s next wildfire?

Machine Learning


As climate change intensifies fire weather across Southern California, predicting when and where the next wildfire will start has become a matter of survival. Earth.Org trains machine learning models based on historical weather patterns, with the goal of turning complex atmospheric variables into a powerful early warning system that can predict fires before the first spark.

When examining natural disasters caused by climate change in the United States, wildfires often rise to the forefront of the conversation. As wildfires become more prevalent, the damage and impact on society is also increasing. For example, the 2025 Los Angeles wildfires ravaged 40,000 acres of land in the region, causing estimated damage and economic losses of more than $200 billion.

But Los Angeles is just one example of many regions seeing a spike in wildfires caused by climate change. San Diego, California, is experiencing an increase in “fire weather” days, according to Climate Central. The nearby Southeast Desert Basin, which includes Palm Springs, saw an increase of up to 60 days between 1973 and 2024.

There are multiple factors that contribute to the spread of wildfires in these areas, but the most common factors include meteorological factors such as humidity, temperature, and wind speed. This analysis looks at historical data for San Diego to see if these specific variables can predict wildfire occurrence in the region.

Data: Wildfire meteorological variables and wildfire occurrence

California (Cal Fire) historical wildfire data and National Oceanic and Atmospheric Administration (NOAA) weather data from 2019 to 2025 were extracted to track San Diego wildfire occurrence and weather measurements during that period.

Daily weather measurements such as average humidity, average wind speed, maximum and minimum dry bulb temperatures, and maximum wind speed were all combined and used as multiple independent variables to predict whether a wildfire would occur on a given day (yes or no) and as a dependent binary outcome variable for all these measurements. Below is a map of recorded wildfire occurrence in San Diego from 2019 to 2025.

Figure 1: San Diego County wildfire occurrence map from 2019 to 2025. Data: Cal Fire.Figure 1: San Diego County wildfire occurrence map from 2019 to 2025. Data: Cal Fire.
A map of wildfires in San Diego County from 2019 to 2025. Data: Cal Fire. Map: Earth.Org.

To predict wildfire occurrence for this data, three binary machine learning models were built and compared against each other to identify the model that best predicts wildfires.

To fairly evaluate the model, we divided the data into two groups. 70% was used as a “training set” to teach the model the historical relationship between weather patterns and fires, and the remaining 30% was retained as a “test set.” This test set acts as a test, evaluating how accurately the model predicts fires based on never-before-seen data.

Logistic regression model results

The first of the three models constructed was a logistic regression model. This is a machine learning algorithm used for binary classification problems to predict the probability of a binary outcome. In this case, we predict the probability that a wildfire will occur.

After the model was built, important parameters were found to decipher the results. The first is the accuracy score, which is used to evaluate the percentage of correct classification results. The next parameter is the accuracy score, which is similar to the accuracy score, but focuses on the accuracy of the “sunny” day predictions (the number of days correctly predicted without a wildfire and the number of days predicted without a wildfire that actually occurred). The results of the logistic regression model are shown below.

Logistic regression parameters value
accuracy score 95.96%
accuracy score 95.96%
Table 1: Logistic regression output of the first model built to predict wildfire occurrence in San Diego against measurements of humidity, wind, and temperature. Model output produced by Earth.Org.

The last parameter found is the confusion matrix, which shows whether the model is correct or incorrect regarding the predicted and actual results.

Figure 1: Logistic regression confusion matrix constructed to display predicted wildfire occurrence for model humidity, wind, and temperature measurements. Matrix created by Earth.Org.

A confusion matrix was used to visualize where the model succeeded and where it struggled. Rather than getting bogged down in data science jargon, think of this matrix as a simple scoreboard. It maps four different outcomes: how often the model correctly predicted “sunny” days (top left value), how often it succeeded in flagging active wildfires (bottom right value), and the critical errors of false alarms (predicting a fire that never happened, top right value) and missed warnings (failing to predict an active fire, bottom left value).

Naive Bayes model results

The second of the three models built was a naive Bayes classifier. This is another machine learning model used for binary classification problems (predicting two different outcomes). This model differs from logistic regression because it is not only used to calculate the probability of a future event, but it also assumes that the features (predictors) that are input into the model are all independent of each other. In other words, the presence of one feature does not affect other features and they are unrelated to each other (this is why they are called simple classifiers). After this model is built, the same key parameters as the logistic regression model are found and the results are displayed below.

Naive Bayes classifier parameters value
accuracy score 95.80%
accuracy score 95.95%
Table 2: Naive Bayesian classifier output for the second model built to predict wildfire occurrence in San Diego for humidity, wind, and temperature measurements. Model output produced by Earth.Org.
Figure 2: Naive Bayes classifier confusion matrix constructed to display predicted wildfire occurrence for model humidity, wind, and temperature readings. Matrix created by Earth.Org.

Random forest model results

The last of the three models built is a random forest, which is also used for binary classification problems, but differs from the first two in that it consists of a number of decision trees (links) representing decisions. Because each “leaf” represents an outcome (whether a wildfire occurs or not) and each tree makes a classification prediction, they all work collectively as an ensemble, with the aggregate of the most outcomes in the ensemble providing the model’s prediction. After building this model, the accuracy and prediction scores are determined again and the results are displayed below.

random forest parameters value
accuracy score 96.12%
accuracy score 96.42%
Table 3: Random forest output of a third model built to predict wildfire occurrence in San Diego for humidity, wind, and temperature measurements. Model output produced by Earth.Org.
Figure 3: A random forest confusion matrix constructed to display predicted wildfire occurrence for the model’s humidity, wind, and temperature measurements. Matrix created by Earth.Org.

final thoughts

Returning to the original question of whether potential wildfire predictor variables can be used to predict the occurrence of wildfires in San Diego, the results show that it is possible, with all three models yielding similar results and showing very high accuracy and precision scores. However, the random forest model showed slightly higher values ​​in terms of accuracy (96.12% vs. 95.96% and 95.80%) and accuracy (96.42% vs. 95.96% and 95.95%) compared to the other two models.

Furthermore, looking at its confusion matrix, even though the Random Forest model predicted two false alarms for wildfire outbreaks and the Naive Bayes classifier predicted one, the Random Forest model had a slightly stronger set of predictions because it was able to detect the most true wildfire outbreaks in the data (three of them), while the other two models predicted zero. Although the data showed that most days were free of wildfires, about 4% of the total days in the data still had wildfires. Therefore, since the Random Forest model was able to accurately predict some instances that actually occur, it would be desirable to utilize it in this scenario.

Wildfires in San Diego, California.Wildfires in San Diego, California.
Wildfires in Southern California. Photo: Andrea Booher/FEMA.

While the results were strong, there are additional ways the analysis could be extended, such as using the same Cal Fire data to examine different regions of California or using different data sources across the state to examine different states in the United States. Another way it could be extended is by running additional machine learning algorithms suitable for binary classification, such as regular decision trees, neural networks, or support vector machines (SVMs), and using them as additional points of comparison to the three models built for this analysis.

As the frequency of wildfires continues to increase in many regions due to climate change, examining different methods for predicting wildfire occurrence can provide important insights into related appropriate preparedness and facilitating sustainability efforts.

Featured image: slworking2 via Flickr.



Source link