As a full-stack developer, I thrive on tackling new challenges and bringing ideas to life. I’m always excited to take on projects that push the boundaries of innovation and collaborate with like-minded, creative individuals.

Phone Number

+27 84 866 2418

Email

motaungleon@gmail.com

Linkedin

Leon Motaung

Address

12 Vermeer street, Bellville, Cape Town, 7530

Social

Waiter Tips Prediction with Machine-Learning

Waiter Tips Prediction with Machine-Learning

Started: 2025-12-01

View on GitHub
Python Pandas NumPy Scikit-learn Matplotlib Jupyter Notebooks
Project Progress 100%

About this project

Waiter Tips Prediction – My ML Learning Progress

πŸ“ˆ Waiter Tips Prediction – My Machine Learning Journey

Author: Leon Motaung

Technologies Used: Python, Pandas, NumPy, Plotly, Matplotlib

πŸ” Objective

The objective of this project is to explore how customer behaviour affects waiter tips. I used a real dataset to analyze the relationship between variables such as total bill, tip amount, day of the week, gender, smoker status, group size, and time of meal.

πŸš€ Steps I Took

  • Created a Python virtual environment using:
    python -m venv wenv
  • Installed required libraries:
    pip install pandas numpy plotly matplotlib
  • Loaded dataset with:
    data = pd.read_csv("tips.csv")
  • Explored the data using:
    data.head() and data.describe()
  • Visualized total_bill vs tip using scatter plot with trendline.

πŸ“Š Visualization I Created

Scatter plot showing relationship between total bill and tip amount:

figure = px.scatter(
    data_frame = data,
    x="total_bill",
    y="tip",
    size="size",
    color="day",
    trendline="ols"
)
figure.show()
  
Scatterplot

🧠 What I Learned

  • Higher total bills often result in higher tips.
  • Group size has an impact on tipping behaviour.
  • Certain days show better tipping patterns than others.
  • Trendline helps identify the overall tipping trend.

πŸ“‚ Project Structure

  • data/ – contains dataset (tips.csv)
  • visuals/ – saved data visualizations
  • scripts/ – python files for analysis
  • scatterplot.png – visualization: bill vs tip

πŸ”₯ This project helped me understand real-world data analysis and visualization using Python and machine learning concepts.

πŸ“Œ Key Insights from the Analysis

πŸ’΅ Bill Amount Strongly Correlates with Tip Size

The scatterplot shows that as the total bill increases, the tip amount also tends to increase. However, some variability existsβ€”meaning other factors also influence tipping behavior.

⏰ Peak Tipping Times Identified

The pie chart revealed that most tips occur during dinner time, especially on weekends (Saturday & Sunday). This insight can help restaurants schedule their best waiters during high-tip hours.

πŸ“Š Most Influential Features

  • Time of Day (Lunch vs Dinner)
  • Day of Week
  • Group Size
  • Total Bill Amount
  • Smoker vs Non-Smoker

Note: Gender did not strongly influence tipping.

πŸ€– Predicted Tip Example

Using the trained machine learning model, the system predicted a tip of:

πŸ‘‰ πŸ’° Predicted Tip: $3.74

This prediction was based on real input features, showing that the model can estimate how much tip a waiter might receive before the service begins.