Skip to content

Commit cea696e

Browse files
authored
Merge pull request #7 from Team-Fourth-Dimension/master
Updates
2 parents 280d932 + f44ae7b commit cea696e

File tree

9 files changed

+289
-10
lines changed

9 files changed

+289
-10
lines changed

EDA.py

+51-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# To find out the maximum no of customer's belonging to which age group
1212
def by_age_count(cleaned_profile):
13-
sns.countplot(x="age_by_decade",data=cleaned_profile)
13+
sns.countplot(x="age_by_decade",data=cleaned_profile, palette='rocket')
1414

1515
# Gender Distribution of our customer
1616
def by_gender_count(cleaned_profile):
@@ -28,14 +28,29 @@ def by_gender_count(cleaned_profile):
2828
'''
2929
x = ["F", "M", "O"]
3030
y = [6129,8484,212]
31-
plt.bar(x, y)
31+
plt.bar(x, y, color='c')
32+
33+
34+
# Gender conts by membership year
35+
def gender_by_year(cleaned_profile):
36+
membership_date = cleaned_profile.groupby(['became_member_on', 'gender']).size()
37+
membership_date = membership_date.reset_index()
38+
membership_date.columns = ['became_member_on', 'gender', 'count']
39+
40+
# plot a bar graph for age distribution as a function of gender in membership program
41+
plt.figure(figsize=(10, 5))
42+
sns.barplot(x='became_member_on', y='count', hue='gender', data=membership_date)
43+
plt.xlabel('Membership Start Year')
44+
plt.ylabel('Count');
45+
plt.title('Gender counts by membership year')
46+
3247

3348
# An Overview of what income range facilitates more membership
3449
def by_income_range(cleaned_profile):
3550
sns.countplot(x="income_range",data=cleaned_profile)
3651

3752
def by_member_year(cleaned_profile):
38-
sns.countplot(x="became_member_on",data=cleaned_profile)
53+
sns.countplot(x="became_member_on",data=cleaned_profile, palette='Set3')
3954

4055
# Comparing the Gender-wise distribution of our customer's income
4156
def income_by_gender(cleaned_profile):
@@ -44,4 +59,36 @@ def income_by_gender(cleaned_profile):
4459
z = cleaned_profile[cleaned_profile['O']==1]
4560
sns.kdeplot(x['income'],label='Female')
4661
sns.kdeplot(y['income'],label='Male')
47-
sns.kdeplot(z['income'],label='Other')
62+
sns.kdeplot(z['income'],label='Other')
63+
64+
65+
# Some data visualization of events related to offers
66+
67+
# Some numerical data regarding the offer events
68+
69+
'''
70+
offers['offer viewed'].value_counts()
71+
72+
0 98945
73+
1 49860
74+
75+
offers['offer received'].value_counts()
76+
77+
0 82304
78+
1 66501
79+
80+
offers['offer completed'].value_counts()
81+
82+
0 116361
83+
1 32444'''
84+
85+
# Representaion of people who viewed and didn't view the offer on recieving the offer
86+
def offers1():
87+
x = ["Viewed", "Not viewed"]
88+
y = [49860,16641]
89+
plt.pie(y, labels = x,autopct='%1.2f%%', explode=(0.0,0.1), colors=['#ff9999','#66b3ff'])
90+
def offers2():
91+
x = ["Completed", "Left viewed"]
92+
y = [32444,17416]
93+
plt.pie(y, labels = x,autopct='%1.2f%%', explode=(0.0,0.1), colors = ['#99ff99','#ffcc99'])
94+

Notebook.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ def cleaning_data():
5858
# OneHotEncoding the gender column
5959
ohe = pd.get_dummies(cleaned_profile['gender'])
6060
cleaned_profile = pd.concat([cleaned_profile,ohe],axis=1)
61-
cleaned_profile = cleaned_profile.drop(['gender'],axis=1)
6261

6362
# To convert the became_member_on to date-time stamp because the machine will not
6463
# understand data corresponding to date in integer form.
@@ -103,7 +102,7 @@ def cleaning_data():
103102
transactions = transactions.drop(['offer completed','offer viewed','offer received'],axis=1)
104103
transactions = transactions.drop(['transaction','record'],axis=1)
105104
transactions = transactions.rename(columns={'record_value':'amount'})
106-
105+
transactions['amount_range'] = pd.cut(transactions['amount'], bins=range(0,1150,50),right=False, labels=['50','100', '150', '200','250','300','350','400','450','500','550','600','650','700','750','800','850','900','950','1000','1050','1100'])
107106
# cleaning offers
108107
offers = offers.drop(['transaction','record'],axis=1)
109108
offers = offers.rename(columns={'record_value':'offer_id'})

README.md

+18-4
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,22 @@
1515
- [x] Data imported.
1616
- [x] Data cleaning started.
1717
- [x] Landing page of our website created.
18-
- 29th August, 2020.
18+
- 29th August, 2020.
1919
- [x] Data cleaning completed.
2020
- [x] Start Exploratory Data Analysis.
21+
- 30th August, 2020.
22+
- [x] Exploratory Data Analysis completed.
23+
- [x] Creation of Input page begun.
24+
- 31st August, 2020.
25+
- [x] Tried to merge the data into one pipeline.
26+
- [x] Eliminated redundant features from the dataset.
27+
- 1st September, 2020.
28+
- [x] Merging all the useful features in one dataframe.
29+
- [x] Algorithm for the model was decided.
30+
- 2nd September, 2020.
31+
- [x] Input page creation completed.
32+
- [x] Added an encoded columns to the merged columns.
33+
2134

2235
## 📄 Abstract
2336
The data simulates how people make purchasing decisions and how those decisions are influenced by promotional offers.
@@ -32,7 +45,8 @@ We aim to create a web-app which will be used to predict the best possible offer
3245

3346
### 📍 Major Checkpoints and Pipelines
3447
- ⛳ Data Science
35-
- [ ] Data cleaning and pipelining
48+
- [x] Data cleaning and pipelining
49+
- [x] Exploratory Data Analysis
3650
- [ ] Building a model
3751
- [ ] Training the model
3852
- [ ] Testing the model
@@ -44,8 +58,8 @@ We aim to create a web-app which will be used to predict the best possible offer
4458
- [ ] Testing the API
4559
- ⛳ Web Development
4660
- [ ] Front End
47-
- [ ] Landing page
48-
- [ ] Input Form
61+
- [x] Landing page
62+
- [x] Input Form
4963
- [ ] Visualization of graphical data
5064
- [ ] Back End
5165
- [ ] Integrating the API with the web-app

public/css/landing.css

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
body .container{
2+
width: 85%;
3+
}
4+
5+
.app-logo{
6+
margin: 0;
7+
}
8+
.app-logo div #logo{
9+
width: 85px;
10+
height: 50px;
11+
margin-top: 10px;
12+
}
13+
14+
.app-logo .row .col{
15+
padding: 0;
16+
}
17+
18+
#app-name{
19+
float: right;
20+
font-family: Calibri;
21+
color: #9C9999;
22+
font-size: 20px;
23+
}
24+
25+
#landing-h1{
26+
font-family: Libre Caslon Display;
27+
font-style: normal;
28+
font-weight: normal;
29+
font-size: 100px;
30+
line-height: 110px;
31+
margin-top: 0;
32+
word-spacing: 6px;
33+
}
34+
35+
#landing-captions{
36+
font-family: calibri;
37+
font-style: normal;
38+
font-weight: normal;
39+
font-size: 25px;
40+
line-height: 30px;
41+
color: #727272;
42+
43+
}
44+
45+
#offer{
46+
color: #6775F7;
47+
}
48+
49+
#graphics{
50+
padding-left: 60px;
51+
padding-top: 25px;
52+
width: 703px;
53+
height: 533px;
54+
}
55+
56+
.btn
57+
{
58+
border-radius: 50px;
59+
background-color: #6775F7;
60+
}
61+
62+
.btn:hover{
63+
background-color: #293ce9;
64+
}
65+
66+
.landing-btn{
67+
margin-top: 30px;
68+
}
69+
70+

public/css/landing_alt.css

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/* all */
2+
* {
3+
padding: 0;
4+
margin: 0;
5+
box-sizing: border-box;
6+
text-decoration: none;
7+
}
8+
9+
/* header */
10+
header {
11+
height: 150px;
12+
width: 100%;
13+
}
14+
15+
.head-right {
16+
padding: 30px;
17+
float: right;
18+
display: flex;
19+
}
20+
21+
#name {
22+
padding: 15px 0;
23+
font-size: 20px;
24+
font-family: Calibri;
25+
color: #9C9999;
26+
}
27+
28+
#logo {
29+
height: 60px;
30+
width: auto;
31+
}
32+
33+
/* main */
34+
.container {
35+
margin: 0 140px;
36+
display: flex;
37+
}
38+
39+
.container-left {
40+
float: left;
41+
margin-right: 80px;
42+
}
43+
44+
.container-left h1 {
45+
font-size: 60px;
46+
line-height: 80px;
47+
font-family: Libre Caslon Display;
48+
padding-bottom: 40px;
49+
}
50+
51+
.container-left h1 span {
52+
color: #6775F7;
53+
}
54+
55+
.container-left p {
56+
font-size: 20px;
57+
line-height: 30px;
58+
color: #9C9999;
59+
padding-bottom: 40px;
60+
}
61+
62+
.container-left button {
63+
padding: 15px 40px;
64+
border-radius: 50px;
65+
color: white;
66+
background-color: #6775F7;
67+
}
68+
69+
.container-left button:hover {
70+
background-color: #2e41f2;
71+
cursor: pointer;
72+
transition: 1s ease;
73+
}
74+
75+
.container-right {
76+
float: right;
77+
}

public/images/graphics.png

114 KB
Loading

public/images/logo.jpg

56.4 KB
Loading

views/index.html

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<!--Import Google Icon Font-->
5+
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
6+
<link href="https://fonts.googleapis.com/css2?family=Libre+Caslon+Display&display=swap" rel="stylesheet">
7+
<!--Import materialize.css-->
8+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
9+
10+
<link rel="stylesheet" href="../public/css/landing.css">
11+
12+
<!--Let browser know website is optimized for mobile-->
13+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
14+
</head>
15+
16+
<body>
17+
18+
<div class="row app-logo">
19+
<div class="col s2 offset-s10">
20+
<div class="row">
21+
<div class="col s8"><p id="app-name">Growth Square</p></div>
22+
<div class="col s4"><img id="logo" src="../public/images/logo.jpg" alt="logo"></div>
23+
</div>
24+
</div>
25+
</div>
26+
27+
<div class="row body-content container">
28+
<div class="col m6 s12">
29+
<h1 id="landing-h1">Run <span id="offer">offers</span> which actually works.</h1>
30+
<p id="landing-captions">Provide us with your customer details, and we help you with the best types of offers that can drive maximum growth in your business.</p>
31+
<a class="btn waves-effect waves-light btn-large landing-btn">Get started</a>
32+
</div>
33+
<div class="col m6">
34+
<img src="../public/images/graphics.png" id="graphics" alt="">
35+
</div>
36+
</div>
37+
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> <!-- jquery should come before materialize.js -->
38+
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
39+
<script type="text/javascript" src="js/materialize.min.js"></script>
40+
</body>
41+
</html>

views/index_alt.html

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<link rel="stylesheet" href="../public/css/landing_alt.css">
7+
<!-- Google Fonts -->
8+
<link href="https://fonts.googleapis.com/css2?family=Libre+Caslon+Display&display=swap" rel="stylesheet">
9+
</head>
10+
11+
<body>
12+
<!-- Logo -->
13+
<header>
14+
<div class="head-right">
15+
<p id="name">Growth Square</p>
16+
<img id="logo" src="../public/images/logo.jpg">
17+
</div>
18+
</header>
19+
<!-- Main -->
20+
<div class="container">
21+
<div class="container-left">
22+
<h1>Practical <span>Plans</span> <br> for <br> Practical Businesses.</h1>
23+
<p>We provide valuable information to companies to allow them to grow at a booming rate by analysing market trends. Input the details of your customers and get relevant offer recommendations that can exponentially grow your business.</p>
24+
<button>Get Started</button>
25+
</div>
26+
<div class="container-right">
27+
<img id="graphics" src="../public/images/graphics.png" >
28+
</div>
29+
</div>
30+
</body>
31+
</html>

0 commit comments

Comments
 (0)