Spring 22
Implemented Decision tree algorithm from scratch for training and testing on distributed systems [AWS] using MapReduce framework. Dataset used for training is about 1.35GB and 600MB for testing. Used 'Reduction by variance' technique to decide the best splits for decision tree.
Dheeraj Gadwala, Savitha Munirajaiah, Shreya Singh
These components are installed:
- OpenJDK 14
- Hadoop 2.9.1
- Maven
- AWS CLI (for EMR execution)
-
Example ~/.bash_aliases: export JAVA_HOME="/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home"
export HADOOP_HOME="/Users/shreyasingh/hadoop2.10/hadoop-2.10.1"
export YARN_CONF_DIR=$HADOOP_HOME/etc/hadoop
export PYENV_ROOT="$HOME/.pyenv"
export PATH=$JAVA_HOME/bin:/Users/shreyasingh/apache-maven3.8.4/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$SCALA_HOME/bin:$SPARK_HOME/bin:$PYENV_ROOT/bin:/opt/homebrew/bin:$PATH -
Explicitly set JAVA_HOME in $HADOOP_HOME/etc/hadoop/hadoop-env.sh:
export JAVA_HOME="/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home"
All of the build & execution commands are organized in the Makefile.
-
Unzip project file.
-
Open command prompt.
-
Navigate to directory where project files unzipped.
-
Edit the Makefile to customize the environment at the top. Sufficient for standalone: hadoop.root, jar.name, local.input Other defaults acceptable for running standalone.
-
Standalone Hadoop: make switch-standalone -- set standalone Hadoop environment (execute once) make local
-
AWS EMR Hadoop: (you must configure the emr.* config parameters at top of Makefile)
make upload-input-aws-TrainTest -- only before first execution
make aws-train -- check for successful execution with web interface (aws.amazon.com)
make download-output-aws -- after successful execution download the split file
run ReadSplitsBeforeBroadcast locally
make upload-input-aws-broadcastSplits --upload broadcasted split files
for testing:change to DecisionTreeTest in main
make aws-test --run jar for testing
- Configure training dataset and run the DecisionTree.java to start training the model.
- The trained decision tree model is stored in splits folder.
- Locally run ReadSplitsBeforeBroadcast.java class.
- Output from step 3 with the test dataset is used to run the DecisionTreeTest.java job.
- The Accuracy of the model is printed in system.out.