Memuat
Memuat
Random Forest (TreeBagger) for Naval Architecture and Ocean Engineering
0 views
Predict daily fuel consumption from service speed and wave height using Random Forest (TreeBagger) and assess model performance. 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.

Predict daily fuel consumption from service speed and wave height using Random Forest (TreeBagger) and assess model performance.
| Role | Variable | Unit |
|---|---|---|
| Main | Daily fuel consumption | ton/hari |
| Supporting 1 | Service speed | knot |
| Supporting 2 | Wave height | m |
A 60-tree random forest predicts the class of Daily fuel consumption with an OOB error of 0.038 and test accuracy of 0.967 (macro F1 0.961); Service speed and Wave height 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;
service_speed = randn(n, 1);
wave_height = randn(n, 1);
x3 = randn(n, 1);
X = [service_speed wave_height x3];
daily_fuel_consumption = double(service_speed.^2 + wave_height + 0.3*randn(n, 1) > 0.8);
cv = cvpartition(daily_fuel_consumption, 'HoldOut', 0.25);
Xtr = X(training(cv), :); ytr = daily_fuel_consumption(training(cv));
Xte = X(test(cv), :); yte = daily_fuel_consumption(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$41
excl. 11% VAT
Duration: 7 working days
Output: MATLAB files + result figures
Deliverables
Package 2 · most chosen
US$113
excl. 11% VAT
Duration: 13 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$250
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 Naval Architecture and Ocean Engineering. 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$41, Package 2 (your data analysis and interpretation) US$113 and Package 3 (full guidance) US$250, 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