Memuat
Memuat
Random Forest (TreeBagger) for Geophysics and Seismology
0 views
Classify rock type with a random forest and assess the importance of the features gamma ray log and density log. TreeBagger builds a random forest from many bootstrapped decision trees and gives out-of-bag error and variable importance. It suits tabular classification or regression with nonlinear relations and interactions.

Classify rock type with a random forest and assess the importance of the features gamma ray log and density log.
| Role | Variable | Unit |
|---|---|---|
| Main | Rock type | - |
| Supporting 1 | Gamma ray log | API |
| Supporting 2 | Density log | g/cm³ |
A 60-tree random forest predicts the class of Rock type with an OOB error of 0.129 and test accuracy of 0.844 (macro F1 0.841); Gamma ray log and Density log prove far more important than the two noise predictors.
Computed from illustrative synthetic data, not from a real study.
TreeBagger builds a random forest from many bootstrapped decision trees and gives out-of-bag error and variable importance. It suits tabular classification or regression with nonlinear relations and interactions.
Report the OOB error, test accuracy, and the most important variables. Explain that importance reflects predictive contribution, not causation.
A short starting script with this project's variable names. The delivered version is adapted to your data and fully commented.
rng(7);
n = 500;
gamma_ray_log = randn(n, 1);
density_log = randn(n, 1);
x3 = randn(n, 1);
X = [gamma_ray_log density_log x3];
rock_type = double(gamma_ray_log.^2 + density_log + 0.3*randn(n, 1) > 0.8);
cv = cvpartition(rock_type, 'HoldOut', 0.25);
Xtr = X(training(cv), :); ytr = rock_type(training(cv));
Xte = X(test(cv), :); yte = rock_type(test(cv));
b = TreeBagger(200, Xtr, ytr, 'Method', 'classification', ...
'OOBPrediction', 'on', 'OOBPredictorImportance', 'on', 'MinLeafSize', 3);
pred = str2double(predict(b, Xte));
fprintf('OOB error = %.3f\n', oobError(b, 'Mode', 'ensemble'));
fprintf('Test accuracy = %.3f\n', mean(pred == yte));
disp(confusionmat(yte, pred));
disp(b.OOBPermutedPredictorDeltaError);
figure;
subplot(1,2,1); plot(oobError(b)); xlabel('Number of trees'); ylabel('OOB error');
subplot(1,2,2); bar(b.OOBPermutedPredictorDeltaError);
set(gca, 'XTickLabel', {'x1', 'x2', 'x3'}); ylabel('Importance');Choose how much help you need. Each higher package includes everything in the lower ones. Prices exclude 11% VAT.
Package 1
US$38
excl. 11% VAT
Duration: 7 working days
Output: MATLAB files + result figures
Deliverables
Package 2 · most chosen
US$109
excl. 11% VAT
Duration: 13 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$244
excl. 11% VAT
Duration: 18-21 working days
Output: Code + analysis + guidance until ready to present
Includes all of Packages 1 & 2, plus
Yes. Random Forest (TreeBagger) is commonly used at this level in Geophysics and Seismology. 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 MATLAB 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$38, Package 2 (your data analysis and interpretation) US$109 and Package 3 (full guidance) US$244, excluding 11% VAT. Larger datasets, extra methods or tight deadlines adjust the quote after a short consultation.
The result sheet uses illustrative synthetic data. MATLAB is a trademark of The MathWorks, Inc.
Back to MATLAB portfolio