Skip to content
Soil saturated hydraulic conductivity (Ksat) models and analysis.
R
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Saturated Hydraulic Conductivity Pedotransfer

Lab Website Twitter

This repository contains machine learning based Pedotransfer models that predict saturated hydraulic conductivity (Ks) including the training data and all R scripts used to build the models. Detailed description of this work is available in our paper: Araya and Ghezzehei (2019).

Summaries of data preparation procedures for the machine learning from the USKSAT data is found here. Summary report of analysis we did on the partial effect of bulk density and organic carbon concentration on Ks is found here.

Running Pedotransfer App

I have developed an app with GUI based on shiny. To run the app locally is easy with RStudio editor:

  1. Download the ptfapp folder and all it's contents. Download the models from UC Merced Dash and save inptf/Models folder. (If you prefer not to download all of the models, download only the ones you want from.)
  2. Open the RStudio project file ptfapp.Rproj in your machine. Open the ui.R script in your RStudio editor; RStudio will recognize the Shiny script and provide a Run App button (at the top of the editor).
  3. Before running the app for the first time, you may need to install the required R packages by running the following codes in the R console.
# Shiny packages
install.packages("shiny")
install.packages("shinyjs")
install.packages("htmltools")
# Machine learning related packages
install.packages("caret")
install.packages("gbm")
# Table manipulation packages
install.packages("DT")
install.packages("dplyr")
install.packages("readr")

Repository Contents

Running Models Using Script

You can run the models to predict the saturated hydraulic conductivity of soils using the Predict_Ksat.R script (See a sample run of the Predict_Ksat.R here ). To run the models in your machine:

  1. Download at least these five items (save them in the same directory, check scripts to fix file locatoins in your machine.):
  1. Fill and save the Soil_Variables_Template.csv table with your soil variables.
  2. Modify lines 22 to 27 in the Predict_Ksat.R as needed.

For the prediction to run on your machine, you must have the caret package and either gbm or randomForest packages installed depending on whether you are using the BRT or the RF models. You should be able to install the packages prior to running Predict_Ksat.R as follows.

install.packages('caret', repos = 'https://cran.r-project.org')
install.packages('gbm', repos = 'https://cran.r-project.org')
install.packages('randomForest', repos = 'https://cran.r-project.org')

License

This work is licensed under a Creative Commons Attribution 4.0 International License. - see the LICENSE.md file for details

You can’t perform that action at this time.