Created
November 6, 2020 17:44
-
-
Save BetterProgramming/cea84c0b348b509a550e1040d166253c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use a FOR loop for each file in 'model_out/' | |
for file in my_r_scripts /* | |
do | |
# Create a CASE statement for each file's contents | |
case $(cat $file) in | |
# Match on tree and non-tree models | |
*"Random Forest"*|*GBM*|*XGBoost*) | |
mv $file tree_models/ ;; | |
*KNN*|*Logistic*) | |
rm $file ;; | |
# Create a default | |
*) | |
echo "Unknown model in $file" ;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment