- © Seismological Society of America
We implemented the first operational automated seismic‐event classification system for monitoring activity at the Piton de la Fournaise volcano observatory (OVPF, La Réunion Island). Our classifier is based on the Random Forest algorithm. It distinguishes between eight classes of seismic signals: summit and deep volcano tectonic events, local, regional, and teleseismic earthquakes, T phases, rockfalls, and sound waves. It adopts a multistation approach and automatically selects the best features for each station and combination of stations from a large set of waveform‐ and spectrum‐based features. It reaches peak performance when it runs on a three‐station combination: one station on the summit of Piton de la Fournaise, one in its caldera, and one on the volcano flank. We interfaced our classification system with the observatory management interface WebObs used at OVPF.
Full table of events recorded at Piton de la Fournaise volcano between 1 January 2009 and 20 June 2016, and confusion matrixes and the standard performance metrics for each classifier.
Piton de la Fournaise volcano (La Réunion Island, Indian Ocean) is a highly active basaltic shield volcano generated by the hotspot that created the Deccan Trapps (Lénat et al., 2012). It has produced 59 eruptions since 1980, most of which occurred within the volcano’s caldera, the Enclos Fouqué. It is monitored by many complementary geophysical and geochemical networks, including a seismic network of 20 short‐period and 23 broadband seismic stations run by the Piton de la Fournaise Volcano Observatory (OVPF; Fig. 1). Real‐time data from the seismic stations are fed into an EarthWorm instance at OVPF for automated event detection. Observatory operators use a subset of 14 seismic traces to verify the automated detections, manually add undetected events visible on more than three stations, and manually classify the events. In volcano monitoring, the reliability of seismic‐event classification can be critical, especially during the phases preceding an eruption, when the distribution of event types informs the monitoring team on the state and evolution of the volcano (Schmid et al., 2012). Manual event classification at OVPF occurs within the local observatory management interface called WebObs (Beauducel, 2006; Beauducel et al., 2010), which was originally designed for the Soufrière Guadeloupe Volcano Observatory and is now deployed at other volcano observatories (Martinique, Réunion, Montserrat, Indonesia, and Khartala).
The eight major event types classified at OVPF and their relative frequencies can be found in Table 1. These classes are differentiated manually according to their duration, frequency content, their P and S arrival times, and their amplitude attenuation across the network. Summit and deep events are volcano‐tectonic (VT) earthquakes occurring under the volcano, respectively, above and below sea level. Summit events have S–P times of the order of 0.5 s, whereas those of the deep events are longer. P waves from the deep events are difficult to pick on stations at the volcano summit but are clear on those at the base of the central cone. Local events are earthquakes mostly of tectonic origin occurring within 200 km of La Réunion Island. They are often observed at all stations near Piton de la Fournaise and have S–P times greater than 2 s. Regional events occur at distances of ∼1000 km around Réunion Island. Their S–P times are ∼2min, and their Pn waves display time delays and amplitude attenuation between the stations on the coast and those at the center of the island. Teleseismic events occur further away, are not affected by significant time delays across the network, and radiate energy at longer periods. T phase events are isolated T phases created by regional events. Rockfall events include rockfalls, rockslides, and other signals caused by gravitational instabilities on the volcano. They have longer durations and lower frequencies than summit VT events of similar amplitude, and their waveforms rapidly develop a spindle shape as the distance of observation increases. Sound‐wave events are due to thunderstorms, meteorites, and so on. They are identified by their high‐frequency content and by time delays between nearby stations inconsistent with seismic wavespeeds. Examples of these eight classes as observed by four different monitoring stations are shown in Figure 2. The differing signal shapes for a single event at the four stations are caused by the complex seismic velocity and attenuation structure of Piton de la Fournaise volcano more than by epicentral distance variations. Some event types are systematically well observed at certain stations and hardly distinguishable from noise at others. OVPF operators routinely exploit multiple stations to classify an event, and the most experienced ones have developed a keen sense of the useful information contained in each trace. Other volcanoes also exhibit long‐period and tremor events. On Piton de la Fournaise volcano, long‐period events are rare, and tremors last for hours, days, or months (Aki and Ferrazzini, 2000). The rarity of the former and the ease of discrimination of the latter place both these classes outside the scope of this study.
Automated event classifiers have been constructed for various volcanoes in the past, from both research and operational perspectives. The vast majority of these involved machine‐learning algorithms. The most popular algorithms have been automated neural networks (Falsaperla et al., 1996; Langer et al., 2003, 2006; Scarpetta et al., 2005; Esposito et al., 2006; Castellaro and Mulargia, 2007) and more recently methods based on hidden Markov models (Ohrnberger, 2000; Beyreuther and Wassermann, 2008; Corteś et al., 2009; Ibañez et al., 2009; Wassermann, 2011; Bicego et al., 2013). Less common methods include support vector machines (Masotti et al., 2006; Cannata et al., 2011; Langet, 2014) and fuzzy logic (Hibert et al., 2014). Three classification methods have been applied to the discrimination of VT events versus rockfalls on Piton de la Fournaise volcano for research purposes (Hibert et al., 2014; Hibert et al. [unpublished manuscript, 2017; see Data and Resources]; Langet, 2014), but none has yet been implemented for routine operational monitoring. In this article, we present the implementation of an operational event classifier for Piton de la Fournaise volcano that has been integrated into routine monitoring operations at OVPF. It has three goals: (1) to accelerate the classification process (especially useful during a seismic crisis), (2) to improve the robustness of the event catalog by reducing classification errors, and (3) to help new observatory operators get accustomed to classifying.
CLASSIFICATION STRATEGY: IMPLEMENTATION DETAILS
In developing our classification strategy, we incorporated input from OVPF’s most experienced observers, including their preference for a multistation approach. We started by applying a typical machine‐learning approach on single‐station data from the OVPF seismic monitoring stations (Fig. 3a). We first calculated a set of features (selected characteristics of a signal reduced to a small number of numerical values) from the waveforms of manually classified events. We then trained a standard machine‐learning algorithm (a Random Forest [RF] instance) for each station on the features of a representative subset of the events and validated its performance on the remaining events. Once the single‐station classifiers were trained, we retained the most informative features from a subset of stations and merged them into a new feature set to train a multistation classifier (another RF instance, Fig. 3b). We then built a prediction routine that computes the appropriate features given the start time, duration, and waveforms of an event, runs the multistation classifier in prediction mode, and returns the probability of each event type.
In the following, we describe in more detail the feature extraction, the single and multiple‐station classifier training procedure, the results of the classifier training, and the implementation of the operational classification routine.
We extracted from the OVPF event catalog (see Data and Resources; Ⓔ electronic supplement to this article) all events detected between 1 January 2009 and 20 June 2016. As the class populations were heavily unbalanced (see Table 1), we randomly subsampled the largest classes to generate a new catalog containing at most 2000 events per class. In the following, we shall refer to this subsampled catalog as the catalog.
For each event in the catalog, we requested vertical‐component waveform data for each OVPF station from the observatory’s internal ArcLink server and corrected for instrument response. We restricted ourselves to vertical‐component data to maximize signal‐to‐noise ratio (SNR) at most stations. We then calculated a set of waveform‐based features, most of which have been used in previous studies either on Piton de la Fournaise volcano (Hibert et al., 2014; Langet, 2014) or on other volcanoes (Falsaperla et al., 1996; Ohrnberger, 2000; Beyreuther and Wassermann, 2008; Cannata et al., 2011). We included both time‐ and frequency‐domain features, because a combination of the two domains has been found to produce more accurate and stable classifications (Scarpetta et al., 2005). Time‐domain features characterize the waveform shape. Examples include signal duration, various amplitude ratios, and two higher‐order statistical moments of the waveform envelopes. Frequency‐domain features characterize the frequency content of the waveforms. Examples include centroid frequency, energy in fixed frequency bands, and low‐order statistical moments of the frequency‐domain amplitude. Table 3 lists all the features we computed and their corresponding formulas.
Single‐ and Multiple‐Station Classifier Training
We trained RF classifiers (Breiman, 2001) for both single and multiple‐station datasets. An RF is an ensemble classifier that combines a large number of randomly initialized Decision‐Tree classifiers. It is stable with respect to noise in the training data and avoids overfitting. Compared to classification methods previously tested on Piton de la Fournaise—fuzzy logic used by Hibert et al. (2014) and support vector machines used by Langet (2014)—RFs have the advantage of estimating the relative importance of the features used during the training phase. We exploited the Scikit‐learn implementation of the RF classifier (Pedregosa et al., 2011, see Data and Resources) in developing our event classification strategy.
We trained an RF instance (see Appendix for parameterization used) on each station separately using all the features in Table 3 (see Fig. 3a). Because not all events in the catalog were recorded at all stations (the OVPF monitoring network evolved over time), we created a balanced catalog for each station by randomly sampling 500 recorded events for each class, with replacement for those classes with fewer than 500 events (see the Discussion section for the influence of this balancing step on classification scores). We weighted the events according to the reliability of the manual classification, giving events classified by analysts having at least three years continuous experience with manual classification twice the weight of those classified by less experienced ones. We randomly split the balanced dataset into a training set (80% of samples) and a test set (20% of samples), trained an RF classifier on the training set and evaluated its performance on the test set. We then selected the 10 most influential features for each station by exploiting the RF’s internal estimation of feature importance and re‐trained the RF instance on the same data using only these features. After training on the single stations, we trained multistation RF classifiers on all sets of three stations (see Fig. 3b): we created a feature set containing the 10 station‐specific features used by each single‐station RF, extracted new balanced datasets containing only events recorded at all the stations, and followed the same training procedure as for the single‐station classifications.
After examining the results of the multistation classifiers trained on all possible station sets from the OVPF monitoring network, we reduced the contributing stations to a subset of four (see Fig. 1 and Table 2): BOR (located at the summit), CIL (located to the northwest of the summit, outside of the main caldera), FJS and RVL (both located within the main caldera). This station choice maximized the time span of available training data and the geographical separation of stations while ensuring good SNRs for most types of volcanic events at Piton de la Fournaise.
The training strategy described above gave us eight different RF instances: one for each of the four selected stations and one for each three‐station combination. We evaluated the performance of each classifier in two ways: (1) by predicting the classifications of each RF’s test set and creating the corresponding confusion matrixes (see Fig. 6) and (2) by performing a fivefold cross validation on each RF’s dataset (to perform an N‐fold cross validation, the dataset is randomly split into N equal parts, and N classifiers are trained on N−1 of the parts and evaluated using the remaining part, leaving a different part out during each training run).
There are many standard scores that can be used to evaluate the performance of a classifier (accuracy, precision, recall, etc.), and it is possible to devise ad hoc scores to mimic the requirements of each classification problem. As OVPF needs to monitor earthquakes for volcano surveillance purposes, we devised a score that averages the recall of earthquake classes (summit, deep, local, regional, and teleseismic) and the precision of nonearthquake classes (rockfalls, T phases, sound waves). A recall value of 1.0 indicates that all the events in a class are correctly labeled by the classifier, and a precision value of 1.0 indicates that all the events labeled as belonging to a class by the classifier actually do belong to that class. We used this OVPF score in the fivefold cross validation described above and in the Training Results section below.
We visualized the ability of each feature to distinguish between event types using normalized histograms for each of the 40 features described in Table 3. Selected examples of these histograms are shown in Figure 4 for the OVPF stations we used to implement our classifier. At BOR (Fig. 4a), the signal duration feature (duration) discriminated clearly between summit and deep events on one side (shortest durations) and regional, teleseismic, or T‐phase events on the other (longest durations). At CIL (Fig. 4b), the ratio of signal duration to maximum amplitude feature (DurOverAmp) discriminated clearly between local and T‐phase events. At FJS (Fig. 4c), the centroid frequency feature (FCentroid) split the event types in three groups: teleseismic events on the low‐frequency side; local events, summit, and deep VT events and sound‐wave events on the high‐frequency side; regional events, T‐phases, and rockfalls in the center. At RVL (Fig. 4d), the median fast Fourier transform feature (MedianFFT) discriminated between teleseismic events (low values) and summit and deep events (high values) and also started to separate these two types of VT events.
The single‐station RF instances selected the 10 most discriminating features for each station (see the first four rows of Fig. 5). Of these, 2 or 3 per station were time‐domain features on the unfiltered traces (the most common were duration and duration‐to‐amplitude ratio), 2–5 were time‐domain features computed after filtering in different frequency bands (energy or kurtosis or both) and the rest were frequency‐domain features (the most common were the energy in different frequency quartiles and the centroid frequency).
We evaluated the efficacy of the single‐station RF classifiers using confusion matrixes such as those in Figure 6. Numerical versions of these matrixes and standard performance scores for each classifier can be found in the Ⓔ electronic supplement. The classifiers trained on the two stations installed in the main caldera (FJS and RVL) obtained higher scores than the two others, with fewer confusions between isolated T phases and teleseismic events or between rockfall events and deep VT events. All four classifiers confused some summit and deep VT events. The rate of this confusion was asymmetric at the summit station BOR, possibly due to the highly attenuating structure of the volcano cone.
The last four rows of Figure 5 show the 10 most relevant features selected by each of the three‐station RF instances. More features were retained from the stations with the best single‐station results: at most two features from BOR, three or four from CIL, four or five from FJS, and up to six from RVL. Nearly half of those selected were frequency‐domain features, and fewer than 20% were time‐domain features on the unfiltered traces. All three‐station classifiers retained a centroid frequency feature (either at FJS or RVL), a filter‐band kurtosis feature, and a feature involving the signal duration (either the duration itself or the duration‐to‐amplitude ratio).
The confusion matrixes and cross‐validation scores for the three‐station classifiers are shown in Figure 7 and in the Ⓔ electronic supplement. The OVPF scores for all station combinations were systematically higher than for the single‐station classifiers, and the two highest‐scoring combinations, BOR+CIL+FJS and BOR+CIL+RVL, both contained the two lowest‐scoring single stations, BOR and CIL. These two observations indicate that combining features calculated at different stations enhances their overall discriminating power and that ensuring a good geographical distribution of the stations seems to be important. Omitting either the summit station BOR or the out‐of‐caldera station CIL degrades the results: without CIL the classification of summit events worsens by ∼10% (more confusion with deep and rockfall events); without BOR the classification of deep events worsens by ∼10% (more confusion with summit events).
Operator‐Triggered Classification Routine
For operational use, a classification algorithm needs to be computationally efficient and require very few inputs from the operator. It also needs to be fully integrated in the observatory routine. We chose to integrate the classification module into the WebObs interface used at OVPF for all routine surveillance at Piton de la Fournaise volcano. We developed the module as a webservice, taking as inputs only the event start time and its duration. The module is activated the moment the EarthWorm detector or an operator sets the start time and duration of a seismic event on the WebObs detection and classification interface. It retrieves the required waveform data, calculates the appropriate features, and makes a classification prediction using a pretrained classifier.
Among the four three‐station classifiers, we selected the two best‐performing ones as prediction classifiers: BOR+CIL+FJS and BOR+CIL+RVL. Both these station combinations cover geographically separated locations that maximize the ability of the classifiers to perform correctly for events located anywhere on the volcano. They are also the main stations OVPF operators report using for manual detection and classification. FJS and RVL are both located within the Enclos Fouqué and at times environmental conditions on the volcano perturb data transmission from FJS. We request data for all four stations; if FJS data exist, then we run the BOR+CIL+FJS classifier, otherwise we run the BOR+CIL+RVL classifier.
The output of the classifier is given as a single JSON‐format message passed to the WebObs interface containing the list of probabilities for each of the classes (see Fig. 8 for some examples). The list allows the user to make an informed decision about the final classification of the event, to search for other indicators in case of similar probabilities between two or more classes, or to choose to class of the event as indeterminate if no single class stands out as more probable than the others.
DISCUSSION AND CONCLUSIONS
We implemented a multiclass automated classification strategy based on RF classifiers for use at the OVPF. It classes waveforms from eight distinct event types using features computed from waveform data from three geographically distributed seismic stations: one at the volcano summit, one in the main caldera at the foot of the summit cone, and one outside the caldera. The strategy applied in training the algorithm should be applicable to many other contexts, notably those in which a multistation approach seems necessary. Ours is the first automatic classification strategy to be installed operationally at OVPF. It will be maintained and distributed as a standalone open‐source application and as an optional module of the open‐source observatory management interface WebObs (see Data and Resources for download instructions).
We chose a standard set of physically meaningful features for this first version of our algorithm to enable the classifier to mimic the decision processes that the more experienced operators at OVPF follow when classifying the different event types. Certain classification studies on other volcanoes use more complex features: some are derived from waveform spectrograms (e.g., Falsaperla et al., 2005), and others are constructed specifically for simultaneous detection and classification on continuous data (e.g., Ohrnberger, 2000). Future versions of our algorithm will include spectrogram‐derived features, even though spectrograms are not currently presented to OVPF operators at the classification stage and polarization features.
Figure 5 shows that some features (e.g., duration or centroid frequency) were retained multiple times by the multistation classifiers. This may have resulted in feature redundancy and may have reduced the overall quantity of information available for the classification. One way of reducing this redundancy would be to combine features using principal‐component or linear‐discriminant analyses, both for single stations and station combinations. Either procedure should improve classification scores but might diminish human readability of the classification procedure. We shall include both procedures as options in future versions.
We found that multistation RF classifiers had significantly better performance than single‐station ones, so long as we also ensured a good geographical station distribution. Nearly all automated classifiers for volcanic contexts described in the literature are trained to work on a single station at a time, except for the neural network trained by Esposito et al. (2006), which uses five stations. One reason for this is to avoid having to weigh the contributions of the different stations, because these weighting schemes need to evolve with technical changes to the observing network (Langer et al., 2006). At Piton de la Fournaise, the complex internal structure of the volcano induces significant site effects at the seismic stations: some are affected by high attenuation, others by strong anisotropy, waveguide effects, or high‐density contrasts. A single VT event produces very dissimilar seismograms at stations within and outside the caldera (see Fig. 2) and may not be detectable at all at the summit stations. Under these conditions, a well‐chosen set of stations is required to ensure optimal recording of most event types. It is therefore reasonable to expect that a similar set of stations should also improve the performance of an automated classifier algorithm.
Good‐quality training of machine‐learning systems requires producing training sets that include all the feature variability contained in the full dataset. For datasets with highly unbalanced class populations such as the OVPF one (see Table 1), this variability is well ensured for the majority classes and much less so for the small ones. Classifiers trained on an unbalanced dataset can become highly biased toward the majority class and therefore generalize poorly. The balancing strategy we chose in the OVPF implementation took 500 random samples of each class to reduce the differences between the class populations. For classes with populations smaller than 500, sampling was performed with replacement. This placed multiple copies of the events from the smaller classes in both the training and test datasets and artificially increased the accuracies and the cross‐validation scores. RF classifiers are able to internally balance classes upon training by increasing the weight of the minority classes, inversely proportionally to their populations. We tested adopting an alternate balancing strategy and took 500 random samples of the large classes without modifying the smaller classes, then used the internal balancing capabilities of the RF classifier. We obtained a score of 44% for the worst performing single station (BOR) and a maximum score of 75% for the best three‐station combination (BOR+CIL+FJS). Figure 9a,b contains a comparison between the confusion matrixes of our original BOR+CIL+FJS classifier and one produced with the alternate balancing strategy. The majority of the accuracy loss occurred in the three smallest classes (regional, T‐phase, and sound waves), because not enough of the feature diversity for these classes could be represented in the training set, and therefore the classifier generalized poorly to unseen data. The VT summit and deep classes were also adversely affected, despite having the same number of samples under both sampling strategies. Interestingly, both precision and recall remained high (above 90%) for the teleseismic class, indicating that the values of its features are sufficiently different from those of the other classes that the RF could split off this class correctly, even with a small training sample. Given the strategic importance of correctly classifying VT events for a volcano observatory, we chose to stick to the sampling with replacement strategy for this first implementation of the OVPF‐automated classifier. As the quantity of data corresponding to the minority classes increases in the OVPF databases, we shall be able to migrate our implementation to the more standard, weight‐based balancing strategy.
Most published volcanic event classifiers attempt to directly classify four or fewer classes (Falsaperla et al., 1996; Scarpetta et al., 2005; Esposito et al., 2006; Masotti et al., 2006; Gutièrrez et al., 2009; Ibañez et al., 2009; Cannata et al., 2011; Bicego et al., 2013; Hibert et al., 2014). Exceptions are Langer et al. (2003, 2006) with six classes, and the Ph.D. theses of Ohrnberger (2000) and Langet (2014) with eight classes. Even though Decision Trees and RFs can natively perform multiclass classification without internally resorting to one‐against‐all or class‐voting strategies, increasing the number of classes requires a corresponding increase in the training set size, which can exacerbate the problems caused by unbalanced class populations. We would not wish to go beyond eight classes in the context of OVPF’s surveillance operations. In all the eight‐class confusion matrixes shown in this article, there seems to be a systematic confusion between the summit and deep VT events. As these events are defined only by their depth (the former occurring above and the latter below sea level), some degree of overlap is to be expected, and indeed most OVPF operators report difficulties in separating the two classes. Figure 9c confirms some confusion of the two VT classes, even in head‐to‐head classification. A recently studied scientific classification problem at the Piton de la Fournaise volcano is the separation between rockfall and summit events: both are shallow and occur in a similar region, yet are caused by very different physical processes tied to volcano dynamics (Hibert et al., 2014). In Figure 9d, we show the confusion matrix for a head‐to‐head classification of the rockfall and summit classes with our optimal three‐station classifier. It shows a 96% accuracy score, which compares favorably with the 92% obtained by Hibert et al. (2014) and Langet (2014) and is only marginally lower than the 99% obtained by Hibert et al. (unpublished manuscript, 2017; see Data and Resources) using 50% more features.
We implemented the first automated classifier to be installed at the OVPF.
It is a multiclass RF classifier trained on time‐ and frequency‐domain waveform features at a combination of three stations: one on the summit of Piton de la Fournaise, one in its caldera, and one on its flank.
Combining features from different stations into a single classifier allows us to compensate for the strong site effects present on the volcano.
DATA AND RESOURCES
The Piton de la Fournaise volcano observatory (OVPF) catalog is accessible through the OVPF WebObs interface (restricted access). We provide the full catalog referenced in this article as an Ⓔ electronic supplement (csv format). The waveform data for this article were accessed through the internal OVPF servers. All OVPF waveform data are in the process of being transferred to public webservice servers at the Institut de Physique du Globe de Paris (IPGP) datacenter (http://eida.ipgp.fr/fdsnws/, last accessed February 2017) and the Réseau Sismologique et Géodésique Français (RESIF) datacenter (http://ws.resif.fr/, last accessed February 2017), which both support the Federation of Digital Seismic Networks dataselect protocol. The code for this article was written in Python 2.7 and heavily exploits the Scikit‐learn package (v.0.17.0, http://scikit-learn.org/stable/, last accessed February 2017). We provide the outputs (classification reports and confusion matrixes) of the Random Forest learning stages in an Ⓔ electronic supplement. The WebObs package is freely available from https://github.com/IPGP/webobs (last accessed February 2017) and our classification code from https://github.com/eost/eqdiscrim (last accessed February 2017). The unpublished manuscript by C. Hibert, F. Profost, J.‐P. Malet, A. Maggi, V. Ferrazzini, and A. Stumpf (2017). “Automatic identification of seismic sources at the Piton de la Fournaise volcano using a random forests algorithm”, submitted to J. Volcanol. Geoth. Res.
This work was supported by the CNRS‐INSU Tellus‐ALEAS program. We thank the staff and students at Piton de la Fournaise volcano observatory (OVPF) for their kind hospitality and many stimulating discussions. We also thank Editor Zhigang Peng and three anonymous reviewers for their insightful comments.
Random Forest Parameterization
We parameterized the Scikit‐learn Random Forest (RF) as follows:
n_estimators = 100: Number of trees in forest.
criterion = ‘gini’: Function that measures split quality (Gini impurity).
max_features = ‘auto’: Number of features to consider when looking for the best split (if ‘auto,’ then use the square root of the number of features).
max_depth = None: The maximum depth of the tree. If ‘None,’ then nodes are expanded until all leaves are pure or until all leaves contain less than min_samples_split samples.
min_samples_split = 2: The minimum number of samples required to split an internal node.
min_samples_leaf = 1: The minimum number of samples in newly created leaves.
min_weight_fraction_leaf = 0.0: The minimum weighted fraction of the input samples required to be at a leaf node.
max_leaf_nodes = None: Grow trees with max_leaf_nodes in best‐first fashion. Best nodes are defined as relative reduction in impurity. If ‘None,’ then unlimited number of leaf nodes.
bootstrap = True: Whether bootstrap samples are used when building trees.
warm_start = False: When True, reuse the solution of the previous call to fit and add more estimators to the ensemble; otherwise, just fit a whole new forest.
class_weight = ‘balanced’: Weights associated with classes. The ‘balanced’ mode adjusts weights to be inversely proportional to class frequencies in the input data.