Memuat
Memuat
Decision Tree for Fisheries and Marine Science
0 views
Classify reef health category using the features live coral cover and turbidity with Decision Tree and assess its accuracy. A decision tree recursively splits the data with if-then rules that are easy to read and visualise. It suits classification whose results must be explained as rules to non-technical readers.

Classify reef health category using the features live coral cover and turbidity with Decision Tree and assess its accuracy.
| Role | Variable | Unit |
|---|---|---|
| Main | Reef health category | - |
| Supporting 1 | Live coral cover | % |
| Supporting 2 | Turbidity | NTU |
The decision tree model classifies Reef health category (low/high) from Live coral cover and Turbidity with test accuracy 0.876, F1 0.879 and AUC 0.896. Tree depth is 4 with 12 leaves.
Computed from illustrative synthetic data, not from a real study.
A decision tree recursively splits the data with if-then rules that are easy to read and visualise. It suits classification whose results must be explained as rules to non-technical readers.
Show the tree diagram and translate its main branches into meaningful rules, together with test accuracy. Mention that a single tree is less stable than ensembles.
A short starting script with this project's variable names. The delivered version is adapted to your data and fully commented.
import numpy as np
import matplotlib.pyplot as plt
from sklearn.tree import DecisionTreeClassifier, plot_tree, export_text
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, f1_score
rng = np.random.default_rng(21)
n = 300
live_coral_cover = rng.normal(0, 1, n)
turbidity = rng.normal(0, 1, n)
reef_health_category = ((live_coral_cover > 0.2) & (turbidity < 0.5)).astype(int)
flip = rng.random(n) < 0.05
reef_health_category[flip] = 1 - reef_health_category[flip]
X = np.column_stack([live_coral_cover, turbidity])
X_tr, X_te, y_tr, y_te = train_test_split(X, reef_health_category, test_size=0.3, stratify=reef_health_category, random_state=21)
tree = DecisionTreeClassifier(max_depth=3, min_samples_leaf=5, random_state=21)
tree.fit(X_tr, y_tr)
pred = tree.predict(X_te)
print("Accuracy:", round(accuracy_score(y_te, pred), 3))
print("F1:", round(f1_score(y_te, pred), 3))
print("Importance:", tree.feature_importances_.round(3))
print(export_text(tree, feature_names=["x1", "x2"]))
plt.figure(figsize=(9, 5))
plot_tree(tree, feature_names=["x1", "x2"], class_names=["0", "1"], filled=True)
plt.show()Choose how much help you need. Each higher package includes everything in the lower ones. Prices exclude 11% VAT.
Package 1
US$19
excl. 11% VAT
Duration: 3 working days
Output: Python files + result figures
Deliverables
Package 2 · most chosen
US$56
excl. 11% VAT
Duration: 7 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$122
excl. 11% VAT
Duration: 12-15 working days
Output: Code + analysis + guidance until ready to present
Includes all of Packages 1 & 2, plus
Yes. Decision Tree is commonly used at this level in Fisheries and Marine Science. We adapt the analysis to your research question, your own data and your supervisor's requirements.
No. The sheet is computed from illustrative synthetic data so you can see the kind of output Python gives. For your order we run the same method on your own data.
That is the point of the packages. Every script is commented, and Package 3 includes two coaching sessions plus practice questions so you can explain the method and the results at your seminar and defence.
Each project has three packages: Package 1 (code and explanation) US$19, Package 2 (your data analysis and interpretation) US$56 and Package 3 (full guidance) US$122, excluding 11% VAT. Larger datasets, extra methods or tight deadlines adjust the quote after a short consultation.
The result sheet uses illustrative synthetic data. Python is a trademark of the Python Software Foundation.
Back to Python portfolio