Predictive Analysis of Big Mart Sales
Predictive Analysis of Big Mart Sales
SALES
USING MACHINE LEARNING ALGORITHMS”
By
[Link]. SAI SRIVALLI KUMARI
([Link])
2021-2023
AKKINENI NAGESWARA RAO COLLEGE (AUTONOMOUS)
GUDIVADA
CERTIFICATE
This is to certify that this project work entitled “PREDICTIVE ANALYSIS FOR
BIG MART SALES USING MACHINE LEARNING ALGORITHMS” submitted by
[Link] SRIVALLI KUMARI bearing Regd. No 21054006 is the record work carried out by
her during the period 2021-2023 in partial fulfillment of the requirements for the award of
degree of MASTER OF COMPUTER APPLICATIONS (M.C.A) from Krishna University,
Machilipatnam, Andhra Pradesh.
EXTERNAL EXAMINER
AKKINENI NAGESWARA RAO COLLEGE (AUTONOMOUS)
GUDIVADA
DECLARATION
I hereby declare that this project report entitled “PREDICTIVE ANALYSIS FOR BIG
MART SALES USING MACHINE LEARNING ALGORITHMS” submitted by me in partial
fulfillment of the requirements for the award of the Degree of Master of Computer Applications is
the record work carried out by me during the final year of M.C.A.
This report has not been submitted previously for the award of any degree or diploma
in this University or any other University or Institution of higher learning
II MC
ABSTRACT
Abstract:
1 ABSTRACT 1-2
2 INDEX 3-4
3 INTRODUCTION 5-10
7 IMPLEMENTATION 27-54
9 CONLUSION 64-65
10 BIBLIOGRAPHY 66-67
11 REFRENCES 68-74
INTRODUCTION
INTRODUCTION
Everyday competitiveness between various shopping centers as and as huge
marts is becoming higher intense, violent just because of the quick
development of global malls also online shopping. Each market seeks to
offer personalized and limited time deals to attract many clients relying on
period of time, so that each item's volume of sales may be estimated for the
organization's stock control, transportation and logistical services. The
current machine learning algorithm is very advanced and provides methods
for predicting or forecasting sales any kind of organization, extremely
beneficial to overcome low – priced used for prediction. Always better
prediction is helpful, both in developing and improving marketing
strategies for the marketplace, which is also particularly helpful
II RELEATED WORK
EXISTING SYSTEM
A great deal of work having been gotten really intended to date the
territory of deals foreseeing. A concise audit of the important work in the
field of big_mart deals is depicted in this part. Numerous other
Measurable methodologies, for example, with regression, (ARIMA) Auto-
Regressive Integrated Moving Average, (ARMA) Auto-Regressive Moving
Average, have been utilized to develop a few deals forecast standards. Be
that as it may, deals anticipating is a refined issue and is influenced by
both outer and inside factors, and there are two significant detriments to
the measurable technique as set out in A. S. Weigand et A mixture
occasional quantum relapse approach and (ARIMA) Auto-Regressive
Integrated Moving Average way to deal with every day food deals
anticipating were recommend by N. S. Arunraj and furthermore found that
the exhibition of the individual model was moderately lower than that of
the crossover model.
and the Radial “Base Function Neural Network (RBFN)” is required to have
an incredible potential for anticipating deals.
Disadvantages
In the existing work, the system doesn’t have techniques to analyze
large scale data sets.
This system is less performance due to lack of Linear Regression
and Ridge Regression models
PRPOSED SYSTEM
The system implemented the architecture Diagram of the proposed model
where they focus on the different algorithm application to the dataset.
Where we are calculating the Accuracy, MAE, MSE, RMSE and final
concluding the best yield algorithm. Here are the following Algorithm are
used.
A. Linear Regression
• Link the data to the least squares line and confirm the model
assumptions using the residual plot (for the constant standard deviation
assumption) and the normal probability plot (for the normal probability
assumption) A transformation might be necessary if the assumptions
made do not appear to be met.
• If required, convert the data to the least square using the transformed
data, construct a regression line.
• If a change has been completed, return to the previous process 1. If not,
continue to phase 5.
B. Ridge Regression
Ridge regression is a model tuning tool used to evaluate any data that
suffers from
multicollinearity issues arise, the least squares are unbiased and the
variances are high, resulting in the expected values being far removed
from the actual values.
Advantages
11
RESEARCH
Social engineering is an interdisciplinary field which involves computer science,
cybersecurity, psychology, social psychology, cognitive science, psycholinguistics,
neuroscience, brain science, etc. In work, human vulnerabilities such as credulity, greed,
ignorance, curiosity, carelessness, helpfulness have been mentioned. Yet only the
human vulnerabilities are not sufficient to describe how social engineering attacks take
effect. For effect mechanism, some works discussed or involved it in different context.
Many scholars, employ Cialdini’s, six principles of influence and persuasion
(reciprocation, commitment and consistency, social proof, liking, authority, scarcity) to
explain the success of social engineering attacks. Literature, also discussed some
psychological principles that exhibit some kind of power to influence or persuade
people and take effect during a social engineering attack (strong affect, overloading,
reciprocation, deceptive relationships, diffusion of responsibility and moral duty,
authority, integrity and consistency). Mitnick and Simon describes social engineering
based on various kinds of deception. Stajano and Wilson discussed seven principles of
scam for system security (distraction, social compliance, herd, dishonesty, kindness,
need and greed, time). Ferreira et al. analyzed the relation (equal, include, overlap)
among the above principles and presented a merged list of social engineering persuasion
principles, i) authority, ii) social proof, iii) liking, similarity & deception, iv)
commitment, reciprocation & consistency, v) distraction. However, the human
vulnerabilities were not carefully concerned in these works, and other aspects of effect
mechanisms are not involved.
In addition, this model clarifies and avoids some mix-up among different entity
types. For instance, impersonation, decoying, human vulnerabilities (friendliness,
12
sympathy, ignorance) and six influence principles are treated as close-access techniques
to exploit someone’s trust in.
3) Moral duty is a kind of social norm in many cultures taking effect by normative
influence: people are influenced to do something the norm requires due to the desire to
be accepted or liked, regardless of their behavior is correct or not.
13
SYSTEM ANALYSIS
14
HARDWARE REQUIREMENTS
➢ Processor - Pentium–IV
➢ RAM - 4 GB (min)
➢ Hard Disk - 20 GB
➢ Keyboard - Standard Windows Keyboard
➢ Mouse - Two or ThreeButton Mouse
➢ Monitor - SVGA
SOFTWARE REQUIREMENTS
Front-End : Python.
Back-End : Django-ORM
15
SYSTEMDESIGN
16
SYSTEM ARCHITECTURE
Service Provider
Login,
Web Server Accepting all Information
Train and Test Data Sets,
View MAE Comparison Results,
Datasets Results Storage View MSE Comparison Results,
View RMSE Comparison
Results,
Accessing
Data Find Big Mart Sale Predicted
Data Set Details,
Process all user Download Trained Data Sets,
queries View All Remote Users.
WEB
Database
Remote User
Tweet Server
REGISTER AND LOGIN,
POST BIG MART SALES PREDICTED DATA S
VIEW YOUR PROFILE.
17
Fig: System Architecture
Response
18
systems that must be constructed. It is used to understand, design, configure and control
information about the systems.
Depending on the development culture, some of these artifacts are treated more or less
formally than others. Such artifacts are not only the deliverables of a project, they are
also critical in controlling, measuring and communicating about a system during its
development and after its development.
The UML addresses the documentation of a system’s architecture and all of its details.
The UML also provides a language for expressing requirements and for tests. Finally,
the UML provides a language for modeling activities of project planning and release
management.
1. Things
2. Relationships
3. Diagrams
Things are the abstractions that are first-class citizens in a model, relationship tie these
things together and diagrams group interesting collections of things.
UML DIAGRAMS
There are following UML diagrams:
1. Use case diagram
2. Class diagram
3. Sequence diagram
19
1. Use Case Diagram
Service
Provider
POST BIG MART SALES Remote User
PREDICTED DATA SETS
VIEW YOUR
PROFILE
20
2. Class Diagram
Service Provider
Login,Train and Test Data Sets, View MAE Comparison Results, View
MSE Comparison Results, View RMSE Comparison Results, Find Big Mart
Methods Sale Predicted Data Set Details, Download Trained Data Sets, View All
Remote Users.
Members
Login
Register
Methods Methods
Login (), Reset (),
Login,
Register ().Register Register (), Reset ()
User Name,Password.
Password Members User Name, Password, E-
Members User Name,
mail, Mobile, Address, DOB,
Gender, Pin code, Image
Remote User
21
3. Sequence Diagram
22
Flow Chart: Remote User.
Start
Login
Yes No
Status
Logout
23
Flow Chart:Service Provider
Start
Login
Yes No
Status
Log Out
View MSE Comparison Results
24
PRELIMINARY INVESTIGATION
The first and foremost strategy for development of a project starts from the thought of
designing a mail enabled platform for a small firm in which it is easy and convenient of
sending and receiving messages, there is a search engine,address book and also
including some entertaining games. When it is approved by the organization and our
project guide the first activity, ie. Preliminary investigation begins. The activity has
three parts:
Request Clarification
Feasibility Study
Request Approval
REQUEST CLARIFICATION
After the approval of the request to the organization and project guide, with an
investigation being considered, the project request must be examined to determine
precisely what the system requires.
Here our project is basically meant for users within the company whose systems can be
interconnected by the Local Area Network (LAN). In today’s busy schedule man need
everything should be provided in a readymade manner. So taking into consideration of
the vastly use of the net in day to day life, the corresponding development of the portal
came into existence.
FEASIBILITY ANALYSIS
Operational Feasibility
Economic Feasibility
Technical Feasibility
25
Operational Feasibility
Operational Feasibility deals with the study of prospects of the system to be developed.
This system operationally eliminates all the tensions of the Admin and helps him in
effectively tracking the project progress. This kind of automation will surely reduce the
time and energy, which previously consumed in manual work. Based on the study, the
system is proved to be operationally feasible.
Economic Feasibility
Technical Feasibility:
According to Roger S. Pressman, Technical Feasibility is the assessment of the
technical resources of the organization. The organization needs IBM compatible
machines with a graphical web browser connected to the Internet and Intranet. The
system is developed for platform independent environment. Java Server Pages,
JavaScript, HTML, SQL server and WebLogic Server are used to develop the system.
The technical feasibility has been carried out. The system is technically feasible for
development and can be developed with the existing facility
REQUEST APPROVAL
Not all request projects are desirable or feasible. Some organization receives so many
project requests from client users that only few of them are pursued. However, those
projects that are both feasible and desirable should be put into schedule. After a project
request is approved, it cost, priority, completion time and personnel requirement is
estimated and used to determine where to add it to any project list. Truly speaking, the
approval of those above factors, development works can be launched.
26
IMPLEMENTATION
27
MODULES: -
Service Provider
In this module, the Service Provider has to login by using valid user name and
password. After login successful he can do some operations such as
Login, Train and Test Data Sets, View MAE Comparison Results, View MSE
Comparison Results, View RMSE Comparison Results, Find Big Mart Sale Predicted
Data Set Details, Download Trained Data Sets, View All Remote Users.
In this module, the admin can view the list of users who all registered. In this, the
admin can view the user’s details such as, user name, email, address and admin
authorize the users.
Remote User
In this module, there are n numbers of users are present. User should register before
doing any operations. Once user registers, their details will be stored to the database.
After registration successful, he has to login by using authorized user name and
password. Once Login is successful user will do some operations like REGISTER
AND LOGIN, POST BIG MART SALES PREDICTED DATA SETS, VIEW
YOUR PROFILE.
28
ALGORITHMS
Decision tree classifiers are used successfully in many diverse areas. Their
most important feature is the capability of capturing descriptive
decision making knowledge from the supplied data. Decision tree can be
generated from training sets. The procedure for such generation based on
the set of objects (S), each belonging to one of the classes C1, C2, …, Ck is
as follows:
Step 1. If all the objects in S belong to the same class, for example Ci, the
decision tree for S consists of a leaf labeled with this class
Step 2. Otherwise, let T be some test with possible outcomes O1, O2, On.
Each object in S has one outcome for T so the test partitions S into subsets
S1, S2, Sn where each object in Si has outcome Oi for T. T becomes the
root of the decision tree and for each outcome Oi we build a subsidiary
decision tree by invoking the same procedure recursively on the set Si.
2. Gradient boosting:
29
boosted trees; it usually outperforms forest. A gradient-boosted trees model
is built in a stage-wise fashion as in other boosting methods, but it
generalizes the other methods by allowing optimization of an
arbitrary differentiable loss function.
Example
30
Logistic regression analysis studies the association between a categorical
dependent variable and a set of independent (explanatory) variables. The
name logistic regression is used when the dependent variable has only two
values, such as 0 and 1 or Yes and No. The name multinomial logistic
regression is usually reserved for the case when the dependent variable has
three or more unique values, such as Married, Single, Divorced, or
Widowed. Although the type of data used for the dependent variable is
different from that of multiple regression, the practical use of the procedure
is similar.
5. Naïve Bayes:
The naive bayes approach is a supervised learning method which is based
on a simplistic hypothesis: it assumes that the presence (or absence) of a
particular feature of a class is unrelated to the presence (or absence) of any
other feature. Yet, despite this, it appears robust and efficient. Its
performance is comparable to other supervised learning techniques.
Various reasons have been advanced in the literature. In this tutorial, we
highlight an explanation based on the representation bias. The naive bayes
classifier is a linear classifier, as well as linear discriminant analysis,
logistic regression or linear SVM (support vector machine). The difference
lies on the method of estimating the parameters of the classifier (the
learning bias).
While the Naive Bayes classifier is widely used in the research world, it is
not widespread among practitioners which want to obtain usable results. On
the one hand, the researchers found especially it is very easy to program
and implement it, its parameters are easy to estimate, learning is very fast
31
even on very large databases, its accuracy is reasonably good in
comparison to the other approaches. On the other hand, the final users do
not obtain a model easy to interpret and deploy, they does not understand
the interest of such a technique.
6. Random Forest:
32
outperform decision trees, but their accuracy is lower than gradient
boosted trees. However, data characteristics can affect their performance.
The first algorithm for random decision forests was created in 1995 by Tin
Kam Ho[1] using the random subspace method, which, in Ho's
formulation, is a way to implement the "stochastic discrimination"
approach to classification proposed by Eugene Kleinberg.
7. SVM:
33
computational resources and less training data, especially for a
multidimensional feature space and when only posterior probabilities are
needed. From a geometric perspective, learning a classifiers equivalent to
finding the equation for a multidimensional surface that best separates the
different classes in the feature space.
TOOLS USED
VISUAL STUDIO CODE
Visual Studio Code is a source-code editor that can be used with a variety of
programming including Java, JavaScript, Go, [Link], Python, C++ and Fortran It is
based on the Electron framework. which is used to develop [Link] Web applications
that run on the Blink layout engine. Visual Studio Code employs the same editor
component (codenamed "Monaco") used in Azure DevOps (formerly called Visual
Studio Online and Visual Studio Team Services).
34
Out of the box, Visual Studio Code includes basic support for most common
programming languages This basic support includes syntax highlighting, bracket
matching, code folding, and configurable snippets. Visual Studio Code also ships with
IntelliSense for JavaScript, TypeScript, JSON, CSS, and HTML, as well as debugging
support for [Link]. Support for additional languages can be provided by freely
available extensions on the VS Code Marketplace.
Instead of a project system, it allows users to open one or more directories,
which can then be saved in workspaces for future reuse. This allows it to operate as a
language-agnostic code editor for any language. It supports many programming
languages and a set of features that differs per language Unwanted files and folders can
be excluded from the project tree via the settings. Many Visual Studio Code features are
not exposed through menus or the user interface but can be accessed via the command
palette.
Many application development projects involve a database of some kind. One typically
manages such a database with a desktop app or a web portal, but a slew of add-ons for
Visual Studio Code let you query databases directly from within the app.
35
APIs allow software components to work together no matter where they live or what
they're built with. A number of add-ons for Visual Studio Code allow you to test APIs
right in the editor, or work with API definition formats. Even before COVID 9 came
along and radically reshaped the way we work, team collaboration tools were already
making it far easier to do things in real time from afar. Time management matters more
than ever, now that more of us than ever work on our own.
Applications of VS Code:
The following applications are available by default in Navigator:
• Web Applications
• Glue viz
• PyCharm
• Orange 3 App
• RStudio
Advanced users can also build their own Navigator applications
Visual Studio Code includes a fully-featured integrated terminal that conveniently starts
at the root of your workspace. It provides integration with the editor to support features
like links and error detection.
Use the Ctrl+ keyboard shortcut with the backtick character.
Use the View > Terminal menu command.
From the Command Palette (Ctrl +Shift+ P), use the View: Toggle Terminal
command.
You can create a new terminal via the Terminal menu with Terminal > New
Terminal.
36
SOFTWARE USED
PYTHON
Python is Interactive: You can actually sit at a Python prompt and interact
with the interpreter directly to write your programs.
History of Python
Python was developed by Guido van Rossum in the late eighties and early nineties at
the National Research Institute for Mathematics and Computer Science in the
Netherlands.
Python is derived from many other languages, including ABC, Modula-3, C, C++,
Algol-68, Smalltalk, and Unix shell and other scripting languages.
37
Python is copyrighted. Like Perl, Python source code is now available under the GNU
General Public License (GPL).
Python is now maintained by a core development team at the institute, although Guido
van Rossum still holds a vital role in directing its progress.
A function is a block of organized, reusable code that is used to perform a single, related
action. Functions provide better modularity for your application and a high degree of
code reusing. Python gives you many built-in functions like print(), etc. but you can also
create your own functions. These functions are called user-defined functions.
Defining a Function
Simple rules to define a function in Python.
Function blocks begin with the keyword def followed by the function name and
parentheses ( ( ) ).
The code block within every function starts with a colon (:) and is indented.
38
function_suite
return[expression]
Calling a Function
Defining a function only gives it a name, specifies the parameters that are to be
included in the function and structures the blocks of [Link] the basic structure of a
function is finalized, you can execute it by calling it from another function or directly
from the Python prompt. Following is the example to call printme() function −
Function Arguments
You can call a function by using the following types of formal arguments:
Required arguments
Keyword arguments
39
Default arguments
Variable-length arguments
Scope of Variables
All variables in a program may not be accessible at all locations in that program. This
depends on where you have declared a variable.
The scope of a variable determines the portion of the program where you can access a
particular identifier. There are two basic scopes of variables in Python
A module allows you to logically organize your Python code. Grouping related code
into a module makes the code easier to understand and use. A module is a Python
object with arbitrarily named attributes that you can bind and [Link], a
module is a file consisting of Python code. A module can define functions, classes and
variables. A module can also include runnable code.
Example:
The Python code for a module named aname normally resides in a file
named [Link]. Here's an example of a simple module, [Link]
return
40
When the interpreter encounters an import statement, it imports the module if the
module is present in the search path. A search path is a list of directories that the
interpreter searches before importing a module. For example, to import the module
[Link], you need to put the following command at the top of the script −
A module is loaded only once, regardless of the number of times it is imported. This
prevents the module execution from happening over and over again if multiple imports
occur.
Packages in Python
A package is a hierarchical file directory structure that defines a single Python
application environment that consists of modules and sub packages and sub-sub
packages.
Consider a file [Link] available in Phone directory. This file has following line of
source code −
defPots():
Similar way, we have another two files having different functions with the same name
as above −
Phone/__init__.py
To make all of your functions available when you've imported Phone,to put explicit
import statements in __init__.py as follows −
41
fromPotsimportPots
fromIsdnimportIsdn
from G3 import G3
After you add these lines to __init__.py, you have all of these classes available when
you import the Phone package.
importPhone
[Link]()
[Link]()
Phone.G3()
RESULT:
I'm 3GPhone
In the above example, we have taken example of a single functions in each file, but
you can keep multiple functions in your files. You can also define different Python
classes in those files and then you can create your packages out of those classes.
The simplest way to produce output is using the print statement where you can pass
zero or more expressions separated by commas. This function converts the expressions
you pass into a string and writes the result to standard output as follows −
42
print"Python is really a great language,","isn't it?"
Result:
Python provides two built-in functions to read a line of text from standard input, which
by default comes from the keyboard. These functions are −
raw input
input
The raw_input([prompt]) function reads one line from standard input and returns it as
a string (removing the trailing newline).
This prompts you to enter any string and it would display same string on the screen.
When I typed "Hello Python!", its output is like this −
43
print"Received input is : ", str
This would produce the following result against the entered input −
Until now, you have been reading and writing to the standard input and output. Now,
we will see how to use actual data files.
Python provides basic functions and methods necessary to manipulate files by default.
You can do most of the file manipulation using a file object.
Before you can read or write a file, you have to open it using Python's built-
in open() function. This function creates a file object, which would be utilized to call
other support methods associated with it.
Syntax
file object= open(file_name [, access_mode][, buffering])
filename: The filename argument is a string value that contains the name of the
file that you want to access.
access mode: The access mode determines the mode in which the file has to be
opened, i.e., read, write, append, etc. A complete list of possible values is given
below in the table. This is optional parameter and the default file access mode
is read (r).
44
buffering: If the buffering value is set to 0, no buffering takes place. If the
buffering value is 1, line buffering is performed while accessing a file. If you
specify the buffering value as an integer greater than 1, then buffering action is
performed with the indicated buffer size. If negative, the buffer size is the
system default (default behaviour).
Attribute Description
[Link] Returns false if space explicitly required with print, true otherwise.
Example
# Open a file
fo = open("[Link]","wb")
print"Name of the file: ", [Link]
print"Closed or not : ", [Link]
print"Opening mode : ", [Link]
print"Softspace flag : ", [Link]
45
The close() Method
The close() method of a file object flushes any unwritten information and closes the
file object, after which no more writing can be [Link] automatically closes a file
when the reference object of a file is reassigned to another file. It is a good practice to
use the close() method to close a file.
Syntax
[Link]();
Example
# Open a file
fo = open("[Link]","wb")
print"Name of the file: ", [Link]
# Close opend file
[Link]()
Result −
The file object provides a set of access methods to make our lives easier. We would see
how to use read() and write() methods to read and write files.
The write() method writes any string to an open file. It is important to note that Python
strings can have binary data and not just [Link] write() method does not add a
newline character ('\n') to the end of the string Syntax
[Link](string);
Here, passed parameter is the content to be written into the opened [Link]
46
# Open a file
fo = open("[Link]","wb")
[Link]("Python is a great language.\nYeah its great!!\n");
The above method would create [Link] file and would write given content in that file
and finally it would close that file. If you would open this file, it would have following
content.
The read() method reads a string from an open file. It is important to note that Python
strings can have binary data. apart from text data.
Syntax
[Link]([count]);
Here, passed parameter is the number of bytes to be read from the opened file. This
method starts reading from the beginning of the file and if count is missing, then it tries
to read as much as possible, maybe until the end of file.
Example
# Open a file
fo = open("[Link]","r+")
str = [Link](10);
print"Read String is : ", str
# Close opend file
47
[Link]()
ReadStringis:Pythonis
File Positions
The tell() method tells you the current position within the file; in other words, the next
read or write will occur at that many bytes from the beginning of the file.
32
The seek(offset[, from]) method changes the current file position. The offset argument
indicates the number of bytes to be moved. The from argument specifies the reference
position from where the bytes are to be moved.
If from is set to 0, it means use the beginning of the file as the reference position and 1
means use the current position as the reference position and if it is set to 2 then the end
of the file would be taken as the reference position.
Example
# Open a file
fo = open("[Link]","r+")
str = [Link](10);
print"Read String is : ", str
48
position = [Link](0,0);
str = [Link](10);
print"Again read String is : ", str
# Close opend file
[Link]()
ReadStringis:Pythonis
Current file position :10
Again read Stringis:Pythonis
Python os module provides methods that help you perform file-processing operations,
such as renaming and deleting files.
To use this module you need to import it first and then you can call any related
functions.
The rename() method takes two arguments, the current filename and the new filename.
Syntax
[Link](current_file_name, new_file_name)
Example
import os
49
The remove() Method
You can use the remove() method to delete files by supplying the name of the file to be
deleted as the argument.
Syntax
[Link](file_name)
Example
#!/usr/bin/python
import os
Directories in Python
All files are contained within various directories, and Python has no problem handling
these too. The os module has several methods that help you create, remove, and change
directories.
You can use the mkdir() method of the os module to create directories in the current
directory. You need to supply an argument to this method which contains the name of
the directory to be created.
Syntax
[Link]("newdir")
Example
#!/usr/bin/python
import os
50
# Create a directory "test"
[Link]("test")
You can use the chdir() method to change the current directory. The chdir() method
takes an argument, which is the name of the directory that you want to make the
current directory.
Syntax
[Link]("newdir")
Example
#!/usr/bin/python
import os
Syntax
[Link]()
Example
import os
51
[Link]()
The rmdir() method deletes the directory, which is passed as an argument in the
method.
Syntax:
[Link]('dirname')
Example
import os
# This would remove "/tmp/test" directory.
[Link]("/tmp/test")
There are three important sources, which provide a wide range of utility methods to
handle and manipulate files & directories on Windows and Unix operating systems.
They are as follows −
File Object Methods: The file object provides functions to manipulate files.
52
Assertions: This would be covered in Assertions in Python
What is Exception?
An exception is an event, which occurs during the execution of a program
that disrupts the normal flow of the program's instructions. In general,
when a Python script encounters a situation that it cannot cope with, it
raises an exception. An exception is a Python object that represents an
error.
Handling an exception
If you have some suspicious code that may raise an exception, you can
defend your program by placing the suspicious code in a try: block. After
the try: block, include an except: statement, followed by a block of code
which handles the problem as elegantly as possible.
The Python standard for database interfaces is the Python DB-API. Most Python
database interfaces adhere to this standard.
You can choose the right database for your application. Python Database API supports
a wide range of database servers such as −
GadFly
mSQL
MySQL
PostgreSQL
Informix
53
Interbase
Oracle
Sybase
The DB API provides a minimal standard for working with databases using Python
structures and syntax wherever possible. This API includes the following:
54
OUTPUT SCREENSHOTS
55
SCREEN SHOTS
Admin Login
56
Admin Home Page
Dataset Training:
57
Data Visualization
58
Testing dataset :
59
Login :
60
Predict sales
61
Code:
from [Link] import Count
from [Link] import Q
from [Link] import render, redirect, get_object_or_404
import datetime
import openpyxl
def login(request):
username = [Link]('username')
password = [Link]('password')
try:
enter =
62
ClientRegister_Model.[Link](username=username,password=password)
[Link]["userid"] = [Link]
return redirect('Add_DataSet_Details')
except:
pass
return render(request,'RUser/[Link]')
def Add_DataSet_Details(request):
if "GET" == [Link]:
return render(request, 'RUser/Add_DataSet_Details.html', {})
else:
excel_file = [Link]["excel_file"]
# you may put validations here to check extension or file size
wb = openpyxl.load_workbook(excel_file)
# getting all sheets
sheets = [Link]
print(sheets)
# getting a particular sheet
worksheet = wb["Sheet1"]
print(worksheet)
# getting active sheet
active_sheet = [Link]
print(active_sheet)
# reading a cell
print(worksheet["A1"].value)
excel_data = list()
# iterating over the rows and
# getting value from each cell in row
for row in worksheet.iter_rows():
row_data = list()
for cell in row:
row_data.append(str([Link]))
print([Link])
excel_data.append(row_data)
Bigmart_model.[Link]().delete()
excel_data})
def Register1(request):
if [Link] == "POST":
username = [Link]('username')
email = [Link]('email')
password = [Link]('password')
phoneno = [Link]('phoneno')
country = [Link]('country')
state = [Link]('state')
city = [Link]('city')
ClientRegister_Model.[Link](username=username, email=email,
password=password, phoneno=phoneno,
63
country=country, state=state, city=city)
def ViewYourProfile(request):
userid = [Link]['userid']
obj = ClientRegister_Model.[Link](id= userid)
return render(request,'RUser/[Link]',{'object':obj})
def Search_DataSets(request):
if [Link] == "POST":
kword = [Link]('keyword')
if [Link] == "POST":
kword = [Link]('keyword')
print(kword)
obj =
Bigmart_model.[Link]().filter(prediction__contains=kword)
64
.
CONCLUSION
65
Conclusion:
In this work, the effectiveness of various algorithms on the data on revenue
and review of, best performance-algorithm, here propose a software to
using regression approach for predicting the sales centered on sales data
from the past the accuracy of linear regression prediction can be enhanced
with this method, polynomial regression, Ridge regression, and Xgboost
regression can be determined. So, we can conclude ridge and Xgboost
regression gives the better prediction with respect to Accuracy, MAE and
RMSE than the Linear and polynomial regression approaches. In future, the
forecasting sales and building a sales plan can help to avoid unforeseen
cash flow and manage production, staff and financing needs more
[Link] future work we can also consider with the ARIMA model
which shows the time series graph.
66
BIBLIOGRAPHY
67
Bibliography: -
68
REFERENCES
69
REFERENCES
[3] Suma, V., and Shavige Malleshwara Hills. "Data Mining based
Prediction of Demand in Indian Market for Refurbished Electronics."
Journal of Soft Computing Paradigm (JSCP) 2, no. 02 (2020): 101-
110
[5][Link] [Accessed:
Oct. 3, 2018]
70
7, JULY 2010 3561.
71