Skip to main content
U.S. flag

An official website of the United States government

Model Cross Validation Software and Pipeline

Published by U.S. Geological Survey | Department of the Interior | Catalog Last Checked: August 01, 2026 at 04:37 AM | Dataset Last Updated: July 10, 2026 at 12:00 AM
This code base allows a user to provide a file of different configurations for running the Structural Topic Models, parallelizing its runs in Gitlab in a parallel matrix. The interim and final outputs are pushed to Artifactory for archival storage and distribution. Attached Files: - stm-summaries-main.zip, the zipped code base for the cross validation gitlab pipeline - Dockerfile, a document with instructions used to create a container image - stm-summaries-main-File Manifest.csv, a list of the files contained in the zip file and their purpose Running locally Note that these scripts are *primarily* provided for posterity purposes. To run these scripts locally, you must copy processed article files into the `1_initial_article_text_cleaning/tagged_articles/` folder, in the form of `.rds` files. See the "Data prep and modeling support" child on ScienceBase for more information on processing articles into the appropriate `.rds` format. Running in GitLab if you import this codebase as a project: - browse to the Pipelines -> Click New Pipeline - Select File for variable type and then paste in a chunk of yml similar to the one below: `seed:` is the seed used to provide replication capabilities `train_prop:` is the proportion of the data set that should be withheld for training versus testing the model `K:` is the # of topics to ask the model to fit, a value of 0 is treated as a signal to the stm model to use the algorithm of Lee and Minmo to determine the proper K value `prevalence:` is the formula for the stm to use for introducing covariates into the stm model run. Example: ~~~ .snippet: model_parameters: - seed: "20250514" train_prop: "0.75" K: "0" prevalence: "~ stm::s(quarter_ind) + water_quantity_ind + water_quality_ind + access_to_the_resource_ind + susceptibility_ind + coping_ind + exposure_ind + fire_ind + drought_ind + heat_ind + flood_ind + hab_ind" - seed: "20250514" train_prop: "0.75" K: "100" prevalence: "~ stm::s(quarter_ind) + water_quantity_ind + water_quality_ind + access_to_the_resource_ind + susceptibility_ind + coping_ind + exposure_ind + fire_ind + drought_ind + heat_ind + flood_ind + hab_ind"

Resources

2 resources available

Find Related Datasets

Search by Tags

Click any tag below to search for similar datasets

data.gov

An official website of the GSA's Technology Transformation Services

Looking for U.S. government information and services?
Visit USA.gov