Data Analytics for Business Case using Python
VerifiedAdded on 2023/06/10
|21
|3127
|335
AI Summary
The purpose of our report is to explore different data analytics methods in solving the problem of diminishing sales as well as suggest new methods with which to conduct business, partly due to rising competition in the e-commerce business as well as shifting trend and nature of business. We will cover a range of data analysis tools such as forecasting for classification and predictive analysis. Moreover, we will explore the descriptive statistics of the company’s data so as to draw gainful insights about the performance of NILA e-commerce company.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
1Running head: ICT 706 DATA ANALYTICS
Title:Data Analytics
Assignment: Data analysis for a business case using python
Name of the Student
Name of the University
Authors note
Title:Data Analytics
Assignment: Data analysis for a business case using python
Name of the Student
Name of the University
Authors note
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
2Business Data Analysis
1. Executive Summary
Purpose of study
The purpose of our report is to explore different data analytics methods in solving the
problem of diminishing sales as well as suggest new methods with which to conduct
business, partly due to rising competition in the e-commerce business as well as shifting trend
and nature of business.
Scope
We will cover a range of data analysis tools such as forecasting for classification and
predictive analysis. Moreover, we will explore the descriptive statistics of the company’s data
so as to draw gainful insights about the performance of NILA e-commerce company.
1. Executive Summary
Purpose of study
The purpose of our report is to explore different data analytics methods in solving the
problem of diminishing sales as well as suggest new methods with which to conduct
business, partly due to rising competition in the e-commerce business as well as shifting trend
and nature of business.
Scope
We will cover a range of data analysis tools such as forecasting for classification and
predictive analysis. Moreover, we will explore the descriptive statistics of the company’s data
so as to draw gainful insights about the performance of NILA e-commerce company.
3Business Data Analysis
Table of Contents
2. Introduction............................................................................................................................4
3. Research Methodology...........................................................................................................5
4. Analytical Findings................................................................................................................7
5. Recommendations................................................................................................................15
6. Implementation plan based on the recommendations..........................................................16
7. Conclusions..........................................................................................................................17
8. Bibliography.........................................................................................................................18
9.Appendix...............................................................................................................................19
Table of Contents
2. Introduction............................................................................................................................4
3. Research Methodology...........................................................................................................5
4. Analytical Findings................................................................................................................7
5. Recommendations................................................................................................................15
6. Implementation plan based on the recommendations..........................................................16
7. Conclusions..........................................................................................................................17
8. Bibliography.........................................................................................................................18
9.Appendix...............................................................................................................................19
4Business Data Analysis
2. Introduction
E-commerce is one of the latest developing sectors of business, with both new and old
players and As a result drawing competition among the groups. As a result, there is need for a
firm to as given the company’s revenue sources, the number of customers purchasing a given
commodity and whether they are return or one-time purchasers as well as the region they
come from. As such, it is prudent to predict the product sales and performance of the products
both locally and internationally. Forecasting will enable the executive to apply new strategies
for product promotion and be able to export more of the best playing products in aim of
maximizing sales.
2. Introduction
E-commerce is one of the latest developing sectors of business, with both new and old
players and As a result drawing competition among the groups. As a result, there is need for a
firm to as given the company’s revenue sources, the number of customers purchasing a given
commodity and whether they are return or one-time purchasers as well as the region they
come from. As such, it is prudent to predict the product sales and performance of the products
both locally and internationally. Forecasting will enable the executive to apply new strategies
for product promotion and be able to export more of the best playing products in aim of
maximizing sales.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
5Running head: ICT 706 DATA ANALYTICS
3. Research Methodology
To conduct our analysis paper we employ linear regression in developing a sales
prediction model for our given business regions for NILA e-commerce company. Our
regression analysis will be developed to incorporate a number independent variables to
enable us develop a more predictive and suitable model. Through linear regression
(Forecasting), the Company will be able to as given and exploit any available business gaps
and also curb the risks that may occur. Linear regression method in our business Company
will prove important in business decision making. Analysis of the company’s Product
demand is key in the forecasting on the the possible quantity of products that a customer buy
or which will be exported to a given region by our Company. However, the demand of the
company products is not only the factor to be considered in prediction of the performance of
the business. By the application of the linear regression method in data analysis, the business
Company will venture past estimating of just the sales into other factors which will be able to
display effect on the amount of sales made by the company in order to ensure more the sales
and consequently the revenue generated by the firms.
Moreover, Forecast analysis will be useful for a firm to establish specific relationship
among the different variables by determining the distribution patterns in the different
variables of our data-set which were previously absent. For instance, analysis of total sales
and customer records are useful in indication of the market patterns. Such patterns could
incorporate growth in demand for given products or in a given business regions of the
country.
application of this methods helps the company to reduce the tremendous amount
unstructured unprocessed data in applicable and productive information use by the business.
As a result, it will be stated that forecasting analysis promotes near accurate as well as better
3. Research Methodology
To conduct our analysis paper we employ linear regression in developing a sales
prediction model for our given business regions for NILA e-commerce company. Our
regression analysis will be developed to incorporate a number independent variables to
enable us develop a more predictive and suitable model. Through linear regression
(Forecasting), the Company will be able to as given and exploit any available business gaps
and also curb the risks that may occur. Linear regression method in our business Company
will prove important in business decision making. Analysis of the company’s Product
demand is key in the forecasting on the the possible quantity of products that a customer buy
or which will be exported to a given region by our Company. However, the demand of the
company products is not only the factor to be considered in prediction of the performance of
the business. By the application of the linear regression method in data analysis, the business
Company will venture past estimating of just the sales into other factors which will be able to
display effect on the amount of sales made by the company in order to ensure more the sales
and consequently the revenue generated by the firms.
Moreover, Forecast analysis will be useful for a firm to establish specific relationship
among the different variables by determining the distribution patterns in the different
variables of our data-set which were previously absent. For instance, analysis of total sales
and customer records are useful in indication of the market patterns. Such patterns could
incorporate growth in demand for given products or in a given business regions of the
country.
application of this methods helps the company to reduce the tremendous amount
unstructured unprocessed data in applicable and productive information use by the business.
As a result, it will be stated that forecasting analysis promotes near accurate as well as better
6Business Data Analysis
business decisions aimed at improving the firms performance in the now competitive market.
In the forecasting model for instance, it may be concluded that the amount of products
purchased are dependent on consumer purchases in the specified region and on the total sales
of the product in the chosen geographical region. Analyzed statistics on these factors should
be taken into consideration and hence evaluation of best fit for the sales and other variables.
In our report we explore different stages of forecasting as a means of classification and
predictive modelling.
business decisions aimed at improving the firms performance in the now competitive market.
In the forecasting model for instance, it may be concluded that the amount of products
purchased are dependent on consumer purchases in the specified region and on the total sales
of the product in the chosen geographical region. Analyzed statistics on these factors should
be taken into consideration and hence evaluation of best fit for the sales and other variables.
In our report we explore different stages of forecasting as a means of classification and
predictive modelling.
7Running head: ICT 706 DATA ANALYTICS
4. Analytical Findings
For the acquired data set, at first we collected the statistical details of it using python
language. The overall statistics of the data-set generates the following result,
price Sales(Us dollars$) Customers
count 1280.0 1280.0 1280.0
mean 53.95390 274.4203125 22.89609375
std 27.45342 687.8165506918891 11.4619805
min 3.0 50.0 5.0
25% 32.0 99.0 12.0
50% 54.0 183.0 23.0
75% 79.0 233.0 30.25
Max 99 9744 54
Table 1: Statistical data about the data-set
Sales(Us Customers
count 40.0 40.0
mean 208.35 23.75
std 373.4671 11.9587967
min 53.0 5.0
4. Analytical Findings
For the acquired data set, at first we collected the statistical details of it using python
language. The overall statistics of the data-set generates the following result,
price Sales(Us dollars$) Customers
count 1280.0 1280.0 1280.0
mean 53.95390 274.4203125 22.89609375
std 27.45342 687.8165506918891 11.4619805
min 3.0 50.0 5.0
25% 32.0 99.0 12.0
50% 54.0 183.0 23.0
75% 79.0 233.0 30.25
Max 99 9744 54
Table 1: Statistical data about the data-set
Sales(Us Customers
count 40.0 40.0
mean 208.35 23.75
std 373.4671 11.9587967
min 53.0 5.0
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
8Business Data Analysis
25% 88.0 15.0
50% 108.5 22.5
75% 211.25 30.0
max 2435.0 54.0
Table 1: Statistical data about Fridge sales
Following our analysis table we can interpret the statistics as in: the company data-set
incorporates total 1280 data entries with the maximum and minimum values for the product
price being $ 50 and $99. The cumulative product sales were such that: the minimum
recorded value by the company for sales was $50, mean value was 274.4203125 while the
maximum was $9744.
Through conducting further data analysis we realized there were 7 products that were
sold dealt by the company according to the records, including:
i. Fridge
ii. Solar Panels
iii. Television Sets
iv. Microwave
v. Air Conditioners
vi. Smart Cookers
vii. Lawn Mowers
Additionally there were 2 methods of shipping goods sold (Paid and free), there were 2 types
25% 88.0 15.0
50% 108.5 22.5
75% 211.25 30.0
max 2435.0 54.0
Table 1: Statistical data about Fridge sales
Following our analysis table we can interpret the statistics as in: the company data-set
incorporates total 1280 data entries with the maximum and minimum values for the product
price being $ 50 and $99. The cumulative product sales were such that: the minimum
recorded value by the company for sales was $50, mean value was 274.4203125 while the
maximum was $9744.
Through conducting further data analysis we realized there were 7 products that were
sold dealt by the company according to the records, including:
i. Fridge
ii. Solar Panels
iii. Television Sets
iv. Microwave
v. Air Conditioners
vi. Smart Cookers
vii. Lawn Mowers
Additionally there were 2 methods of shipping goods sold (Paid and free), there were 2 types
9Business Data Analysis
of business customers ( existing and new).
. Also, regions in which the company conducted business were:
i. Africa
ii. Australia
iii. Asia
iv. America
v. Europe
Business regions to target new customers
Data analysis a sample of total sales recorded and number of customers in relation to
price :
price Sales(Us
dollars$)
Customers
count 251.0 251.0 251.0
mean 54.30278 347.1752988 22.657370517
std 27.37904 943.7778261 12.123123997
min 3.0 53.0 5.0
25% 33.5 97.5 11.5
50% 52.0 180.0 23.0
of business customers ( existing and new).
. Also, regions in which the company conducted business were:
i. Africa
ii. Australia
iii. Asia
iv. America
v. Europe
Business regions to target new customers
Data analysis a sample of total sales recorded and number of customers in relation to
price :
price Sales(Us
dollars$)
Customers
count 251.0 251.0 251.0
mean 54.30278 347.1752988 22.657370517
std 27.37904 943.7778261 12.123123997
min 3.0 53.0 5.0
25% 33.5 97.5 11.5
50% 52.0 180.0 23.0
10Business Data Analysis
Analysis of different regions according to sales
Africa
Sales(Us dollars$) Customers
count 40.0 40.0
mean 208.35 23.75
std 373.4671612241437 11.958796783657649
min 53.0 5.0
25% 88.0 15.0
50% 108.5 22.5
75% 211.25 30.0
Europe
price Sales(Us dollars$)
count 251.0 251.0
mean 54.30278884462152 347.1752988047809
std 27.379042207338713 943.7778261579414
min 3.0 53.0
25% 33.5 97.5
50% 52.0 180.0
75% 78.5 232.5
Analysis of different regions according to sales
Africa
Sales(Us dollars$) Customers
count 40.0 40.0
mean 208.35 23.75
std 373.4671612241437 11.958796783657649
min 53.0 5.0
25% 88.0 15.0
50% 108.5 22.5
75% 211.25 30.0
Europe
price Sales(Us dollars$)
count 251.0 251.0
mean 54.30278884462152 347.1752988047809
std 27.379042207338713 943.7778261579414
min 3.0 53.0
25% 33.5 97.5
50% 52.0 180.0
75% 78.5 232.5
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
11Business Data Analysis
Asia
price Sales(Us dollars$)
count 230.0 230.0
mean 54.68695652173913 283.67826086956524
std 27.425282447667627 779.6865011892284
min 3.0 51.0
25% 33.0 102.25
50% 54.0 186.0
75% 79.0 236.0
Australia
price Sales(Us dollars$)
count 255.0 255.0
mean 55.043137254901964 235.32549019607842
std 27.917942576019772 466.2044007142466
min 3.0 51.0
25% 33.0 103.0
50% 56.0 186.0
Asia
price Sales(Us dollars$)
count 230.0 230.0
mean 54.68695652173913 283.67826086956524
std 27.425282447667627 779.6865011892284
min 3.0 51.0
25% 33.0 102.25
50% 54.0 186.0
75% 79.0 236.0
Australia
price Sales(Us dollars$)
count 255.0 255.0
mean 55.043137254901964 235.32549019607842
std 27.917942576019772 466.2044007142466
min 3.0 51.0
25% 33.0 103.0
50% 56.0 186.0
12Business Data Analysis
75% 79.5 234.0
Given our table,we note that the average number of customers who made return
purchases were 22, also evidently there are lesser number of buyers following a -fold analysis
such that the variation is 12. As a result, it will be said that, it is important to regulate the
product price to favor more customers in order to attract new buyers so as to foster the
company’s revenue growth. Also we found out that Asia recorded the most average sales
followed by Australia, whereas Africa had the least sales recorded and therefore it would be
wise to export more to Africa while still maintaining the volumes exported to Asia and the
local market.
.
Products analysis to determine those key for sales growth
Product price Sales(Us
dollars$)
Customer
s
Air Conditional 9978 52007 4508
Fridge 9688 41221 4056
Lawn Mower 9883 61374 3861
Microwave 10784 54460 4353
Smart Cookers 9977 42692 4039
Solar Panels 9508 40480 4195
75% 79.5 234.0
Given our table,we note that the average number of customers who made return
purchases were 22, also evidently there are lesser number of buyers following a -fold analysis
such that the variation is 12. As a result, it will be said that, it is important to regulate the
product price to favor more customers in order to attract new buyers so as to foster the
company’s revenue growth. Also we found out that Asia recorded the most average sales
followed by Australia, whereas Africa had the least sales recorded and therefore it would be
wise to export more to Africa while still maintaining the volumes exported to Asia and the
local market.
.
Products analysis to determine those key for sales growth
Product price Sales(Us
dollars$)
Customer
s
Air Conditional 9978 52007 4508
Fridge 9688 41221 4056
Lawn Mower 9883 61374 3861
Microwave 10784 54460 4353
Smart Cookers 9977 42692 4039
Solar Panels 9508 40480 4195
13Business Data Analysis
Television Sets 9243 59024 4295
From our analysis of the product sales across different regions, we found out that the
company recorded most sales from air conditioners which had a sales return of 52,007 Us
dollars followed by Microwaves which had a sales record of 54460, the least purchases were
that of lawn mowers which surprisingly had more sales records at 61374 US dollars.
Therefore, for the company to generate more revenue it ought to concentrate on the
exportation of more lawn mowers which have higher value compared to lower value
products. However, the company should not overlook the most popular product, i.e. Air
conditioners and should therefore supply more to different regions in order to keep the flow
of customers
Influence of shipping type
shipping
Method
price Sales(Us
dollars$)
Customers
Shipping free 35925 177290 15544
Shipping paid 33136 173968 13763
Following our analysis we find out that most sales were recorded when free shipping was
offered and therefore it proves that it would be fundamental enough to introduce free-
shipping as an incentive to lure new customers as well as encourage multiple purchases.
Prediction model using forecasting
In order to explore and predict the sales in the American market, we applied a linear
regression model . Through our regression model we established a relationship between
Television Sets 9243 59024 4295
From our analysis of the product sales across different regions, we found out that the
company recorded most sales from air conditioners which had a sales return of 52,007 Us
dollars followed by Microwaves which had a sales record of 54460, the least purchases were
that of lawn mowers which surprisingly had more sales records at 61374 US dollars.
Therefore, for the company to generate more revenue it ought to concentrate on the
exportation of more lawn mowers which have higher value compared to lower value
products. However, the company should not overlook the most popular product, i.e. Air
conditioners and should therefore supply more to different regions in order to keep the flow
of customers
Influence of shipping type
shipping
Method
price Sales(Us
dollars$)
Customers
Shipping free 35925 177290 15544
Shipping paid 33136 173968 13763
Following our analysis we find out that most sales were recorded when free shipping was
offered and therefore it proves that it would be fundamental enough to introduce free-
shipping as an incentive to lure new customers as well as encourage multiple purchases.
Prediction model using forecasting
In order to explore and predict the sales in the American market, we applied a linear
regression model . Through our regression model we established a relationship between
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
14Business Data Analysis
different marketing methods and sales in the market, hence indicating need for better and
innovative methods for competition.
1-Regression of sales and factors affecting sales In the US Market
different marketing methods and sales in the market, hence indicating need for better and
innovative methods for competition.
1-Regression of sales and factors affecting sales In the US Market
15Running head: ICT 706 DATA ANALYTICS
5. Recommendations
Persuasive selling: Following our analysis of the company’s records, we did
identified a relationship between the sales recorded by the company on different products and
therefore, the sales sector would be encouraged to engage in persuasive selling where they
persuade the buyer to purchase a given commodity now that they have purchased another
through offering enticements such as free-shipping and gift coupons. This is mostly effective
between related products such as Television and solar panels for instance. This would ensure
more sales for the related products.
Endorsement campaigns for products: We advice the company to adopt new
advertising techniques so as to foster product awareness as well as widen the product market
through personalized ad campaigns by renown public figure such as sportsmen and
entertainers. Public endorsements are often a way of ensuring public belief of the product as a
good quality one or even essential.
Provision of free shipping: Due to high sales recorded by the free-shipping option,
the company ought to adopt the method for a wide range of products so as to encourage more
purchases
After-sales services: Despite being unused by the company in the past, it would be an
add-on for the shipping incentive in that given a certain type of goods purchased, the
company offers after-sale services such as free training and installation. After-sales services
may offer customers a reason to trust us as their suppliers.
5. Recommendations
Persuasive selling: Following our analysis of the company’s records, we did
identified a relationship between the sales recorded by the company on different products and
therefore, the sales sector would be encouraged to engage in persuasive selling where they
persuade the buyer to purchase a given commodity now that they have purchased another
through offering enticements such as free-shipping and gift coupons. This is mostly effective
between related products such as Television and solar panels for instance. This would ensure
more sales for the related products.
Endorsement campaigns for products: We advice the company to adopt new
advertising techniques so as to foster product awareness as well as widen the product market
through personalized ad campaigns by renown public figure such as sportsmen and
entertainers. Public endorsements are often a way of ensuring public belief of the product as a
good quality one or even essential.
Provision of free shipping: Due to high sales recorded by the free-shipping option,
the company ought to adopt the method for a wide range of products so as to encourage more
purchases
After-sales services: Despite being unused by the company in the past, it would be an
add-on for the shipping incentive in that given a certain type of goods purchased, the
company offers after-sale services such as free training and installation. After-sales services
may offer customers a reason to trust us as their suppliers.
16Running head: ICT 706 DATA ANALYTICS
6. Implementation plan based on the recommendations
Following our recommendations, for the company to successfully oversee the
implementation, the following basic plan is proposed:
i. The company should set aside a budget that will take care of endorsement deals and
assign a marketing team the role of evaluating and assessing the suitable candidates for
endorsing the line of the company products
ii. The company should employ technical assistants who will help in the after-sale role and
process for different clients both for abroad branches and the local region.
iii. The company should ensure free-shipping for all commodities so as to encourage more
sales through subsequently ensuring shipping discounts
iv. The sales team should employ the persuasive selling technique through adopting the
client-seller rapport method, where apart from the sale, a marketer gets to discuss with
the buyer of their other probable product interest and suggest some of our products.
Following the above strategy will give the company an upper-hand over our competitors and
also ensure more sales for the subsequent business period. Additionally as a precaution, the
company ought to declare redundant products out of cycle so as to ensure maximizing of the
current profitable products
6. Implementation plan based on the recommendations
Following our recommendations, for the company to successfully oversee the
implementation, the following basic plan is proposed:
i. The company should set aside a budget that will take care of endorsement deals and
assign a marketing team the role of evaluating and assessing the suitable candidates for
endorsing the line of the company products
ii. The company should employ technical assistants who will help in the after-sale role and
process for different clients both for abroad branches and the local region.
iii. The company should ensure free-shipping for all commodities so as to encourage more
sales through subsequently ensuring shipping discounts
iv. The sales team should employ the persuasive selling technique through adopting the
client-seller rapport method, where apart from the sale, a marketer gets to discuss with
the buyer of their other probable product interest and suggest some of our products.
Following the above strategy will give the company an upper-hand over our competitors and
also ensure more sales for the subsequent business period. Additionally as a precaution, the
company ought to declare redundant products out of cycle so as to ensure maximizing of the
current profitable products
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
17Running head: ICT 706 DATA ANALYTICS
8. Conclusion
9. Conducting of business often requires just more than a product and investors. It calls for
smart methods with which to make decisions with as well as cope up with competition.
As a result methods such as Sales forecasting come in handy for exploring the business
performance as well as predicting the next move of the business. Through forecasting the
company can be able to predict sales, explore potential loopholes for adopting a given
strategy and even be able to determine the underlying relationship between the
performance of a given business aspect and a business activity, as in our case the activity
of free shipping and the performance of sales.
8. Conclusion
9. Conducting of business often requires just more than a product and investors. It calls for
smart methods with which to make decisions with as well as cope up with competition.
As a result methods such as Sales forecasting come in handy for exploring the business
performance as well as predicting the next move of the business. Through forecasting the
company can be able to predict sales, explore potential loopholes for adopting a given
strategy and even be able to determine the underlying relationship between the
performance of a given business aspect and a business activity, as in our case the activity
of free shipping and the performance of sales.
18Business Data Analysis
10. Bibliography
Exterkate, P., Groenen, P.J., Heij, C. and van Dijk, D., 2016. Nonlinear forecasting with
many predictors using kernel ridge regression. International Journal of Forecasting, 32(3),
pp.736-753.
Fernandes,C & Nicole, I. (2018) The influence of corporate social responsibility associations
on consumers’ perceptions towards global brands. Journal of Strategic Marketing. June 20th ,
pp 39-57, DOI: 10.1080/0965254X.2018.1464497.
Montgomery, D.C., Jennings, C.L. and Kulahci, M., 2015. Introduction to time series
analysis and forecasting. John Wiley & Sons.
Omar, H., Hoang, V.H. and Liu, D.R., 2016. A Hybrid Neural Network Model for Sales
Forecasting Based on ARIMA and Search Popularity of Article Titles. Computational
intelligence and neuroscience, 2016.
Baardman, L., Levin, I., Perakis, G. and Singhvi, D., 2017. Leveraging Comparables for New
Product Sales Forecasting.
Donald H. & Tim S. (2008).Business leaders speak out: their real strategic problems..
Journal of Business Strategy, Vol. 29 Issue: 5, pp.32-37,
https://doi.org/10.1108/02756660810902305.
10. Bibliography
Exterkate, P., Groenen, P.J., Heij, C. and van Dijk, D., 2016. Nonlinear forecasting with
many predictors using kernel ridge regression. International Journal of Forecasting, 32(3),
pp.736-753.
Fernandes,C & Nicole, I. (2018) The influence of corporate social responsibility associations
on consumers’ perceptions towards global brands. Journal of Strategic Marketing. June 20th ,
pp 39-57, DOI: 10.1080/0965254X.2018.1464497.
Montgomery, D.C., Jennings, C.L. and Kulahci, M., 2015. Introduction to time series
analysis and forecasting. John Wiley & Sons.
Omar, H., Hoang, V.H. and Liu, D.R., 2016. A Hybrid Neural Network Model for Sales
Forecasting Based on ARIMA and Search Popularity of Article Titles. Computational
intelligence and neuroscience, 2016.
Baardman, L., Levin, I., Perakis, G. and Singhvi, D., 2017. Leveraging Comparables for New
Product Sales Forecasting.
Donald H. & Tim S. (2008).Business leaders speak out: their real strategic problems..
Journal of Business Strategy, Vol. 29 Issue: 5, pp.32-37,
https://doi.org/10.1108/02756660810902305.
19Business Data Analysis
Appendix
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
datf=pd.read_csv("NILAcompanyData.csv")
datf.describe()
datf.head()
datf["Region"].unique()
datf["Product"].unique()
def unique_counts(datf):
for i in datf.columns:
count = datf[i].nunique()
print(i, ": ", count)
unique_counts(datf)
datf.data_groupby(["Product"]).sum().sort_values("Region", ascending=False)
data_group1 = datf.data_groupby(["Region"]).sum()
data_group1.head(50)
data_group2 = datf.data_groupby(["shipping Method]).sum()
data_group2.head(50)
data_group3 = datf.data_groupby(["Product","Region" ]).sum()
data_group3.head(50)
data_group4 = datf.data_groupby(["Product"]).sum()
data_group4.head(50)
geomask=(datf['Region'].values =='Africa')
geomask
sagdat=datf.loc[datf['Region'] == 'Europe']
Appendix
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
datf=pd.read_csv("NILAcompanyData.csv")
datf.describe()
datf.head()
datf["Region"].unique()
datf["Product"].unique()
def unique_counts(datf):
for i in datf.columns:
count = datf[i].nunique()
print(i, ": ", count)
unique_counts(datf)
datf.data_groupby(["Product"]).sum().sort_values("Region", ascending=False)
data_group1 = datf.data_groupby(["Region"]).sum()
data_group1.head(50)
data_group2 = datf.data_groupby(["shipping Method]).sum()
data_group2.head(50)
data_group3 = datf.data_groupby(["Product","Region" ]).sum()
data_group3.head(50)
data_group4 = datf.data_groupby(["Product"]).sum()
data_group4.head(50)
geomask=(datf['Region'].values =='Africa')
geomask
sagdat=datf.loc[datf['Region'] == 'Europe']
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
20Business Data Analysis
sagdat
elf=sagdat.loc[sagdat['Product'] == 'Fridge']
trnsdata = elf.drop(['Price','Shipping','Customer','Region','Product'], axis=1)
trnsdata
elf=sagdat.loc[sagdat['Product'] == 'Fridge']
trnsdata = elf.drop(['Price','Shipping','Customer','Region','Product'], axis=1)
trnsdata
eler = LinearRegression()
knumberfolds = cv.KFold(X.shape[0], n_folds=4, shuffle=True, random_state=42)
scrs = cv.cross_val_score(eler, X, y, cv=knumberfolds)
print("Accuracy: %0.2f (+/- %0.2f)" % (scrs.mean(), scrs.std()))
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn import datasets, linear_model
def get_data(file_name):
x_parameter = []
y_parameter = []
for single_prices ,single_value in
zip(sagdat['monthly_sales($)'],sagdat['customers_count ']):
x_parameter.append([float(single_prices)])
y_parameter.append(float(single_value))
return x_parameter,y_parameter
parx,pary = get_data(sagdat)
print (parx)
print(pary)
#Linear model
def linear_model_main(X_parameters,Y_parameters,predict_value):
#Regression
regressn = linear_model.LinearRegression()
sagdat
elf=sagdat.loc[sagdat['Product'] == 'Fridge']
trnsdata = elf.drop(['Price','Shipping','Customer','Region','Product'], axis=1)
trnsdata
elf=sagdat.loc[sagdat['Product'] == 'Fridge']
trnsdata = elf.drop(['Price','Shipping','Customer','Region','Product'], axis=1)
trnsdata
eler = LinearRegression()
knumberfolds = cv.KFold(X.shape[0], n_folds=4, shuffle=True, random_state=42)
scrs = cv.cross_val_score(eler, X, y, cv=knumberfolds)
print("Accuracy: %0.2f (+/- %0.2f)" % (scrs.mean(), scrs.std()))
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn import datasets, linear_model
def get_data(file_name):
x_parameter = []
y_parameter = []
for single_prices ,single_value in
zip(sagdat['monthly_sales($)'],sagdat['customers_count ']):
x_parameter.append([float(single_prices)])
y_parameter.append(float(single_value))
return x_parameter,y_parameter
parx,pary = get_data(sagdat)
print (parx)
print(pary)
#Linear model
def linear_model_main(X_parameters,Y_parameters,predict_value):
#Regression
regressn = linear_model.LinearRegression()
21Business Data Analysis
regressn.fit(X_parameters, Y_parameters)
predict_outcome = regressn.predict(predict_value)
parx,pary = get_data('input_data.csv')
prdctvalu = 2000
predictions = {}
predictions['intercept'] = regressn.intercept_
predictions['predicted_value'] = predict_outcome
predictions['coefficient'] = regressn.coef_
return predictions
outcome= linear_model_main(parx,pary,prdctvalu)
print ("Intercepting value " , outcome['intercept'])
print ("value of the coefficient" , outcome['coefficient'])
print ("Prediction value: ",outcome['predicted_value'])
def show_linear_line(X_parameters,Y_parameters):
regressn = linear_model.LinearRegression()
regressn.fit(X_parameters, Y_parameters)
plt.scatter(X_parameters,Y_parameters,color='red')
plt.plot(X_parameters,regressn.predict(X_parameters),color='blue,linewidth=4)
regressn.fit(X_parameters, Y_parameters)
predict_outcome = regressn.predict(predict_value)
parx,pary = get_data('input_data.csv')
prdctvalu = 2000
predictions = {}
predictions['intercept'] = regressn.intercept_
predictions['predicted_value'] = predict_outcome
predictions['coefficient'] = regressn.coef_
return predictions
outcome= linear_model_main(parx,pary,prdctvalu)
print ("Intercepting value " , outcome['intercept'])
print ("value of the coefficient" , outcome['coefficient'])
print ("Prediction value: ",outcome['predicted_value'])
def show_linear_line(X_parameters,Y_parameters):
regressn = linear_model.LinearRegression()
regressn.fit(X_parameters, Y_parameters)
plt.scatter(X_parameters,Y_parameters,color='red')
plt.plot(X_parameters,regressn.predict(X_parameters),color='blue,linewidth=4)
1 out of 21
Related Documents
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024 | Zucol Services PVT LTD | All rights reserved.