OPEN-ARC Open Models
Collection
A collection of available base models for our OPEN-ARC project: https://github.com/Infinitode/OPEN-ARC.
•
8 items
•
Updated
Repository: https://github.com/Infinitode/OPEN-ARC/
OPEN-ARC-PSP is a straightforward XGBClassifier model developed as part of Infinitode's OPEN-ARC initiative. It was designed to potentially identify plants experiencing high stress caused by external factors.
Architecture:
n_estimators=100, learning_rate=0.1, max_depth=6, subsample=0.8, colsample_bytree=0.8, random_state=42.Timestamp and Plant_ID. Stress levels were manually mapped to three distinct numerical values.| Metric | Value |
|---|---|
| Testing Accuracy | 99.1% |
| Testing Weighted Average Precision | 99% |
| Testing Weighted Average Recall | 99% |
| Testing Weighted Average F1 | 99% |
import random
def test_random_samples(model, X_test, y_test, n_samples=5):
"""
Selects random samples from the test set, makes predictions, and compares with actual values.
Parameters:
- model: Trained XGBoost classifier.
- X_test: Feature set for testing.
- y_test: True labels for testing.
- n_samples: Number of random samples to test.
Returns:
None
"""
# Convert X_test and y_test to DataFrame for easier indexing
X_test_df = X_test.reset_index(drop=True)
y_test_df = y_test.reset_index(drop=True)
# Pick random indices
random_indices = random.sample(range(len(X_test)), n_samples)
print("Testing on Random Samples:")
for idx in random_indices:
sample = X_test_df.iloc[idx]
true_label = y_test_df.iloc[idx]
# Predict using the model
prediction = model.predict(sample.values.reshape(1, -1))
# Reverse the health mapping
reverse_health_mapping = {v: k for k, v in health_mapping.items()}
# Map true and predicted labels
true_label_description = reverse_health_mapping[true_label]
predicted_label_description = reverse_health_mapping[prediction[0]]
# Output results
print(f"Sample Index: {idx}")
print(f"Features: {sample.values}")
print(f"True Label: {true_label}, Predicted Label: {prediction[0]}")
print(f"True Label (Description): {true_label_description}, Predicted Label (Description): {predicted_label_description}")
print("-" * 40)
# Example usage
test_random_samples(xgb, X_test, y_test)
For questions or issues, open a GitHub issue or reach out at https://infinitode.netlify.app/forms/contact.