Skip to content

Instantly share code, notes, and snippets.

@BetterProgramming
Created November 6, 2020 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save BetterProgramming/cea84c0b348b509a550e1040d166253c to your computer and use it in GitHub Desktop.
Save BetterProgramming/cea84c0b348b509a550e1040d166253c to your computer and use it in GitHub Desktop.
# 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