Skip to content

BigelowLab/pspforecast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pspforecast

Shellfish toxicity (PSP) forecast serving package

For the current 2025 Maine PSP predictions, click here

Requirements

Installation

remotes::install_github("BigelowLab/pspforecast")

Reading the forecast database

Variables:

  • version - the version/configuration of the model used to make the prediction

  • ensemble_n - number of ensemble members used to generate prediction

  • location - the sampling station the forecast is for

  • date - the date the forecast was made on

  • name - site name

  • lat - latitude

  • lon - longitude

  • class_bins - the bins used to classify shellfish total toxicity (i.e. 0: 0-10, 1: 10-30, 2: 30-80, 3: >80)

  • forecast_date - the date the forecast is valid for (i.e. one week ahead of when it was made)

  • predicted_class - the predicted classification at the location listed on the forecast_date (in this case 0-3)

  • p_0 - class 0 probability

  • p_1 - class 1 probability

  • p_2 - class 2 probability

  • p_3 - class 3 probability

  • p3_sd - class 3 probability standard deviation

  • p_3_min - class 3 minimum probability (from ensemble run)

  • p_3_max - class 3 maximum probability (from ensemble run)

  • predicted_class - the predicted classification

2025 Results

predictions <- read_forecast(year = "2025")

Metrics

  • tp - The model predicted class 3 and the following week’s measurement was class 3
  • fp - The model predicted class 3 and the following week’s measurement was not class 3
  • tn - The model predicted class 0,1,2 and the following week’s measurement was in class 0,1,2
  • fn - The model predicted class 0,1,2 and the following week’s measurement was class 3
  • accuracy - Measure of how many correct classifications were predicted
  • cl_accuracy - Considering predictions are those that correctly predicted toxicity above or below the closure limit or not
  • precision - TP/(TP+FP)
  • sensitivity - TP/(TP+FN)
  • specificity - TN/(TN+FP)
  • f_1
## # A tibble: 1 × 10
##      tp    fp    tn    fn accuracy cl_accuracy   f_1 precision sensitivity specificity
##   <int> <int> <int> <int>    <dbl>       <dbl> <dbl>     <dbl>       <dbl>       <dbl>
## 1    28    19   175    16    0.622       0.853 0.615     0.596       0.636       0.902

2024 Season Results

predictions <- read_forecast(year = "2024")

Metrics

  • tp - The model predicted class 3 and the following week’s measurement was class 3
  • fp - The model predicted class 3 and the following week’s measurement was not class 3
  • tn - The model predicted class 0,1,2 and the following week’s measurement was in class 0,1,2
  • fn - The model predicted class 0,1,2 and the following week’s measurement was class 3
  • accuracy - Measure of how many correct classifications were predicted
  • cl_accuracy - Considering predictions are those that correctly predicted toxicity above or below the closure limit or not
  • precision - TP/(TP+FP)
  • sensitivity - TP/(TP+FN)
  • specificity - TN/(TN+FP)
  • f_1
## # A tibble: 1 × 10
##      tp    fp    tn    fn accuracy cl_accuracy   f_1 precision sensitivity specificity
##   <int> <int> <int> <int>    <dbl>       <dbl> <dbl>     <dbl>       <dbl>       <dbl>
## 1     2     4   397     7    0.717       0.973 0.267     0.333       0.222       0.990

2023 Season Results

predictions <- read_forecast(year = "2023")

Confusion Matrix

Probability of Closure-level Toxicity vs Measured Toxicity

Metrics

## # A tibble: 1 × 10
##      tp    fp    tn    fn accuracy cl_accuracy   f_1 precision sensitivity specificity
##   <int> <int> <int> <int>    <dbl>       <dbl> <dbl>     <dbl>       <dbl>       <dbl>
## 1     0     0   550     0    0.993           1   NaN       NaN         NaN           1

2022 Season Results

Confusion Matrix

Probability of Closure-level Toxicity vs Measured Toxicity

Metrics

## # A tibble: 1 × 10
##      tp    fp    tn    fn accuracy cl_accuracy   f_1 precision sensitivity specificity
##   <int> <int> <int> <int>    <dbl>       <dbl> <dbl>     <dbl>       <dbl>       <dbl>
## 1    16    20   603    12    0.799       0.951   0.5     0.444       0.571       0.968

Timing of initial closure-level predictions

2021 Season Results

Confusion Matrix

Probability of Closure-level Toxicity vs Measured Toxicity

Metrics

## # A tibble: 1 × 10
##      tp    fp    tn    fn accuracy cl_accuracy   f_1 precision sensitivity specificity
##   <int> <int> <int> <int>    <dbl>       <dbl> <dbl>     <dbl>       <dbl>       <dbl>
## 1     2     3   463     0    0.938       0.994 0.571       0.4           1       0.994

Closure-level accuracy

Timing of initial closure-level predictions

Possible manuscript plot(s)

Last Updated

## [1] "2025-06-18"

About

Maine shellfish toxicity forecast serving package

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages