5G and 6G refer to generations of mobile network technology, each representin...
ppt (1).pptx
1. DEPARTMENT OF ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING
INTERSHIP PRESENTATION ON
“PIZZA SALES”
Under the guidance of :
Ms. Farheen Farhath
Project Lead
PRESENTED BY:
Gagana.(1BI20AI013)
BANGALORE INSTITUTE OF TECHNOLOGY
DEPARTMENT OF ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING
2. ABSTRACT
• This project seeks to develop a predictive model for a pizza restaurant
to forecast sales accurately. This model utilizes historical sales data,
weather conditions, promotions, and other pertinent factors to optimize
inventory management, staff scheduling, and marketing strategies. By
applying machine learning techniques, this project aims to enhance the
restaurant's operational efficiency, reduce wastage, improve
profitability, and empower data-driven decision-making. The project's
significance lies in its practical application of machine learning within
the food service industry, offering a scalable solution for similar
businesses to harness the benefits of predictive analytics and informed
decision-making.
2
3. CONTENTS
1. Introduction
2. Problem Statement
3. Objective
4. Dataset
5. Libraries Used
6. Implementation (Code)
7. Outcome of the Project
8. Conclusion
4. INTRODUCTION
• Pizza, a culinary delight, holds a unique place in the world of food. In
the competitive pizza restaurant industry, efficiency is key. We
explore a dataset encompassing sales data, date-time records, menu
items, pricing, promotions, and weather conditions to uncover the
drivers behind pizza sales.
⇨ Our aim is to empower pizzerias with predictive insights by
deciphering historical patterns. This enables them to optimize
operations, reduce waste, and enhance customer satisfaction.
5. PROBLEM STATEMENT
• The pizza restaurant industry requires an accurate sales
forecasting solution to optimize inventory management, staffing,
and promotions. This project aims to develop a machine learning
model that uses historical sales data and relevant factors to predict
future pizza sales, enabling data-driven decisions and improving
operational efficiency within the food service sector.
6. OBJECTIVES
• To predict the price of pizza.
• An approach to receive higher accuracy.
• To build a machine learning model to classify the given
problem statement.
8. Pandas (for handling data files)
Matplotlib(for data visualization)
Seaborn(for data visualization)
LIBRARIES
9. IMPLEMENTATION
# importing necessary libraries
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
From sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import LabelEncoder
From sklearn.svm import SVR
data=pd.read_csv("pizzaplace.csv")
# Display Top 5 Rows of The Dataset
data.head()
# Check Last 5 Rows of The Dataset
data.tail()
9
10. 10
# Find Shape of Our Dataset(Number of Rows And Number of Columns)
data.shape
print("number of rows ",data.shape[0])
print("number of columns ",data.shape[1])
# Get Information About Our Dataset Like Total Number of Rows,Total Number of
Columns,Datatypes of Each Column And Memory Requirement
data.info()
# Check Null Values In The Dataset
data.isnull()
data.isnull().sum()
# Get Overall Statistics About The Dataset
data.describe()
# Data Preprocessing
data.head()
# Check the data type of the 'price' column
print(data['price'].dtype)
11. 11
# If the 'price' column is not of string type, convert it to strings
data['price'] = data['price'].astype(str)
# Replace commas and convert to int
data['price'] = data['price'].str.replace(",", "").astype(float).round().astype('int32')
data.head()
data.info()
def convert(value):
return value*0.0054
data['price'].apply(convert)
data.head()
# Data Analysis
# What is Univariate Analysis
data.columns
# Id
data['id'].value_counts()
# Price
import matplotlib.pyplot as plt
plt.hist(x="price",data=data)
plt.title("price distribution")
plt.show()
12. 12
# Date
data['date'].value_counts()
import seaborn as sns
sns.countplot(data['date'])
# Type
data['type'].value_counts()
sns.countplot(data['type'])
# Size
data['size'].value_counts()
sns.countplot(data['size'])
# Bivariate Analysis
# Price by Type
data.columns
sns.barplot(data['type'],data['price'])
# Price By Size
data.columns
sns.boxplot(x='size',y='price',data=data)
13. 13
# Find The Most Expensive Pizza
data.columns
data['price'].max()
data['price'].max()==data['price']
data[data['price'].max()==data['price']]
# Find Type of M Size pizzas
data.columns
data['size']=='M'
data[data['size']=='M']
data[data['size']=='M']['type'].head()
# Find Type of XL size Pizzas
data['size']=='XL'
data[data['size']=='XL']
data[data['size']=='XL']['type'].head()
# Label Encoding
cat_cols=data.select_dtypes(include=['object']).columns
cat_cols
from sklearn.preprocessing import LabelEncoder
en=LabelEncoder()
for i in cat_cols:
data[i]=en.fit_transform(data[i]) data.head()
14. 14
# Store Feature Matrix In x and Response(Target) In Vector y
x=data.drop('price',axis=1)
y=data['price']
# Splitting The Dataset Into The Training Set And Test Set
from sklearn.model_selection import train_test_split
x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=0.20,random_state=42)
# Import The Models
data.head() ]
from sklearn.linear_model import LinearRegression
from sklearn.svm import SVR
# Model Training
lr = LinearRegression()
lr.fit(x_train,y_train)
svm = SVR()
svm.fit(x_train,y_train)
# Prediction on Test Data
y_pred1=lr.predict(x_test)
y_pred2=svm.predict(x_test)
15. 15
# Evaluating The Algorithm
from sklearn import metrics
score1=metrics.r2_score(y_test,y_pred1)
score2=metrics.r2_score(y_test,y_pred2)
print(score1,score2)
final_data=pd.DataFrame({'Models':['LR','SVR'],'R2_SCORE':[score1,score2]})
final_data
import seaborn as sns
sns.barplot(final_data['Models'],final_data['R2_SCORE'])
# Save the Model
x=data.drop('price',axis=1)
y=data['price']
lr=LinearRegression()
lr.fit(x,y)
import joblib
joblib.dump(lr,'pizza_price_predict')
model=joblib.load('pizza_price_predict')
24. CONCLUSION
• I have found the important features which could play a vital role in
Pizza Sales and non influential features as well. I studied the
report of prediction carefully. I can expand the existing system
with additional analysis methods and implementation with neural
networks and deep learning.
24