Memuat
Memuat
Genetic Algorithm for Marketing and Consumer Behaviour
0 views
Apply Genetic Algorithm to synthetic data to find the best solution for the promotion budget mix across digital and outdoor media and compare outcomes. A genetic algorithm searches for optimal solutions by imitating evolution: selection, crossover, and mutation on a population of solutions. It suits nonlinear or combinatorial optimisation problems that are hard for gradient methods.

Apply Genetic Algorithm to synthetic data to find the best solution for the promotion budget mix across digital and outdoor media and compare outcomes.
| Role | Variable | Unit |
|---|---|---|
| Main | Consumer reach | ribu orang |
| Supporting 1 | Digital media budget | juta Rp |
| Supporting 2 | Outdoor media budget | juta Rp |
The genetic algorithm (population 24, 22 generations) minimises Consumer reach down to 62.04 at Digital media budget = 143.88 and Outdoor media budget = 185.35, within 0.01% of the global optimum.
Computed from illustrative synthetic data, not from a real study.
A genetic algorithm searches for optimal solutions by imitating evolution: selection, crossover, and mutation on a population of solutions. It suits nonlinear or combinatorial optimisation problems that are hard for gradient methods.
Report GA parameters, the best solution, objective value, and convergence curves from several runs with different seeds. Compare with other methods to show solution quality.
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
def rastrigin(p):
return 20 + (p ** 2 - 10 * np.cos(2 * np.pi * p)).sum(axis=1)
rng = np.random.default_rng(31)
dim, pop_n, gens = 2, 60, 80
lo, hi = -5.12, 5.12
digital_media_budget = rng.uniform(lo, hi, (pop_n, dim)) # population
best_hist = []
for g in range(gens):
consumer_reach = rastrigin(digital_media_budget) # cost (to minimise)
best_hist.append(consumer_reach.min())
elite = digital_media_budget[consumer_reach.argmin()].copy()
# tournament selection
idx = rng.integers(0, pop_n, (pop_n, 2))
win = np.where(consumer_reach[idx[:, 0]] < consumer_reach[idx[:, 1]], idx[:, 0], idx[:, 1])
parents = digital_media_budget[win]
# blend crossover
mates = parents[rng.permutation(pop_n)]
alpha = rng.random((pop_n, 1))
child = alpha * parents + (1 - alpha) * mates
# gaussian mutation
mask = rng.random(child.shape) < 0.1
child = child + mask * rng.normal(0, 0.3, child.shape)
child = np.clip(child, lo, hi)
child[0] = elite
digital_media_budget = child
final = rastrigin(digital_media_budget)
print("Best cost:", round(final.min(), 5))
print("Best solution:", digital_media_budget[final.argmin()].round(4))
plt.plot(best_hist)
plt.xlabel("Generation"); plt.ylabel("Best cost")
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$100
excl. 11% VAT
Duration: 13 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$219
excl. 11% VAT
Duration: 18-21 working days
Output: Code + analysis + guidance until ready to present
Includes all of Packages 1 & 2, plus
Yes. Genetic Algorithm 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$34, Package 2 (your data analysis and interpretation) US$100 and Package 3 (full guidance) US$219, 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