Forest Fires#
Forest fires in the northeast region of Portugal, with the burned area to be predicted from meteorological and other data. The source calls it a difficult regression task, and it is a good dataset for practising with a skewed target (about half of the fires have the area zero) and with categorical features.
Overview#
Loader |
|
Task |
Regression |
Samples |
517 |
Features |
12 |
Targets |
1 continuous target, |
Missing values |
None |
License |
CC BY 4.0 |
Features#
Two features are categorical and stored as integer codes: month (from jan to dec) and
day (the day of the week, from mon to sun). The names of the categories, in the order of
the codes, are in data.info.categorical, and data.categorical_features gives the
columns. The other ten features are numbers, stored as float64:
XandY, the coordinates of the place of the fire on the map of the Montesinho park. They are whole numbers from 1 to 9 and from 2 to 9.FFMC,DMC,DCandISI, four indices of the Fire Weather Index (FWI) system.temp(temperature in degrees Celsius),RH(relative humidity in percent),wind(wind speed in km/h) andrain(outside rain in mm/m2).
The features are stored in the order of the variables table of the source. The dataset has no
missing values. In the data file of the source most of the fires are in August (184) and in
September (172), and rain is zero for most of them.
The variables table of UCI lists DMC, rain and area as integers, although the
ranges that it gives for them have decimals. All values are stored as real numbers.
Target#
y is the burned area of the forest in hectares, stored as float64. In the data file of
the source it goes from 0 to 1090.84, its mean is 12.85, and 247 of the 517 fires have the
area 0. The source says that this variable is very skewed towards 0.0 and that it may make
sense to model it with the logarithm transform. The paper of the source, Cortez and Morais
(2007), transformed it with ln(x+1) and converted the predictions back. The values here are
stored as released, so applying a transform is up to the user.
Source and citation#
Source: UCI Machine Learning Repository
Obtained from: UCI Machine Learning Repository, dataset 162, downloaded with the ucimlrepo package: all 517 examples with 12 inputs and the target area. The ucimlrepo version is recorded in the file.
Creators: Paulo Cortez, Anbal Morais
Please cite the dataset as:
Cortez, P. & Morais, A. (2007). Forest Fires [Dataset]. UCI Machine Learning Repository. https://doi.org/10.24432/C5D88D
License#
CC BY 4.0, as stated by the source. The license was checked at the source on 2026-11-04. See License and citation.
Changes made#
Converted to the NumPy NPZ format. The features and the target are stored as float64.
The categorical features month and day are stored as integer codes, in the order of the category names listed for each feature: the months from jan to dec and the days of the week from mon to sun.
Note
The target area is very skewed towards 0.0. The source page says that it may make sense to model it with the logarithm transform, and the paper of the source used ln(x+1). The values are stored as released, without any transform.
Note
X and Y are the coordinates of a grid on the map of the Montesinho park, stored as whole numbers.
Note
The variables table of UCI lists DMC, rain and area as integers, although the ranges that it gives for them have decimals. The values are stored as real numbers.
Example#
>>> from pyml_datasets import load_forest_fires
>>> data = load_forest_fires()
>>> data.X.shape, data.y.shape
((517, 12), (517,))
>>> data.has_missing
False
>>> data.categorical_features
(2, 3)
>>> data.info.categorical["day"][4]
'fri'
>>> round(float(data.y.max()), 2)
1090.84
>>> int((data.y == 0).sum())
247