Memuat
Memuat
Decision Tree for Electrical Engineering and Energy
0 views
Classify transformer condition using the features hydrogen gas and acetylene gas 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 transformer condition using the features hydrogen gas and acetylene gas with Decision Tree and assess its accuracy.
| Role | Variable | Unit |
|---|---|---|
| Main | Transformer condition | - |
| Supporting 1 | Hydrogen gas | ppm |
| Supporting 2 | Acetylene gas | ppm |
The decision tree model classifies Transformer condition (low/high) from Hydrogen gas and Acetylene gas with test accuracy 0.991, F1 0.991 and AUC 0.988. Tree depth is 4 with 10 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
hydrogen_gas = rng.normal(0, 1, n)
acetylene_gas = rng.normal(0, 1, n)
transformer_condition = ((hydrogen_gas > 0.2) & (acetylene_gas < 0.5)).astype(int)
flip = rng.random(n) < 0.05
transformer_condition[flip] = 1 - transformer_condition[flip]
X = np.column_stack([hydrogen_gas, acetylene_gas])
X_tr, X_te, y_tr, y_te = train_test_split(X, transformer_condition, test_size=0.3, stratify=transformer_condition, 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$16
excl. 11% VAT
Duration: 3 working days
Output: Python files + result figures
Deliverables
Package 2 · most chosen
US$47
excl. 11% VAT
Duration: 7 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$106
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 Electrical Engineering and Energy. 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$16, Package 2 (your data analysis and interpretation) US$47 and Package 3 (full guidance) US$106, 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