Memuat
Memuat
Random Forest Classification for Tourism and Hospitality
0 views
Classify hotel performance category from room rate and online review score with Random Forest and assess feature importance and accuracy. Random forest classification combines the votes of many trees trained on bootstrap samples and random feature subsets. It suits tabular classification needing stable accuracy with little tuning.

Classify hotel performance category from room rate and online review score with Random Forest and assess feature importance and accuracy.
| Role | Variable | Unit |
|---|---|---|
| Main | hotel performance category | - |
| Supporting 1 | room rate | Rp ribu |
| Supporting 2 | online review score | skor |
The random forest model classifies hotel performance category (low/high) from room rate and online review score with test accuracy 0.790, F1 0.755 and AUC 0.878.
Computed from illustrative synthetic data, not from a real study.
Random forest classification combines the votes of many trees trained on bootstrap samples and random feature subsets. It suits tabular classification needing stable accuracy with little tuning.
Report test metrics, the confusion matrix, and the most influential features. Include the OOB score or cross-validation to make accuracy claims more convincing.
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.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, f1_score, roc_auc_score, confusion_matrix, ConfusionMatrixDisplay
rng = np.random.default_rng(31)
n = 500
room_rate = rng.normal(0, 1, n)
online_review_score = rng.normal(0, 1, n)
x3 = rng.normal(0, 1, n)
hotel_performance_category = ((room_rate ** 2 + online_review_score + 0.3 * rng.normal(size=n)) > 0.8).astype(int)
X = np.column_stack([room_rate, online_review_score, x3])
X_tr, X_te, y_tr, y_te = train_test_split(X, hotel_performance_category, test_size=0.25, stratify=hotel_performance_category, random_state=31)
rf = RandomForestClassifier(n_estimators=300, oob_score=True, random_state=31)
rf.fit(X_tr, y_tr)
pred = rf.predict(X_te)
prob = rf.predict_proba(X_te)[:, 1]
print("OOB accuracy:", round(rf.oob_score_, 3))
print("Test accuracy:", round(accuracy_score(y_te, pred), 3))
print("F1:", round(f1_score(y_te, pred), 3), "AUC:", round(roc_auc_score(y_te, prob), 3))
print("Importance:", rf.feature_importances_.round(3))
cm = confusion_matrix(y_te, pred)
ConfusionMatrixDisplay(cm).plot()
plt.show()Choose how much help you need. Each higher package includes everything in the lower ones. Prices exclude 11% VAT.
Package 1
US$34
excl. 11% VAT
Duration: 7 working days
Output: Python files + result figures
Deliverables
Package 2 · most chosen
US$97
excl. 11% VAT
Duration: 13 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$213
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 Classification is commonly used at this level in Tourism and Hospitality. 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$34, Package 2 (your data analysis and interpretation) US$97 and Package 3 (full guidance) US$213, 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