A Machine Learning project written with Python in Jupyter Notebook to instruct Zumi to classify two objects using the k-NN and Logistic Regression algorithms.
Zumi Website: https://www.robolink.com/products/zumi
This project trains Zumi with a soft toy
and plastic cup
.
Download all files and follow instructions in the Juypter Notebook file (zumi-final-code.ipynb
)
The project can be run two different ways to classify objects:
- Classify obstacles without noise
- Classify obstacles with noise
-
Under Data Collection - collect data without noise, run the first cell.
-
DO NOT run the cells under Data Augmentation - collect data with noise.
-
Under Storing & Visualizing Data, run the first cell to visualize the data points.
-
Under Plotting Data, run both cells to visualize the data on a 2D and 3D graph.
-
Under Implementing & Training k-NN and Logistic Regression, run both code cells to train the machine learning models.
-
Run the code cell under Hyperparameter Tuning to determine the best value for
k
. -
Run the code cell under Confusion Matrix to generate a confusion matrix for each model.
-
Under Cross-Validation with cross_val_score, run the cell to implement k-fold cross validation.
-
The section under Real-time Decision Making allows Zumi to react in real-time to a classified object.
a. Place Zumi in front of an object (i.e. a soft toy, plastic cup, or any other object you wish to classify).
b. Run the first cell to define the
react_to_obstacle
function.c. Run the second cell to define the
classify_obstacle
function - this function will classify the object. -
Run the cell under Evaluation to check the accuracy of the k-NN and Logistic Regression models.
-
Under Data Collection, run the first and second cells of code.
-
DO NOT run the cells under Data Collection - collect data without noise.
-
Only run the first cell (image below) under Data Augmentation - collect data with noise. DO NOT run the second cell.
-
Under Storing & Visualizing Data, run the first cell to visualize the data points.
-
Under Plotting Data, run both cells to visualize the data on a 2D and 3D graph.
-
Under Implementing & Training k-NN and Logistic Regression, run both code cells to train the machine learning models.
-
Run the code cell under Hyperparameter Tuning to determine the best value for
k
. -
Run the code cell under Confusion Matrix to generate a confusion matrix for each model.
-
Under Cross-Validation with cross_val_score, run the cell to implement k-fold cross validation.
-
The section under Real-time Decision Making allows Zumi to react in real-time to a classified object.
a. Place Zumi in front of an object (i.e. a soft toy, plastic cup, or any other object you wish to classify).
b. Run the first cell to define the
react_to_obstacle
function.c. Run the second cell to define the
classify_obstacle
function - this function will classify the object. -
Run the cell under Evaluation to check the accuracy of the k-NN and Logistic Regression models.
NOTE: You will need a fully operational Zumi to gather sensor reading data for this section.
The project can be run two different ways to collect data points for classifying objects:
- Collect data points without adding noise.
- Collect data points with augmentation (add noise).
-
Under Data Collection, run the first and second cells of code.
-
Under Data Collection - collect data without noise, run the first cell of code.
-
DO NOT run the first cell under Data Augmentation - collect data with noise.
-
ONLY Run the second cell and follow the instructions:
NOTE: Place Zumi in front of an obstacle (either a
soft toy
orplastic cup
) to collect sensor readings. -
Repeat Step 4 until you have the desired amount of data points.
-
After Data Collection is complete, execute the rest of the code cells in the notebook (as described in the sections above).
-
Under Data Collection, run the first and second cells of code.
-
DO NOT run the cell under Data Collection - collect data without noise.
-
Run the first cell under Data Augmentation - collect data with noise.
-
Then, run the second cell and follow the instructions:
NOTE: Place Zumi in front of an obstacle (either a
soft toy
orplastic cup
) to collect sensor readings. -
Repeat Step 4 until you have the desired amount of data points.
-
After Data Collection is complete, execute the rest of the code cells in the notebook (as described in the sections above).