aaa aaa
This project demonstrates a K-Nearest Neighbors (KNN) classifier for the Iris dataset. The application allows users to:
- Tune the hyperparameter
k
(number of neighbors). - Evaluate the model's performance (accuracy and balanced accuracy).
- Predict the iris species based on user-provided input.
- Hyperparameter tuning for KNN (
k
selection). - Model training and evaluation.
- Console-based user input for custom predictions.
- Performance metrics: Accuracy and Balanced Accuracy.
Ensure you have the following installed:
- Python 3.x
- pandas
- scikit-learn
- Clone the repository:
git clone https://github.com/yourusername/CAU-AID-Class.git
- Navigate to the project directory:
cd CAU-AID-Class
- Install required libraries:
pip install pandas scikit-learn
- Ensure the
iris.csv
dataset is available in the project directory.
- Run the script:
python knn_iris_classifier.py
- Enter the number of neighbors (
k
) when prompted. - View the model's accuracy and balanced accuracy in the console.
- Input
sepal.length
andpetal.length
in the formatvalue1, value2
to predict the iris species.
Enter the number of neighbors (k) for KNN: 3
Model Accuracy: 0.96
Balanced Accuracy: 0.95
Enter the sepal.length and petal.length for the iris in the format 'sepal_length,petal_length': 5.1,1.8
Predicted Label: Virginica
- Ensure that the input for predictions is numeric and follows the correct format (value1, value2).
- Modify the dataset loading path in the script if necessary.
This project is licensed under the MIT License.
Developed by 배동혁