Skip to content

Instantly share code, notes, and snippets.

@leohmoraes
Forked from BetterProgramming/tree.sh
Created November 7, 2020 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leohmoraes/835d7862aab633b9d40a9a85a9c7d03e to your computer and use it in GitHub Desktop.
Save leohmoraes/835d7862aab633b9d40a9a85a9c7d03e 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