This repository contains a Python notebook demonstrating a simple image classification task using a Support Vector Machine (SVM) classifier. The TensorFlow "cats_vs_dogs" dataset is utilized for training and testing. To address potential memory issues, a percentage of the dataset is loaded, and images are resized and flattened on-the-fly to reduce memory consumption. Hyperparameter optimization is performed using random search with cross-validation. The SVM model is trained, and its accuracy is evaluated on a test set.
- Python 3.x
- TensorFlow
- TensorFlow Datasets
- scikit-learn
- OpenCV (opencv-python)
Install dependencies using (if not installed):
pip install tensorflow tensorflow-datasets scikit-learn opencv-python
-
Clone the repository:
git clone https://github.com/dipeshbabu/PRODIGY_ML_03.git
-
Navigate to the project directory:
cd PRODIGY_ML_03
-
Run the notebook:
jupyter notebook PRODIGY_ML_03.ipynb
Make sure to run the notebook in an environment that supports GPU acceleration for faster execution.
- Adjust the percentage of the dataset loaded in the
split
argument oftfds.load
based on your available memory. - Modify hyperparameter ranges and distribution in the
param_dist
dictionary for random search in the code based on your experimentation.