0% found this document useful (0 votes)
19 views63 pages

E-Commerce Recommendation Model Design

The document presents a project report on the design and implementation of an e-commerce recommendation model based on cloud computing, aimed at improving data mining and business intelligence analysis for online retail. It outlines the challenges faced by e-commerce platforms due to the complexity and volume of information and proposes a cloud-based solution to enhance user experience and merchant-customer relationships. The report includes sections on feasibility studies, system analysis, and literature reviews, highlighting the project's significance in the context of modern e-commerce trends.

Uploaded by

vennelavpf
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views63 pages

E-Commerce Recommendation Model Design

The document presents a project report on the design and implementation of an e-commerce recommendation model based on cloud computing, aimed at improving data mining and business intelligence analysis for online retail. It outlines the challenges faced by e-commerce platforms due to the complexity and volume of information and proposes a cloud-based solution to enhance user experience and merchant-customer relationships. The report includes sections on feasibility studies, system analysis, and literature reviews, highlighting the project's significance in the context of modern e-commerce trends.

Uploaded by

vennelavpf
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

A Project Report On

DESIGN AND IMPLEMENTATION OF E-COMMERCE


RECOMMENDATION MODEL BASED ON CLOUD COMPUTING
Submitted by

B. RAMMOHAN (199L1A0513)

N. CHARAN (199X1A05A5)

G. ROOP SAGAR (199L1A0525)

M. RAJU (199L1A0542)

in partial fulfillment for the award of the degree of

BACHELOR OF TECHNOLOGY
in
Computer Science and Engineering
Under the Guidance of

Dr B. NARAYANA BABU
Associate Professor, Department of CSE.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


SIDDARTHA EDUCATIONAL ACADEMY GROUP OF INSTITUTIONS
(Approved by AICTE & Affiliated to JNTU Anantapur)
C. Gollapalli, Tirupati – 517505

(2022-2023)
SIDDARTHA EDUCATIONAL ACADEMY GROUP OF INSTITUTIONS
C. Gollapalli (v), Tirupati - 517 505

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CERTIFICATE

This is to certify that the project entitled “DESIGN AND IMPLEMENTATION OF E-


COMMERCE RECOMMENDATION MODEL BASED ON CLOUD COMPUTING” is the
bonafide work carried out by
B. RAMMOHAN (199L1A0513)
N. CHARAN (199X1A05A5)

G. ROOP SAGAR (199L1A0525)


[Link] (199L1A0542)

B. Tech, students of SEAGI, Affiliated to JNTUA, Anantapur in partial fulfillment of the


requirements for the award of the Degree of BACHELOR OF TECHNOLOGY with the
specialization in COMPUTER SCIENCE AND ENGINEERING during the Academic year
2022-2023.

Signature of the Guide Head of the Department

Viva-Voice held on

Internal Examiner External Examine


ACKNOWLEDGEMENT

All endeavors over a long period can be successful only with the advice and support of many well-
wishers. I take this opportunity to express my gratitude and appreciation to all of them. we wish to
express deep sense of gratitude to my beloved and respected guide Dr B. NARAYANA BABU,
Associate Professor of CSE, Siddartha Educational Academy Group of Institutions, Tirupati, for his
valuable guidance, suggestions and constant encouragement and keen interest enriched throughout
the course of project work.

We extend sincere thanks to the HoD Mr. N. ANAND REDDY for his kind co- operation in
completing and making this project a success.

We extend sincere thanks to the Principal, Prof. K. RAJASEKHAR for his kind co- operation in
completing and making this project a success.

We would like to thank the Management for their kind co-operation and for providing infrastructure
facilities.

We extend thanks to all the Teaching staff of the Department of CSE for their support and
encouragement during the course of my project work. I also thank the non-Teaching staff of CSE
department for being helpful in many ways in successful completion of my work.

Finally, I thank all those who helped me directly or indirectly in successful completion of this project
work.
B. RAMMOHAN (199L1A0513)

[Link] (199X1A05A5)

G. ROOP SAGAR (199L1A0525)

M. RAJU (199L1A0542)
SIDDARTHA EDUCATIONAL ACADEMY GROUP OF INSTITUTIONS

C. GOLLAPALLI, TIRUPATI – 517505 (A.P), INDIA

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Declaration

I hereby declare that the project work entitled “DESIGN AND IMPLEMENTATION OF
E-COMMERCE RECOMMENDATION MODEL BASED ON CLOUD COMPUTING” is
entirely my original work carried out under the guidance of Dr B. NARAYANA BABU,
Department of Computer Science and Engineering, Siddartha Educational Academy Group of
Institutions, C. Gollapalli, Tirupati, JNTUAnantapur, A.P, India for the award of the degree of
BACHELOR OF TECHNOLOGY withthe specialization in COMPUTER SCIENCE AND
ENGINEERING. The results carried out in this project report have not been submitted in a part
or full for the award of any degree or diploma of this or any other university or institute.
B. RAMMOHAN (199L1A0513)

N. CHARAN (199X1A05A5)

G. ROOP SAGAR (199L1A0525)

M. RAJU (199L1A0542)
ABSTRACT

With the continuous expansion of the company's scale, the original offline sales model can no longer meet
the demand. In order to keep up with the current trend of Internet technology, companies need to develop
their own e-commerce platform. With the rapid development of e-commerce, its information structure is
becoming more and more complex, and the amount of information is becoming larger and larger. Users are
often lost in massive commodity information, and merchants cannot establish effective customer
relationships in massive user information. In order to improve the service level and market competitiveness
of Internet commerce, many ecommerce websites begin to introduce data mining technology. According to
users' purchase records and historical browsing records, they can find the goods they like and recommend
them to users. In order to manage massive commodity information and user information more efficiently,
this paper proposes a solution to build e-commerce recommendation system on the cloud computing
platform to improve the ability of massive data mining and business intelligence analysis, and realize high-
performance computing at a lower cost.
CONTENTS

1. INTRODUCTION 1-2

2. LITERATURE SURVEVEY 2-3

3. SYSTEM STUDY 4-5

Feasibility Study
Economical Feasibility
Technical Feasibility

Social Feasibility

4. SYSTEM ANALYSIS 6-7

Existing System
Disadvantages of Existing System
Proposed System
Advantages of Proposed System

5. SYSTEM SPECIFICATION 8

Hardware Requirements
Software Requirements

6. SOFTWARE ENVIRONMENT 9-27

6.1 Python
6.2 Django

7. SYSTEM DESIGN 28-36

7.1 System Architecture

7.2 Data Flow Diagram

7.3 UML Diagrams

7.4 Input &Output Design


8. IMPLEMENTATION 37-38

9. SAMPLE CODE 39-44

10. SCREENSHOTS 45-49

11. SYSTEM TESTING 51-53

12. CONCLUSION 54

13. BIBLIOGRAPHY 55
List of Figures

6.2. Django 20

7.1 System Architecture 28

7.2 Data Flow Diagram 29

7.3.1 Use case Diagram 31

7.3.2 Class Diagram 32

7.3.3 Sequence Diagram 33

7.3.4 Activity Diagram 34

10 Screenshots 45-49
Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

INTRODUCTION
With the rapid development of e-commerce, its information structure is becoming more and more complex,
and the amount of information is becoming more and more huge. Users are often lost in massive commodity
information, and businesses cannot establish effective customer relationships in massive user information.
Ecommerce has also entered the era of big data. E-commerce platform aggregates a large number of
commodity resources and customers, which not only brings more choices to customers, but also causes the
dilemma of customers' sea election resources. In the current environment, ecommerce is developing rapidly.
Because of the increasing information structure and information amount, many users will get lost in the
massive commodity information. In this case, merchants can't establish a continuous and effective customer
relationship with users in the mass of user information . With the development of e-commerce in the era of
big data, the amount of data in its field is growing geometrically, and the content of goods is rich and varied,
which not only provides users with a wide range of goods, but also provides users with richer choices. As
an important tool of e-commerce, the development of recommendation engine is also limited. The proposal
and development of cloud computing has laid a foundation for the e-commerce recommendation engine to
handle massive data and its application in clusters. With the increasing amount of information in e-
commerce, it takes a lot of time for consumers to find satisfactory information. For merchants, how to
optimize the design of websites according to consumers' interests as much as possible to facilitate consumers'
shopping has become an urgent problem to be solved. With the increasing amount of information,
recommendation system has become an indispensable part of every e-commerce platform. In order to
improve the service level and market competitiveness of Internet commerce, many e-commerce websites
began to introduce data mining technology. According to users' purchase records and historical browsing
records, they found products that users like and recommended them to users. As a platform for customers to
shop online, e-commerce websites hope to recommend products that may be of interest to customers more
accurately by using more efficient recommendation technology. Customization, personalization and
differentiation have become the core competitiveness of enterprises. The two major trends and challenges
of data analysis are: the expansion of data volume and the increasing demand for deep data analysis. E-
commerce recommendation system can capture key data from rich data information, tap potential customers
for businesses, expand sales scope, and provide product recommendation for old customers and expand user
groups. In order to manage massive commodity information and user information more efficiently, this
paper proposes a solution to build e-commerce recommendation system on the basic platform of cloud
computing, so as to improve the ability of massive data mining and business intelligence analysis, and
achieve high-performance computing at a lower cost.

Dept. of CSE, SEAGI, TIRUPATI 1


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

LITERATURE SURVEY

1) A Framework to Secure Medical Image Storage in Cloud Computing Environment.

AUTHORS:Marwan M, Kartit A, Ouahmane H .


Nowadays, modern healthcare providers create massive medical images every day because of the recent
progress in imaging tools. This is generally due to the increasing number of patients demanding medical
services. This has resulted in a continuous demand of a large storage space. Unfortunately, healthcare
domains still use local data centers for storing medical data and managing business processes. This has
significant negative impacts on operating costs associated with licensing fees and maintenance. To
overcome these challenges, healthcare organizations are interested in adopting cloud storage rather than on-
premise hosted solutions. This is mainly justified by the scalability, cost savings and availability of cloud
services. The primary objective of this model is to outsource data and delegate IT computations to an
external party.
2) Outlining the Issues of Cloud Computing and Sustainability

AUTHORS: Isaias P, Issa T, Chang V, et al.


Cloud computing and sustainability have become part of a core strategy in organizations globally and
locally, since their characteristics assist both businesses and individuals to become unique and exclusive in
their work and study. Businesses and individuals should integrate sustainability in their strategy and to
include cloud computing technology as a tool for sustainable work, especially in the Information Technology
(IT) departments to cut costs and increase efficiencies and productivity. This paper examines European
organizations' awareness of cloud computing and sustainability opportunities and risks, via an online survey
targeting 56 Information Technology managers in Europe. A Cloud Computing Conceptual model was
developed using structural equation modeling (SEM) to evaluate the survey results. The study results
confirmed that cloud computing technology opportunities, including sustainability in the organization's

3) About the services of big data and cloud computing for e-commere.
AUTHORS: E. Abrahamsen, O. M. Brastein, and B. Lie
Cloud hosting provides an alternative to on-site devices. Instead of storing data on one computer, cloud
technology allows keeping information on different devices. These devices rely on separate servers located
quite far from each other. However, each machine is interconnected and works as a unified system. Most e-
Commerce businesses use a hosting server to harness the processing power of several devices. Thus, they
create a cluster of servers. And this cluster is called a cloud. Online stores have different functionality than
other sites. They need additional support and flexibility to maintain databases, protect personal data, process
payments, and track sales. Therefore, adopting or migrating to the cloud is an excellent solution to problems
other devices can’t solve.

Dept. of CSE, SEAGI, TIRUPATI 2


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

4) Information Systems Frontiers.

AUTHORS: M. Holmstrom, D. Liu, and C. Vo.

There can be no doubt that contemporary developments in information technology, including information
systems developments, have changed business and organizational practices in many ways. For example, the
world's financial systems are so closely coupled that that a small decrease in interest rates in the United
States may cause a disproportionately large rise in stock market values in South East Asia. The information
revolution has created entirely new ways of marketing, such that we now see very changed relationships
between producers, distributors and customers. It has also led to changes in the way in which organizations
are managed, the way in which they are structured, and the way in which they deal with their products and
services. In particular, it creates a number of opportunities and challenges that affect the way in which data
is converted into information and then into knowledge. It poses many opportunities for management of the
environment for these transfers, such as to enhance the productivity of individuals and organizations. This
paper discuses interactions and intersections between organizations, information technology and
information systems, and the ways in which the creative use of information systems changes organizational
environments

5) Research on e-commerce data caching based on cloud computing

AUTHORS: Zhang Lan.


Judging from the current situation, China’s e-commerce companies are developing more and more rapidly,
and the sales records of e-commerce platforms continue to break through. However, in this rapid
development, many problems have been exposed. Because B2C e-commerce business management methods
are different from traditional business management methods, there are many fundamental differences
between the risks faced by traditional e-commerce companies and traditional enterprises. Compared with
traditional enterprises, the risks faced by e-commerce enterprises have greater uncertainty and complexity,
and the related risk management measures have not fully kept up with the development speed of B2C e-
commerce and are still in the stage of continuous exploration. With the popularity of e-commerce and higher
applicability, the research on e-commerce data management model is urgent. In order to study the e-
commerce data management model, theoretical research and commercial application of cloud computing
are discussed in depth from literature analysis, comparative analysis, graphical analysis, and case analysis.

Dept. of CSE, SEAGI, TIRUPATI 3


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

SYSTEM STUDY

FEASIBILITY STUDY

The feasibility of the project is analyzed in this phase and business proposal is put forth with a
very general plan for the project and some cost estimates. During system analysis the feasibility study of
the proposed system is to be carried out. This is to ensure that the proposed system is not a burden to the
company. For feasibility analysis, some understanding of the major requirements for the system is
essential.

Three key considerations involved in the feasibility analysis are,

 ECONOMICAL FEASIBILITY
 TECHNICAL FEASIBILITY
 SOCIAL FEASIBILITY

ECONOMICAL FEASIBILITY

This study is carried out to check the economic impact that the system will have on the organization.
The amount of fund that the company can pour into the research and development of the system is limited.
The expenditures must be justified. Thus the developed system as well within the budget and this was
achieved because most of the technologies used are freely available. Only the customized products had to
be purchased.

TECHNICAL FEASIBILITY
This study is carried out to check the technical feasibility, that is, the technical requirements
of the system. Any system developed must not have a high demand on the available technical resources.
This will lead to high demands on the available technical resources. This will lead to high demands being
placed on the client. The developed system must have a modest requirement, as only minimal or null changes
are required for implementing this system.

SOCIAL FEASIBILITY

The aspect of study is to check the level of acceptance of the system by the user. This includes the
process of training the user to use the system efficiently. The user must not feel threatened by the system,
instead must accept it as a necessity. The level of acceptance by the users solely depends on the methods
that are employed to educate the user about the system and to make him familiar with it. His level of

Dept. of CSE, SEAGI, TIRUPATI 4


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
confidence must be raised so that he is also able to make some constructive criticism, which is welcomed,
as he is the final user of the system.

The user must not feel threatened by the system, instead must accept it as a necessity. The level of acceptance
by the users solely depends on the methods that are employed to educate the user about the system and to
make him familiar with it. His level of confidence must be raised so that he is also able to make some
constructive criticism, which is welcomed, as he is the final user of the system.

Dept. of CSE, SEAGI, TIRUPATI 5


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

SYSTEM ANALYSIS

EXISTING SYSTEM:
The huge data scale brought by big data environment makes it difficult for traditional data processing
methods to meet the data processing requirements in this environment. In the existing online e-commerce
platform, in order to make online shopping convenient and fast for users, the advertising space on each page
is manually configured for commodity recommendation. Doing so not only makes all users see the same
results, but also increases the workload of background configuration. At this time, it is necessary to establish
a recommendation system to provide different products for different users. An e-commerce platform often
includes many modules, including commodity management, order management, inventory management,
store management, sales management, user management and other modules, which together constitute the
overall framework of the existing e-commerce platform . In the big data environment, the data scale is
usually tens of millions or even billions. In this context, data mining will face serious scalability problems,
and cloud computing is considered as an effective means to solve this problem.

DISADVANTAGES OF EXISTING SYSTEM:


 Users are often lost in massive commodity information, and businesses cannot establish
effective customer relationships in massive user information.
 user-based recommendation system can not expand users' interests.

Dept. of CSE, SEAGI, TIRUPATI 6


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

PROPOSED SYSTEM:
E-commerce recommendation system can capture key data from rich data information, tap potential
customers for businesses, expand sales scope, and provide product recommendation for old customers and
expand user groups .In order to manage massive commodity information and user information more
efficiently, this paper proposes a solution to build e-commerce recommendation system on the basic
platform of cloud computing, so as to improve the ability of massive data mining and business intelligence
analysis, and achieve high-performance computing at a lower cost.

ADVANTAGES OF PROPOSED SYSTEM:


 e-commerce recommendation system on the basic platform of cloud computing.
 cloud computing is considered as an effective means to solve this problem

 Using recommendation algorithms such as data mining can recommend products that
users like to consumers and improve the turnover rate of e-commerce websites.
 Algorithm: matrix factorization, Singular value decomposition.

Dept. of CSE, SEAGI, TIRUPATI 7


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

SYSTEM SPECIFICATION

HARDWARE REQUIREMENTS:

 System : Intel i3

 Hard Disk : 1 TB.

 Monitor : 14’ Color Monitor.

 Mouse : Optical Mouse.

 Ram : 4GB.

SOFTWARE REQUIREMENTS:

 Operating system : Windows 10.

 Coding Language : Python.

 Front-End : Html. CSS

 Designing : HTML, CSS, JavaScript

 Data Base : SQLite.

Dept. of CSE, SEAGI, TIRUPATI 8


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

PYTHON
Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language.
An interpreted language, Python has a design philosophy that emphasizes code readability (notably
using whitespace indentation to delimit code blocks rather than curly brackets or keywords), and a syntax
that allows programmers to express concepts in fewer lines of code than might be used in languages such
as C++or Java. It provides constructs that enable clear programming on both small and large scales. Python
interpreters are available for many operating systems. Python, the reference implementation of Python,
is open source software and has a community-based development model, as do nearly all of its variant
implementations. Python is managed by the non-profit Python Software Foundation. Python features
a dynamic type system and automatic memory management. It supports multiple programming paradigms,
including object-oriented, imperative, functional and procedural, and has a large and
comprehensive standard library.

Interactive Mode Programming


Invoking the interpreter without passing a script file as a parameter brings up the following prompt −
$ python
Python 2.4.3 (#1, Nov 11 2010, 13:34:43)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Type the following text at the Python prompt and press the Enter −
>>> print "Hello, Python!"
If you are running new version of Python, then you would need to use print statement with parenthesis as in
print ("Hello, Python!");. However in Python version 2.4.3, this produces the following result −
Hello, Python!

Script Mode Programming


Invoking the interpreter with a script parameter begins execution of the script and continues until the script
is finished. When the script is finished, the interpreter is no longer active.
Let us write a simple Python program in a script. Python files have extension .py Type the following source
code in a [Link] file −
Live Demo

print "Hello, Python!"

Dept. of CSE, SEAGI, TIRUPATI 9


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
We assume that you have Python interpreter set in PATH variable. Now, try to run this program as follows

$ python [Link]
This produces the following result −
Hello, Python!
Let us try another way to execute a Python script. Here is the modified [Link] file −
Live Demo
#!/usr/bin/python
print "Hello, Python!"
We assume that you have Python interpreter available in /usr/bin directory. Now, try to run this program as
follows −
$ chmod +x [Link] # This is to make file executable
$./[Link]
This produces the following result −
Hello, Python!
Python Identifiers
A Python identifier is a name used to identify a variable, function, class, module or other object. An identifier
starts with a letter A to Z or a to z or an underscore (_) followed by zero or more letters, underscores and
digits (0 to 9).
Python does not allow punctuation characters such as @, $, and % within identifiers. Python is a case
sensitive programming language. Thus, Manpower and manpower are two different identifiers in Python.
Here are naming conventions for Python identifiers −
Class names start with an uppercase letter. All other identifiers start with a lowercase letter.
Starting an identifier with a single leading underscore indicates that the identifier is private.
Starting an identifier with two leading underscores indicates a strongly private identifier.
If the identifier also ends with two trailing underscores, the identifier is a language-defined special name.

Reserved Words
The following list shows the Python keywords. These are reserved words and you cannot use them as
constant or variable or any other identifier names. All the Python keywords contain lowercase letters only.
And exec not assert finally or break for pass class from print continue global raise def if return del import
try elif in while else is with expect lambda yield Lines and Indentation Python provides no braces to
indicate blocks of code for class and function definitions or flow control. Blocks of code are denoted by
line indentation, which is rigidly enforced.
The number of spaces in the indentation is variable, but all statements within the block must be indented the

Dept. of CSE, SEAGI, TIRUPATI 10


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
same amount. For example −
if True:
print "True"
else:
print "False"

However, the following block generates an error −


if True:
print "Answer"
print "True"
else:
print "Answer"
print "False"
Thus, in Python all the continuous lines indented with same number of spaces would form a block. The
following example has various statement blocks −

Note − Do not try to understand the logic at this point of time. Just make sure you understood various blocks
even if they are without braces.
#!/usr/bin/python
import sys
try:
# open file stream
file = open(file_name, "w")
except IOError:
print "There was an error writing to", file_name
[Link]()
print "Enter '", file_finish,
print "' When finished"
while file_text != file_finish:
file_text = raw_input("Enter text: ")
if file_text == file_finish:
# close the file
[Link]
break
[Link](file_text)

Dept. of CSE, SEAGI, TIRUPATI 11


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
[Link]("\n")
[Link]()
file_name = raw_input("Enter filename: ")
if len(file_name) == 0:
print "Next time please enter something"
[Link]()
try:
file = open(file_name, "r")
except IOError:
print "There was an error reading file"
[Link]()
file_text = [Link]()
[Link]()
print file_text
Multi-Line Statements
Statements in Python typically end with a new line. Python does, however, allow the use of the line
continuation character (\) to denote that the line should continue. For example −

total = item_one + \
item_two + \

item_three
Statements contained within the [], {}, or () brackets do not need to use the line continuation character. For
example −

days = ['Monday', 'Tuesday', 'Wednesday',


'Thursday', 'Friday']
Quotation in Python
Python accepts single ('), double (") and triple (''' or """) quotes to denote string literals, as long as the same
type of quote starts and ends the string.

The triple quotes are used to span the string across multiple lines. For example, all the following are legal −

word = 'word'
sentence = "This is a sentence."

Dept. of CSE, SEAGI, TIRUPATI 12


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
paragraph = """This is a paragraph. It is
made up of multiple lines and sentences."""
Comments in Python
A hash sign (#) that is not inside a string literal begins a comment. All characters after the # and up to the
end of the physical line are part of the comment and the Python interpreter ignores them.

Live Demo
#!/usr/bin/python
# First comment
print "Hello, Python!" # second comment
This produces the following result −
Hello, Python!
You can type a comment on the same line after a statement or expression −
name = "Madisetti" # This is again comment
You can comment multiple lines as follows −
# This is a comment.
# This is a comment, too.
# This is a comment, too.
# I said that already.
Following triple-quoted string is also ignored by Python interpreter and can be used as a multiline

comments:
'''
This is a multiline
comment.
'''
Using Blank Lines
A line containing only whitespace, possibly with a comment, is known as a blank line and Python totally
ignores it.
In an interactive interpreter session, you must enter an empty physical line to terminate a multiline statement.
Waiting for the User
The following line of the program displays the prompt, the statement saying “Press the enter key to exit”,
and waits for the user to take action −
#!/usr/bin/python
raw_input("\n\nPress the enter key to exit.")

Dept. of CSE, SEAGI, TIRUPATI 13


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
Here, "\n\n" is used to create two new lines before displaying the actual line. Once the user presses the key,
the program ends. This is a nice trick to keep a console window open until the user is done with an
application.
Multiple Statements on a Single Line
The semicolon ( ; ) allows multiple statements on the single line given that neither statement starts a new
code block. Here is a sample snip using the semicolon.
import sys; x = 'foo'; [Link](x + '\n')
Multiple Statement Groups as Suites
A group of individual statements, which make a single code block are called suites in Python. Compound
or complex statements, such as if, while, def, and class require a header line and a suite.
Header lines begin the statement (with the keyword) and terminate with a colon ( : ) and are followed by
one or more lines which make up the suite. For example −
if expression :
suite
elif expression :
suite
else :
suite
Command Line Arguments
Many programs can be run to provide you with some basic information about how they should be run.
Python enables you to do this with -h −
$ python -h
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Options and arguments (and corresponding environment variables):
-c cmd : program passed in as string (terminates option list)
-d : debug output from parser (also PYTHONDEBUG=x)
-E : ignore environment variables (such as PYTHONPATH)
-h : print this help message and exit
You can also program your script in such a way that it should accept various options. Command Line
Arguments is an advanced topic and should be studied a bit later once you have gone through rest of the
Python concepts.
Python Lists
The list is a most versatile datatype available in Python which can be written as a list of comma-separated
values (items) between square brackets. Important thing about a list is that items in a list need not be of the
same type.

Dept. of CSE, SEAGI, TIRUPATI 14


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
Creating a list is as simple as putting different comma-separated values between square brackets. For
example −
list1 = ['physics', 'chemistry', 1997, 2000];
list2 = [1, 2, 3, 4, 5 ];
list3 = ["a", "b", "c", "d"]
Similar to string indices, list indices start at 0, and lists can be sliced, concatenated and so on.
A tuple is a sequence of immutable Python objects. Tuples are sequences, just like lists. The differences
between tuples and lists are, the tuples cannot be changed unlike lists and tuples use parentheses, whereas
lists use square brackets.
Creating a tuple is as simple as putting different comma-separated values. Optionally you can put these
comma-separated values between parentheses also. For example −
tup1 = ('physics', 'chemistry', 1997, 2000);
tup2 = (1, 2, 3, 4, 5 );
tup3 = "a", "b", "c", "d";
The empty tuple is written as two parentheses containing nothing −
tup1 = ();
To write a tuple containing a single value you have to include a comma, even though there is only one
value −
tup1 = (50,);
Like string indices, tuple indices start at 0, and they can be sliced, concatenated, and so on.
Accessing Values in Tuples
To access values in tuple, use the square brackets for slicing along with the index or indices to obtain value
available at that index. For example −
Live Demo
#!/usr/bin/python
tup1 = ('physics', 'chemistry', 1997, 2000);
tup2 = (1, 2, 3, 4, 5, 6, 7 );
print "tup1[0]: ", tup1[0];
print "tup2[1:5]: ", tup2[1:5];
When the above code is executed, it produces the following result −
tup1[0]: physics
tup2[1:5]: [2, 3, 4, 5]
Updating Tuples
Accessing Values in Dictionary
To access dictionary elements, you can use the familiar square brackets along with the key to obtain its

Dept. of CSE, SEAGI, TIRUPATI 15


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
value. Following is a simple example −
Live Demo
#!/usr/bin/python
dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}
print "dict['Name']: ", dict['Name']
print "dict['Age']: ", dict['Age']
When the above code is executed, it produces the following result −
dict['Name']: Zara
dict['Age']: 7
If we attempt to access a data item with a key, which is not part of the dictionary, we get an error as follows

Live Demo
#!/usr/bin/python
dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}
print "dict['Alice']: ", dict['Alice']
When the above code is executed, it produces the following result −

dict['Alice']:
Traceback (most recent call last):
File "[Link]", line 4, in <module>
print "dict['Alice']: ", dict['Alice'];
KeyError: 'Alice'
Updating Dictionary
You can update a dictionary by adding a new entry or a key-value pair, modifying an existing entry, or
deleting an existing entry as shown below in the simple example −
Live Demo
#!/usr/bin/python
dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}
dict['Age'] = 8; # update existing entry
dict['School'] = "DPS School"; # Add new entry
print "dict['Age']: ", dict['Age']
print "dict['School']: ", dict['School']
When the above code is executed, it produces the following result −
dict['Age']: 8
dict['School']: DPS School

Dept. of CSE, SEAGI, TIRUPATI 16


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
Delete Dictionary Elements
You can either remove individual dictionary elements or clear the entire contents of a dictionary. You can
also delete entire dictionary in a single operation.
To explicitly remove an entire dictionary, just use the del statement. Following is a simple example −
Live Demo
#!/usr/bin/python
dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}
del dict['Name']; # remove entry with key 'Name'
[Link](); # remove all entries in dict
del dict ; # delete entire dictionary
print "dict['Age']: ", dict['Age']
print "dict['School']: ", dict['School']
This produces the following result. Note that an exception is raised because after del dict dictionary does
not exist any more −
dict['Age']:
Traceback (most recent call last):
File "[Link]", line 8, in <module>
print "dict['Age']: ", dict['Age'];

TypeError: 'type' object is unsubscriptable


Note − del() method is discussed in subsequent section.
Properties of Dictionary Keys
Dictionary values have no restrictions. They can be any arbitrary Python object, either standard objects or
user-defined objects. However, same is not true for the keys.
There are two important points to remember about dictionary keys −
(a) More than one entry per key not allowed. Which means no duplicate key is allowed. When duplicate
keys encountered during assignment, the last assignment wins. For example
Live Demo
#!/usr/bin/python
dict = {'Name': 'Zara', 'Age': 7, 'Name': 'Manni'}
print "dict['Name']: ", dict['Name']
When the above code is executed, it produces the following result −
dict['Name']: Manni
(b) Keys must be immutable. Which means you can use strings, numbers or tuples as dictionary keys but
something like ['key'] is not allowed. Following is a simple example −

Dept. of CSE, SEAGI, TIRUPATI 17


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
Live Demo
#!/usr/bin/python
dict = {['Name']: 'Zara', 'Age': 7}
print "dict['Name']: ", dict['Name']
When the above code is executed, it produces the following result −
Traceback (most recent call last):
File "[Link]", line 3, in <module>
dict = {['Name']: 'Zara', 'Age': 7};
TypeError: unhashable type: 'list'
Tuples are immutable which means you cannot update or change the values of tuple elements. You are able
to take portions of existing tuples to create new tuples as the following example demonstrates −
Live Demo
#!/usr/bin/python
tup1 = (12, 34.56);
tup2 = ('abc', 'xyz');
# Following action is not valid for tuples
# tup1[0] = 100;
# So let's create a new tuple as follows
tup3 = tup1 + tup2;

print tup3;
When the above code is executed, it produces the following result −
(12, 34.56, 'abc', 'xyz')
Delete Tuple Elements
Removing individual tuple elements is not possible. There is, of course, nothing wrong with putting together
another tuple with the undesired elements discarded.
To explicitly remove an entire tuple, just use the del statement. For example −
Live Demo
#!/usr/bin/python
tup = ('physics', 'chemistry', 1997, 2000);
print tup;
del tup;
print "After deleting tup : ";
print tup;
This produces the following result. Note an exception raised, this is because after del tup tuple does not exist

Dept. of CSE, SEAGI, TIRUPATI 18


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
any more −
('physics', 'chemistry', 1997, 2000)
After deleting tup :
Traceback (most recent call last):
File "[Link]", line 9, in <module>
print tup;
NameError: name 'tup' is not defined

Dept. of CSE, SEAGI, TIRUPATI 19


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

DJANGO
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic
design. Built by experienced developers, it takes care of much of the hassle of Web development, so you
can focus on writing your app without needing to reinvent the wheel. It’s free and open source.

Django's primary goal is to ease the creation of complex, database-driven websites. Django
emphasizes reusability and "pluggability" of components, rapid development, and the principle of don't
repeat yourself. Python is used throughout, even for settings files and data models.

Django also provides an optional administrative create, read, update and delete interface that is generated
dynamically through introspection and configured via admin models

Dept. of CSE, SEAGI, TIRUPATI 20


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

Create a Project
Whether you are on Windows or Linux, just get a terminal or a cmd prompt and navigate to the place you
want your project to be created, then use this code −
$ django-admin startproject myproject
This will create a "myproject" folder with the following structure −
myproject/
[Link]
myproject/

__init__.py
[Link]
[Link]
[Link]
The Project Structure
The “myproject” folder is just your project container, it actually contains two elements −
[Link] − This file is kind of your project local django-admin for interacting with your project via
command line (start the development server, sync db...). To get a full list of command accessible via
[Link] you can use the code −

$ python [Link] help


The “myproject” subfolder − This folder is the actual python package of your project. It contains four files

__init__.py − Just for python, treat this folder as package.

Dept. of CSE, SEAGI, TIRUPATI 21


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
[Link] − As the name indicates, your project settings.
[Link] − All links of your project and the function to call. A kind of ToC of your project.
[Link] − If you need to deploy your project over WSGI.
Setting Up Your Project
Your project is set up in the subfolder myproject/[Link]. Following are some important options you
might need to set −
DEBUG = True
This option lets you set if your project is in debug mode or not. Debug mode lets you get more information
about your project's error. Never set it to ‘True’ for a live project. However, this has to be set to ‘True’ if
you want the Django light server to serve static files. Do it only in the development mode.
DATABASES = {
'default': {
'ENGINE': '[Link].sqlite3',
'NAME': '[Link]',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
Database is set in the ‘Database’ dictionary. The example above is for SQLite engine. As stated earlier,

Django also supports −

MySQL ([Link])
PostGreSQL ([Link].postgresql_psycopg2)
Oracle ([Link]) and NoSQL DB
MongoDB (django_mongodb_engine)
Before setting any new engine, make sure you have the correct db driver installed.
You can also set others options like: TIME_ZONE, LANGUAGE_CODE, TEMPLATE…
Now that your project is created and configured make sure it's working −
$ python [Link] runserver
You will get something like the following on running the above code −
Validating models...
0 errors found

Dept. of CSE, SEAGI, TIRUPATI 22


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
September 03, 2015 - 11:41:50
Django version 1.6.11, using settings '[Link]'
Starting development server at [Link]
Quit the server with CONTROL-C.
A project is a sum of many applications. Every application has an objective and can be reused into another
project, like the contact form on a website can be an application, and can be reused for others. See it as a
module of your project.

Create an Application
We assume you are in your project folder. In our main “myproject” folder, the same folder then [Link]

$ python [Link] startapp myapp
You just created myapp application and like project, Django create a “myapp” folder with the application
structure −
myapp/
__init__.py
[Link]
[Link]
[Link]
[Link]
__init__.py − Just to make sure python handles this folder as a package.
[Link] − This file helps you make the app modifiable in the admin interface.
[Link] − This is where all the application models are stored.

[Link] − This is where your unit tests are.


[Link] − This is where your application views are.
Get the Project to Know About Your Application
At this stage we have our "myapp" application, now we need to register it with our Django project
"myproject". To do so, update INSTALLED_APPS tuple in the [Link] file of your project (add your
app name) −
INSTALLED_APPS = (
'[Link]',
'[Link]',
'[Link]',
'[Link]',

Dept. of CSE, SEAGI, TIRUPATI 23


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
'[Link]',
'[Link]',
'myapp',
)
Creating forms in Django, is really similar to creating a model. Here again, we just need to inherit from
Django class and the class attributes will be the form fields. Let's add a [Link] file in myapp folder to
contain our app forms. We will create a login form.
myapp/[Link]
#-*- coding: utf-8 -*-
from django import forms
class LoginForm([Link]):
user = [Link](max_length = 100)
password = [Link](widget = [Link]())
As seen above, the field type can take "widget" argument for html rendering; in our case, we want the
password to be hidden, not displayed. Many others widget are present in Django: DateInput for dates,
CheckboxInput for checkboxes, etc.
Using Form in a View
There are two kinds of HTTP requests, GET and POST. In Django, the request object passed as parameter
to your view has an attribute called "method" where the type of the request is set, and all data passed via
POST can be accessed via the [Link] dictionary.
Let's create a login view in our myapp/[Link] −
#-*- coding: utf-8 -*-
from [Link] import LoginForm
def login(request):

username = "not logged in"


if [Link] == "POST":
#Get the posted form
MyLoginForm = LoginForm([Link])
if MyLoginForm.is_valid():
username = MyLoginForm.cleaned_data['username']
else:
MyLoginForm = Loginform()
return render(request, '[Link]', {"username" : username})
The view will display the result of the login form posted through the [Link]. To test it, we will first

Dept. of CSE, SEAGI, TIRUPATI 24


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
need the login form template. Let's call it [Link].
<html>
<body>
<form name = "form" action = "{% url "[Link]" %}"
method = "POST" >{% csrf_token %}

<div style = "max-width:470px;">


<center>
<input type = "text" style = "margin-left:20%;"
placeholder = "Identifiant" name = "username" />
</center>
</div>
<br>
<div style = "max-width:470px;">
<center>
<input type = "password" style = "margin-left:20%;"
placeholder = "password" name = "password" />
</center>
</div>
<br>
<div style = "max-width:470px;">
<center>
<button style = "border:0px; background-color:#4285F4; margin-top:8%;
height:35px; width:80%;margin-left:19%;" type = "submit"
value = "Login" >

<strong>Login</strong>
</button>
</center>
</div>
</form>
</body>
</html>
The template will display a login form and post the result to our login view above. You have probably
noticed the tag in the template, which is just to prevent Cross-site Request Forgery (CSRF) attack on your

Dept. of CSE, SEAGI, TIRUPATI 25


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
site.
{% csrf_token %}
Once we have the login template, we need the [Link] template that will be rendered after form
treatment.
<html>
<body>
You are : <strong>{{username}}</strong>
</body>
</html>
Now, we just need our pair of URLs to get started: myapp/[Link]
from [Link] import patterns, url
from [Link] import TemplateView
urlpatterns = patterns('[Link]',
url(r'^connection/',TemplateView.as_view(template_name = '[Link]')),
url(r'^login/', 'login', name = 'login'))
When accessing "/myapp/connection", we will get the following [Link] template rendered −
Setting Up Sessions
In Django, enabling session is done in your project [Link], by adding some lines to the
MIDDLEWARE_CLASSES and the INSTALLED_APPS options. This should be done while creating the
project, but it's always good to know, so MIDDLEWARE_CLASSES should have −
'[Link]'
And INSTALLED_APPS should have −
'[Link]'
By default, Django saves session information in database (django_session table or collection), but you can
configure the engine to store information using other ways like: in file or in cache.
When session is enabled, every request (first argument of any view in Django) has a session (dict)

attribute.
Let's create a simple sample to see how to create and save sessions. We have built a simple login system
before (see Django form processing chapter and Django Cookies Handling chapter). Let us save the
username in a cookie so, if not signed out, when accessing our login page you won’t see the login form.
Basically, let's make our login system we used in Django Cookies handling more secure, by saving cookies
server side.
For this, first lets change our login view to save our username cookie server side −
def login(request):

Dept. of CSE, SEAGI, TIRUPATI 26


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
username = 'not logged in'
if [Link] == 'POST':
MyLoginForm = LoginForm([Link])
if MyLoginForm.is_valid():
username = MyLoginForm.cleaned_data['username']
[Link]['username'] = username
else:
MyLoginForm = LoginForm()
return render(request, '[Link]', {"username" : username}
Then let us create formView view for the login form, where we won’t display the form if cookie is set −
def formView(request):
if [Link].has_key('username'):
username = [Link]['username']
return render(request, '[Link]', {"username" : username})
else:
return render(request, '[Link]', {})
Now let us change the [Link] file to change the url so it pairs with our new view −
from [Link] import patterns, url
from [Link] import TemplateView
urlpatterns = patterns('[Link]',
url(r'^connection/','formView', name = 'loginform'),
url(r'^login/', 'login', name = 'login'))
When accessing /myapp/connection, you will get to see the following page

Dept. of CSE, SEAGI, TIRUPATI 27


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

SYSTEM DESIGN
Fig 7.1 System Architecture

Dept. of CSE, SEAGI, TIRUPATI 28


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

DATA FLOW DIAGRAM

1. The DFD is also called as bubble chart. It is a simple graphical formalism that can be used to
represent a system in terms of input data to the system, various processing carried out on this data,
and the output data is generated by this system.
2. The data flow diagram (DFD) is one of the most important modeling tools. It is used to model the
system components. These components are the system process, the data used by the process, an
external entity that interacts with the system and the information flows in the system.
3. DFD shows how the information moves through the system and how it is modified by a series of
transformations. It is a graphical technique that depicts information flow and the transformations that
are applied as data moves from input to output.
4. DFD is also known as bubble chart. A DFD may be used to represent a system at any level of
abstraction. DFD may be partitioned into levels that represent increasing information flow and
functional detail.

Dept. of CSE, SEAGI, TIRUPATI 29


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

UML DIAGRAMS

UML stands for Unified Modeling Language. UML is a standardized general-purpose modeling
language in the field of object-oriented software engineering. The standard is managed, and was created by,
the Object Management Group.
The goal is for UML to become a common language for creating models of object oriented computer
software. In its current form UML is comprised of two major components: a Meta-model and a notation. In
the future, some form of method or process may also be added to; or associated with, UML.
The Unified Modeling Language is a standard language for specifying, Visualization, Constructing and
documenting the artifacts of software system, as well as for business modeling and other non-software
systems.
The UML represents a collection of best engineering practices that have proven successful in the
modeling of large and complex systems. The UML is a very important part of developing object oriented
software and the software development process. The UML uses mostly graphical notations to express the
design of software projects.

GOALS:
The Primary goals in the design of the UML are as follows:
1. Provide users a ready-to-use, expressive visual modeling Language so that they can develop and
exchange meaningful models.
2. Provide extendibility and specialization mechanisms to extend the core concepts.
3. Be independent of particular programming languages and development process.
4. Provide a formal basis for understanding the modeling language.
5. Encourage the growth of OO tools market.
6. Support higher level development concepts such as collaborations, frameworks, patterns and
components.
7. Integrate best practices.

Dept. of CSE, SEAGI, TIRUPATI 30


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

USE CASE DIAGRAM

A use case diagram in the Unified Modeling Language (UML) is a type of behavioral diagram
defined by and created from a Use-case analysis. Its purpose is to present a graphical overview of the
functionality provided by a system in terms of actors, their goals (represented as use cases), and any
dependencies between those use cases. The main purpose of a use case diagram is to show what system
functions are performed for which actor. Roles of the actors in the system can be depicted.

Dept. of CSE, SEAGI, TIRUPATI 31


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

CLASS DIAGRAM

In software engineering, a class diagram in the Unified Modeling Language (UML) is a type of static
structure diagram that describes the structure of a system by showing the system's classes, their attributes,
operations (or methods), and the relationships among the classes. It explains which class contains
information.

Dept. of CSE, SEAGI, TIRUPATI 32


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

SEQUENCE DIAGRAM

A sequence diagram in Unified Modeling Language (UML) is a kind of interaction diagram that shows
how processes operate with one another and in what order. It is a construct of a Message Sequence Chart.
Sequence diagrams are sometimes called event diagrams, event scenarios, and timing diagrams.

Dept. of CSE, SEAGI, TIRUPATI 33


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

ACTIVITY DIAGRAM

Activity diagrams are graphical representations of workflows of stepwise activities and actions with support
for choice, iteration and concurrency. In the Unified Modeling Language, activity diagrams can be used to
describe the business and operational step-by-step workflows of components in a system. An activity
diagram shows the overall flow of control.

Dept. of CSE, SEAGI, TIRUPATI 34


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

INPUT AND OUTPUT DESIGN

INPUT DESIGN
The input design is the link between the information system and the user. It comprises the
developing specification and procedures for data preparation and those steps are necessary to put transaction
data in to a usable form for processing can be achieved by inspecting the computer to read data from a
written or printed document or it can occur by having people keying the data directly into the system. The
design of input focuses on controlling the amount of input required, controlling the errors, avoiding delay,
avoiding extra steps and keeping the process simple. The input is designed in such a way so that it provides
security and ease of use with retaining the privacy. Input Design considered the following things:
 What data should be given as input?
 How the data should be arranged or coded?
 The dialog to guide the operating personnel in providing input.
 Methods for preparing input validations and steps to follow when error occur.

OBJECTIVES
[Link] Design is the process of converting a user-oriented description of the input into a
computer-based system. This design is important to avoid errors in the data input process and show the
correct direction to the management for getting correct information from the computerized system.
2. It is achieved by creating user-friendly screens for the data entry to handle large volume of
data. The goal of designing input is to make data entry easier and to be free from errors. The data entry
screen is designed in such a way that all the data manipulates can be performed. It also provides record
viewing facilities.
[Link] the data is entered it will check for its validity. Data can be entered with the help of
screens. Appropriate messages are provided as when needed so that the user will not be in maize of instant.
Thus the objective of input design is to create an input layout that is easy to follow

OUTPUT DESIGN
A quality output is one, which meets the requirements of the end user and presents the
information clearly. In any system results of processing are communicated to the users and to other system
through outputs. In output design it is determined how the information is to be displaced for immediate need
and also the hard copy output. It is the most important and direct source information to the user. Efficient
and intelligent output design improves the system’s relationship to help user decision-making.
1. Designing computer output should proceed in an organized, well thought out manner; the

Dept. of CSE, SEAGI, TIRUPATI 35


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
right output must be developed while ensuring that each output element is designed so that people will find
the system can use easily and effectively. When analysis design computer output, they should Identify the
specific output that is needed to meet the requirements.
[Link] methods for presenting information.
[Link] document, report, or other formats that contain information produced by the system.
The output form of an information system should accomplish one or more of the following
objectives.
 Convey information about past activities, current status or projections of the
 Future.
 Signal important events, opportunities, problems, or warnings.
 Trigger an action and confirm an action.

Dept. of CSE, SEAGI, TIRUPATI 36


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

8. IMPLEMENTATION

Implementation is the stage of the project when the theoretical design is turned out into a working system. Thus, it
can be considered to be the most critical stage in achieving a successful new systemand in giving the user, confidence
that the new system will work and be effective.

The implementation stage involves careful planning, investigation of the existing system and it
constraints on implementation, designing of methods to achieve changeover and evaluation of
changeover methods.

MODULES
 User
 Admin
 Data Preprocessing
 Machine Learning Results
MODULES DESCRIPTION

User:
The User can register the first. While registering he required a valid user email and mobile for further
communications. Once the user register then admin can activate the user. Once admin activated the user
then user can login into our system. User can upload the dataset based on our dataset column matched. For
algorithm execution data must be in float format. Here we took rainfall dataset. User can also add the new
data for existing dataset based on our Django application. User can click the Classification in the web page
so that the data calculated MAE, MSE, LOSS, R2 score, accuracy based on the algorithms.

Admin:
Admin can login with his login details. Admin can activate the registered users. Once he activate then only
the user can login into our system. Admin can view the overall data in the browser. Admin can click the
Results in the web page so calculated MAE, MSE, LOSS, R2 score, accuracy based on the algorithms is
displayed. All algorithms execution complete then admin can see the overall accuracy in web page.

Multiple linear regression (MLR):

Dept. of CSE, SEAGI, TIRUPATI 37


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
the Multiple Linear Regression (MLR) model to predict four weather parameters which are (maximum and
minimum temperature, relative humidity, and the category of rainfall).They have applied two methods to
predict rainfall forecasting rainfall, which are Autocorrelation Function (ACF) and projected error. Both
methods implemented four different regression algorithms (Bayesian Linear Regression, Boosted Decision
Tree Regression, Decision Forest Regression and Neural Network Regression, with different time horizons
(daily, weekly, ten days and monthly),The results showed that Boosted Decision Tree Regression is the best
regression developed for M1, with the highest coefficient of determination, but in M2 the overall model
performance gives a good result of each category except for 10- days with Boosted Decision Tree Regression
and Decision Forest Regression.

Machine learning Results:


Based on the split criterion, the cleansed data is split into 60% training and 40% test, then the dataset
is subjected to six machine learning classifiers such as artificial neural network (ANN), multiple
linear regression (MLR). The MAE of the classifiers was calculated and displayed in my results.
The classifier which bags up the highest accuracy could be determined as the best classifier.

Dept. of CSE, SEAGI, TIRUPATI 38


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

SOURCE CODE
User side views:

# Create your views here.


from [Link] import render, HttpResponse
from [Link] import messages
from .forms import UserRegistrationForm
from .models import UserRegistrationModel
from [Link] import settings

# Create your views here.


def UserRegisterActions(request):
if [Link] == 'POST':
form = UserRegistrationForm([Link])
if form.is_valid():
print('Data is Valid')
[Link]()
[Link](request, 'You have been successfully registered')
form = UserRegistrationForm()
return render(request, '[Link]', {'form': form})
else:
[Link](request, 'Email or Mobile Already Existed')
print("Invalid form")
else:
form = UserRegistrationForm()
return render(request, '[Link]', {'form': form})

def UserLoginCheck(request):
if [Link] == "POST":

Dept. of CSE, SEAGI, TIRUPATI 39


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

loginid = [Link]('loginid')
pswd = [Link]('pswd')
print("Login ID = ", loginid, ' Password = ', pswd)
try:
check = [Link](loginid=loginid, password=pswd)
status = [Link]
print('Status is = ', status)
if status == "activated":
[Link]['id'] = [Link]
[Link]['loggeduser'] = [Link]
[Link]['loginid'] = loginid
[Link]['email'] = [Link]
print("User id At", [Link], status)
return render(request, 'users/[Link]', {})
else:
[Link](request, 'Your Account Not at activated')
return render(request, '[Link]')
except Exception as e:
print('Exception is ', str(e))
pass
[Link](request, 'Invalid Login id and password')
return render(request, '[Link]', {})

def UserHome(request):
return render(request, 'users/[Link]', {})

def DatasetView(request):
path = settings.MEDIA_ROOT + "//" + 'amazon [Link]'

Dept. of CSE, SEAGI, TIRUPATI 40


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

import pandas as pd
df = pd.read_csv(path, nrows=100)
df = [Link](columns=['Uniq Id','Brand Name','Asin','Upc Ean Code', 'List Price','Quantity','About
Product',
'Product Specification','Technical Details','Product Dimensions','Image','Variants',
'Product Url', 'Stock','Product Details','Dimensions','Color','Ingredients','Direction To '
'Use','Is Amazon Seller',
'Size Quantity Variant','Product Description','Sku'])
df = df.to_html
return render(request, 'users/[Link]', {'data': df})

def data_preprocess(request):
from .utility.ecommerce_preprocess import pre_proccessed_data
df = pre_proccessed_data()
return render(request, 'users/pre_process_data.html',{'data': df})

def user_machine_learning(request):
from .[Link] import ml_scores
linear_kernel, cosine_similarity, sig_score = ml_scores()
return render(request,'users/ml_scores.html',{'lr': linear_kernel, 'cosine': cosine_similarity, 'sig':
sig_score})

def user_predictions(request):
if [Link]=='POST':
from .[Link] import rec_lin
productName = [Link]('pname')
recommend = rec_lin(productName)
recom = recommend.to_html
path = settings.MEDIA_ROOT + "//" + 'amazon [Link]'

Dept. of CSE, SEAGI, TIRUPATI 41


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

import pandas as pd
df = pd.read_csv(path)
df = df['Product Name'].[Link]()
return render(request,'users/[Link]',{'result':
recom,'products':df,'productName':productName})
else:
path = settings.MEDIA_ROOT + "//" + 'amazon [Link]'
import pandas as pd
df = pd.read_csv(path)
df = df['Product Name'].[Link]()
return render(request, 'users/[Link]', {'products':df})

[Link]:
{%extends '[Link]'%}
{%load static%}
{%block contents%}

<!-- Header -->


<header>
<div class="container">
<div class="intro-text">
<div class="intro-lead-in">Design and Implementation of E-commerce Recommendation
System Model Based on Cloud Computing</div>
<div class="intro-heading">Product to be Recommend</div>

</div>
</div>
</header>

Dept. of CSE, SEAGI, TIRUPATI 42


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

<!-- Services Section -->


<section id="services">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading">ARCHITECTURE OF E-COMMERCE PERSONALIZED
RECOMMENDATION SYSTEM</h2>
<h3 class="section-subheading text-muted">
E-commerce is becoming a new direction in the development of commodity trading, which
means that trading is no longer restricted by regions, changes the trading form, accelerates the circulation
of commodities, reduces the capital turnover time of enterprises, and facilitates the consumption of
consumers. Therefore, e-commerce has become an indispensable part of the market economy. Cloud
computing provides computing and storage to Internet users in the form of services. The resources used by
users, such as data, servers, application software and development platforms, come from the virtualized
computing center on the Internet, which is responsible for distributing various resources distributed on the
Internet, balancing loads, deploying software, and controlling security.
</h3>
</div>
</div>

</div>
</section>

{%endblock%}

[Link]:

{%extends '[Link]'%}
{% load static %}
{%block contents%}
<header>
<div class="container">
<div class="intro-text">
<h2>Admin Login Form</h2>
<p>

<form action="{%url 'AdminLoginCheck'%}" method="POST" class="text-primary"


style="width:100%">
{% csrf_token %}
<table>
<div class="form-group row">

Dept. of CSE, SEAGI, TIRUPATI 43


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
<div class="col-md-12">
<input type="text" class="form-control" name="loginid" required
placeholder="Enter Login Id">
</div>
</div>
<div class="form-group row">
<div class="col-md-12">
<input type="password" class="form-control" name="pswd" required
placeholder="Enter password">
</div>
</div>

<tr>
<td style="padding:20px;">
<button type="submit" class="btn btn-xl">
Login
</button>
</td>

<td>
<button type="reset" class="btn btn-xl">
Reset
</button>
</td>
</tr>

{% if messages %}
{% for message in messages %}
<font color='GREEN'> {{ message }}</font>
{% endfor %}
{% endif %}

</table>

</form>

</center>
</p>
</div>
</div>
</header>

{%endblock%}

Dept. of CSE, SEAGI, TIRUPATI 44


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

SCREEN SHOTS
Home page

Register Form

Dept. of CSE, SEAGI, TIRUPATI 45


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

Admin Login Page

Admin Home Page

Dept. of CSE, SEAGI, TIRUPATI 46


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

Activate User

User login Page

Dept. of CSE, SEAGI, TIRUPATI 47


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

User homepage

View dataset:

Dept. of CSE, SEAGI, TIRUPATI 48


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

ANN results:

MLR results:

Dept. of CSE, SEAGI, TIRUPATI 49


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

Machine learning results:

Dept. of CSE, SEAGI, TIRUPATI 50


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

SYSTEM TEST
The purpose of testing is to discover errors. Testing is the process of trying to discover every conceivable
fault or weakness in a work product. It provides a way to check the functionality of components, assemblies
and/or a finished product It is the process of exercising software with the intent of ensuring that the Software
system meets its requirements and user expectations and does not fail in an unacceptable manner. There are
various types of test. Each test type addresses a specific testing requirement.

TYPES OF TESTS
Unit testing
Unit testing involves the design of test cases that validate that the internal program logic is
functioning properly, and that program inputs produce valid outputs. All decision branches and internal code
flow should be validated. It is the testing of individual software units of the application .it is done after the
completion of an individual unit before integration. This is a structural testing, that relies on knowledge of
its construction and is invasive. Unit tests perform basic tests at component level and test a specific business
process, application, and/or system configuration. Unit tests ensure that each unique path of a business
process performs accurately to the documented specifications and contains clearly defined inputs and
expected results.

Integration testing
Integration tests are designed to test integrated software components to determine if they
actually run as one program. Testing is event driven and is more concerned with the basic outcome of
screens or fields. Integration tests demonstrate that although the components were individually satisfaction,
as shown by successfully unit testing, the combination of components is correct and consistent. Integration
testing is specifically aimed at exposing the problems that arise from the combination of components.

Functional test
Functional tests provide systematic demonstrations that functions tested are available as specified by the
business and technical requirements, system documentation, and user manuals.
Functional testing is centered on the following items:

Dept. of CSE, SEAGI, TIRUPATI 51


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing
Valid Input : identified classes of valid input must be accepted.
Invalid Input : identified classes of invalid input must be rejected.
Functions : identified functions must be exercised.
Output : identified classes of application outputs must be exercised.
Systems/Procedures : interfacing systems or procedures must be invoked.

Organization and preparation of functional tests is focused on requirements, key functions, or


special test cases. In addition, systematic coverage pertaining to identify Business process flows; data fields,
predefined processes, and successive processes must be considered for testing. Before functional testing is
complete, additional tests are identified and the effective value of current tests is determined.

System Test
System testing ensures that the entire integrated software system meets requirements. It tests
a configuration to ensure known and predictable results. An example of system testing is the configuration
oriented system integration test. System testing is based on process descriptions and flows, emphasizing
pre-driven process links and integration points.

White Box Testing


White Box Testing is a testing in which in which the software tester has knowledge of the
inner workings, structure and language of the software, or at least its purpose. It is purpose. It is used to test
areas that cannot be reached from a black box level.

Black Box Testing


Black Box Testing is testing the software without any knowledge of the inner workings,
structure or language of the module being tested. Black box tests, as most other kinds of tests, must be
written from a definitive source document, such as specification or requirements document, such as
specification or requirements document. It is a testing in which the software under test is treated, as a black
box .you cannot “see” into it. The test provides inputs and responds to outputs without considering how the
software works.

Unit Testing
Unit testing is usually conducted as part of a combined code and unit test phase of the software
lifecycle, although it is not uncommon for coding and unit testing to be conducted as two distinct phases.

Test strategy and approach


Field testing will be performed manually and functional tests will be written in detail.

Dept. of CSE, SEAGI, TIRUPATI 52


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

Test objectives

 All field entries must work properly.


 Pages must be activated from the identified link.
 The entry screen, messages and responses must not be delayed.

Features to be tested
 Verify that the entries are of the correct format
 No duplicate entries should be allowed
 All links should take the user to the correct page.

Integration Testing
Software integration testing is the incremental integration testing of two or more integrated
software components on a single platform to produce failures caused by interface defects.
The task of the integration test is to check that components or software applications, e.g. components in a
software system or – one step up – software applications at the company level – interact without error.
Test Results: All the test cases mentioned above passed successfully. No defects encountered.

Acceptance Testing
User Acceptance Testing is a critical phase of any project and requires significant participation by the end
user. It also ensures that the system meets the functional requirements.

Test Results: All the test cases mentioned above passed successfully. No defects encountered.

Dept. of CSE, SEAGI, TIRUPATI 53


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

CONCLUSION
E-commerce has become the most mainstream business model in contemporary society. With the explosive
growth of information in the era of big data in e-commerce, personalized recommendation system has
attracted more and more attention. E-commerce provides more and more shopping and consumption
platforms for people. Using recommendation algorithms such as data mining can recommend products that
users like to consumers and improve the turnover rate of e-commerce websites. With the rapid development
of internet commercial websites, the total amount of information in e-commerce system is increasing day
by day, and the problem of information overload is becoming more and more serious. Because the
recommendation system is based on user behavior, malicious user behavior should be filtered. Malicious
behaviors include users browsing certain products frequently through programs, creating a large number of
user behaviors, or businesses adjusting commodity attributes according to algorithms. The powerful storage,
operation and security functions of cloud computing, as well as the ideal mode of resource allocation and
sharing, have laid a good foundation for the development of e-commerce recommendation engine, resulting
in a brand-new business recommendation mode. In the aspect of data integration, the data analysis
middleware layer can be used to import the source data of the business system for analysis, and the data of
the business system can also be directly stored in the distributed file system layer for management and
access.

Dept. of CSE, SEAGI, TIRUPATI 54


Design and Implementation of E-commerce Recommendation Model based on Cloud Computing

BIBLIOGRAPHY

[1] Marwan M, Kartit A, Ouahmane H. A Framework to Secure Medical Image Storage in Cloud Computing
Environment. Journal of Electronic Commerce in Organizations, vol. 16, no. 1, pp. 1-16, 2018.

[2] Isaias P, Issa T, Chang V, et al. Outlining the Issues of Cloud Computing and Sustainability
Opportunities and Risks in European Organizations: A SEM Study. Journal of Electronic Commerce in
Organizations, vol. 13, no. 4) :1-25, 2015.

[3] Somalee Datta, Keith Bettinger, Michael Snyder. Corrigendum: Secure cloud computing for genomic
data. Nature Biotechnology, vol. 34, no. 10, pp. 588-591, 2016.

[4] Datta S, Bettinger K, Snyder M. Erratum: Corrigendum: Secure cloud computing for genomic data.
Nature Biotechnology, vol. 34, no. 10, pp. 1072-1072, 2016.

[5] Liu Mingyue. About the services of big data and cloud computing for e-commerce . Information and
Computer (Theory Edition), vol. 352, no. 6, pp. 150-151, 2016.

[6] Chandra J, March S T, Mukherjee S, et al. Information Systems Frontiers. Communications of the Acm,
vol. 43, no. 1, pp. 71-79, 2016.

[7] Jovanovic J, Bagheri E. Electronic Commerce Meets the Semantic Web. It Professional, vol. 18, no. 4,
pp. 56-65, 2016.

[8] Ghosh N, Ghosh S K, Das S K. SelCSP: A Framework to Facilitate Selection of Cloud Service Providers.
Cloud Computing IEEE Transactions on, vol. 3, no. 1, pp. 66-79, 2015.

[9] Mi Rensha Aini. Research on the Application of Cloud Computing in E-commerce. Computer
Knowledge and Technology, vol. 11, no. 22, pp. 186-188, 2015.

[10] Bauer E. Improving Operational Efficiency of Applications via Cloud Computing. IEEE Cloud
Computing, vol. 5, no. 1, pp. 12-19, 2018.

[11] Zhang Lan. Research on e-commerce data caching based on cloud computing. Computer Knowledge
and Technology, vol. 12, no. 23, pp. 249-250, 2016.

[12] Chang Xueqin. Research on e-commerce logistics distribution model based on cloud computing.
Logistics Technology, vol. 34, no. 11, pp. 152-155, 2015.

[13] Herzfeldt A, Wolfenstetter T, Ertl C, et al. The Role of Individualization and Project Learning for Cloud
Service Profitability. Journal of Electronic Commerce in Organizations, vol. 16, no. 2, pp. 64-82,2018.

Dept. of CSE, SEAGI, TIRUPATI 55

You might also like