This repository contains a machine learning model that classifies almond types based on various geometric features of the almonds. The model is trained using a dataset of almond images and their corresponding features, including length, width, thickness, area, perimeter, and other derived features.
Model Details
Model Type: Ensemble model using CatBoostClassifier, RandomForestClassifier, XGBClassifier, and LGBMClassifier.
Input Features:
Length (major axis)
Width (minor axis)
Thickness (depth)
Area
Perimeter
Roundness
Solidity
Compactness
Aspect Ratio
Eccentricity
Extent
Convex Hull (Convex Area)
Output: Predicted almond type.
Files in This Repository
almond_classifier.pkl: The trained model file.
label_encoder.pkl: Label encoder used to encode the almond types.
README.md: This file.
How to Use
label_encoder = joblib.load("label_encoder.pkl")
Make Predictions:
Prepare your feature input as a DataFrame or a NumPy array with the correct order of features, and then:
python
Copy code
almond_features = [[...]] # Replace with actual features
predictions = model.predict(almond_features)
almond_type = label_encoder.inverse_transform(predictions)
print(f"Predicted Almond Type: {almond_type}")
Dataset
The model was trained on a dataset of almond images, with the features extracted from the images. The dataset contains measurements of various almond types, which served as the basis for training the classifier.
License
This project is licensed under the MIT License. You are free to use, modify, and distribute this software.
Contact
For questions or inquiries, feel free to contact me through my Hugging Face profile.