Memuat
Memuat
Feature Selection with Lasso for Tourism and Hospitality
0 views
Select the indicators most influential on tour package sales in travel agencies, including advertising budget and package discount, using the Lasso penalty. Feature selection with Lasso uses an L1 penalty so that coefficients of unimportant features become exactly zero. It suits cases with many predictors where the researcher wants a compact variable subset for the final model.

Select the indicators most influential on tour package sales in travel agencies, including advertising budget and package discount, using the Lasso penalty.
| Role | Variable | Unit |
|---|---|---|
| Main | tour package sales | Rp juta |
| Supporting 1 | advertising budget | Rp juta |
| Supporting 2 | package discount | % |
Lasso selects 9 of 10 predictors for tour package sales (alpha 0.005) with a test R2 of 0.946; 100% of the truly relevant predictors were recovered.
Computed from illustrative synthetic data, not from a real study.
Feature selection with Lasso uses an L1 penalty so that coefficients of unimportant features become exactly zero. It suits cases with many predictors where the researcher wants a compact variable subset for the final model.
Report the best alpha, the list of selected features, and the error compared with the full model. Note that selection indicates predictive usefulness, not causation.
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.linear_model import LassoCV, lasso_path, LinearRegression
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
rng = np.random.default_rng(23)
n, p = 200, 20
X = rng.normal(size=(n, p))
advertising_budget = X[:, 0]
package_discount = X[:, 1]
tour_package_sales = 4 * advertising_budget - 3 * package_discount + 2 * X[:, 2] + rng.normal(0, 1, n)
X_tr, X_te, y_tr, y_te = train_test_split(X, tour_package_sales, test_size=0.25, random_state=23)
sc = StandardScaler().fit(X_tr)
Xs_tr, Xs_te = sc.transform(X_tr), sc.transform(X_te)
lasso = LassoCV(cv=5, random_state=23).fit(Xs_tr, y_tr)
sel = np.flatnonzero(lasso.coef_)
print("Best alpha:", round(lasso.alpha_, 4))
print("Selected features:", sel)
rmse_full = mean_squared_error(y_te, LinearRegression().fit(Xs_tr, y_tr).predict(Xs_te)) ** 0.5
rmse_sel = mean_squared_error(y_te, LinearRegression().fit(Xs_tr[:, sel], y_tr).predict(Xs_te[:, sel])) ** 0.5
print("RMSE full:", round(rmse_full, 3), "RMSE selected:", round(rmse_sel, 3))
alphas, coefs, _ = lasso_path(Xs_tr, y_tr)
plt.plot(np.log10(alphas), coefs.T)
plt.axvline(np.log10(lasso.alpha_), color="k", ls="--")
plt.xlabel("log10(alpha)"); plt.ylabel("Coefficient")
plt.show()Choose how much help you need. Each higher package includes everything in the lower ones. Prices exclude 11% VAT.
Package 1
US$22
excl. 11% VAT
Duration: 5 working days
Output: Python files + result figures
Deliverables
Package 2 · most chosen
US$59
excl. 11% VAT
Duration: 9 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$131
excl. 11% VAT
Duration: 14-17 working days
Output: Code + analysis + guidance until ready to present
Includes all of Packages 1 & 2, plus
Yes. Feature Selection with Lasso 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$22, Package 2 (your data analysis and interpretation) US$59 and Package 3 (full guidance) US$131, 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