Memuat
Memuat
Support Vector Machine for Marketing and Consumer Behaviour
0 views
Apply Support Vector Machine to synthetic data to classify customer repurchase decisions from satisfaction and visit frequency and assess its accuracy. A Support Vector Machine finds the separating hyperplane with the largest margin, and kernels allow nonlinear decision boundaries. It suits classification with small to medium data and high-dimensional features.

Apply Support Vector Machine to synthetic data to classify customer repurchase decisions from satisfaction and visit frequency and assess its accuracy.
| Role | Variable | Unit |
|---|---|---|
| Main | Repurchase decision | - |
| Supporting 1 | Satisfaction score | skala 1-5 |
| Supporting 2 | Visit frequency | kali/bulan |
The RBF-kernel SVM model classifies Repurchase decision (low/high) from Satisfaction score and Visit frequency with test accuracy 0.871, F1 0.877 and AUC 0.915. It uses 50 support vectors.
Computed from illustrative synthetic data, not from a real study.
A Support Vector Machine finds the separating hyperplane with the largest margin, and kernels allow nonlinear decision boundaries. It suits classification with small to medium data and high-dimensional features.
Report the kernel, best parameters, test metrics, and the number of support vectors. Explain that the model is a black box, so feature interpretation is limited.
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.svm import SVC
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import make_pipeline
from sklearn.model_selection import GridSearchCV, train_test_split
from sklearn.metrics import accuracy_score, f1_score
rng = np.random.default_rng(41)
n = 300
satisfaction_score = rng.normal(0, 1, n)
visit_frequency = rng.normal(0, 1, n)
repurchase_decision = ((satisfaction_score ** 2 + visit_frequency ** 2) > 1.2).astype(int)
X = np.column_stack([satisfaction_score, visit_frequency])
X_tr, X_te, y_tr, y_te = train_test_split(X, repurchase_decision, test_size=0.25, stratify=repurchase_decision, random_state=41)
pipe = make_pipeline(StandardScaler(), SVC(kernel="rbf"))
grid = {"svc__C": [0.1, 1, 10, 100], "svc__gamma": [0.01, 0.1, 1]}
gs = GridSearchCV(pipe, grid, cv=5).fit(X_tr, y_tr)
pred = gs.predict(X_te)
print("Best params:", gs.best_params_)
print("Accuracy:", round(accuracy_score(y_te, pred), 3), "F1:", round(f1_score(y_te, pred), 3))
print("Support vectors:", gs.best_estimator_[-1].n_support_)
gx, gy = np.meshgrid(np.linspace(-3, 3, 200), np.linspace(-3, 3, 200))
zz = gs.predict(np.c_[gx.ravel(), gy.ravel()]).reshape(gx.shape)
plt.contourf(gx, gy, zz, alpha=0.3)
plt.scatter(X_te[:, 0], X_te[:, 1], c=y_te, edgecolor="k")
plt.xlabel("x1"); plt.ylabel("x2")
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. Support Vector Machine is commonly used at this level in Marketing and Consumer Behaviour. 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