SlideShare a Scribd company logo
1 of 43
Download to read offline
i
ACKNOWLEDGEMENT
We would like to express our deep sense of gratitude and convey thanks to everyone who
have helped us and have supported us during the completion of this project. First, we would
like to express a deep sense of gratitude to Hem Sharma for helping, guiding, and
supporting us throughout our project completion. We also convey thanks to our all class
members for helping us from time to time. We acknowledge our department for providing
the courses and a great atmosphere that helped complete different chapters of this project.
We especially thank our supervisor, Dabbal Singh Mahara, and Rajesh Pandey for
supporting us and our concepts and for allowing us to do something the way we liked. Last
but not least, we would like to thank our senior for their constant and unrelenting support
towards our Project and their impartial love for us.
Dipa Giri (3153/70)
Rasbindra Bhattarai (3170/70)
Roshish K.C (3174/70)
Sabana Maharjan (3175/70)
ii
ABSTRACT
This project is a web based shopping system for a shop. The project objective is to deliver
the online shopping web-based application. This project is an attempt to provide the
advantages of online shopping to customers of a real shop. It helps buying the products in
the shop anywhere through internet by using a web-based application. Thus the customer
will get the service of online shopping and home delivery from the shop. This system can
be implemented to any retail shop in the locality. If shops are providing an online portal
where their customers can enjoy easy shopping from anywhere, the shops won’t be losing
any more customers to the trending online shops such as flip cart or eBay. Since the
application is available in the web-based application it is easily accessible and always
available.
Keywords: Apriori Algorithm, Recommendation System, Relational Database,
Association Rule
iii
TABLE OF CONTENTS
ACKNOWLEDGEMENT....................................................................................................i
ABSTRACT.........................................................................................................................ii
LIST OF FIGURES .............................................................................................................v
LIST OF TABLES..............................................................................................................vi
LIST OF ABBREVIATIONS............................................................................................vii
Chapter 1. INTRODUCTION .........................................................................................1
1.1. Introduction...........................................................................................................1
1.2. Problem Statement ................................................................................................1
1.3. Objective ...............................................................................................................1
1.4. Scope and Limitation ............................................................................................2
1.5. Report Organization..............................................................................................2
Chapter 2. REQUIREMENT ANALYSIS AND FEASIBILITY ANALYSIS ..............4
2.1. Literature Review..................................................................................................4
2.1.1. Existing System Study...................................................................................4
2.2. Requirement Analysis ...........................................................................................6
2.2.1. Functional Requirements ...............................................................................6
2.2.2. Non Functional Requirement.........................................................................7
2.3. Feasibility Analysis...............................................................................................8
2.3.1. Economical ....................................................................................................8
2.3.2. Operational.....................................................................................................8
2.3.3. Technical........................................................................................................8
2.3.4. Schedule.........................................................................................................9
2.4. Structuring System Requirements.........................................................................9
2.4.1. Data Modeling ...............................................................................................9
2.4.2. Process Modeling.........................................................................................10
Chapter 3. SYSTEM DESIGN ......................................................................................15
iv
3.1. System Design.....................................................................................................15
3.1.1. Database Schema Design.............................................................................15
3.1.2. Interface Design...........................................................................................15
3.1.3. Input Output Design.....................................................................................15
3.1.4. Dialogue Design...........................................................................................15
Chapter 4. IMPLEMENTATION AND TESTING ......................................................17
4.1. Implementation....................................................................................................17
4.1.1. Tools Used ...................................................................................................17
4.1.2. Algorithm Implementation...........................................................................18
4.1.3. Listing of major class...................................................................................20
4.2. Testing.................................................................................................................21
4.2.1. Unit Testing .................................................................................................21
4.2.2. Integration Testing.......................................................................................22
4.2.3. System Testing.............................................................................................23
Chapter 5. CONCLUSION AND RECOMMENDATION...........................................25
5.1. Conclusion...........................................................................................................25
5.2. Recommendation.................................................................................................25
REFERENCES ..................................................................................................................27
BIBLIOGRAPHY..............................................................................................................28
Appendix I ............................................................................................................................I
Appendix II........................................................................................................................IV
v
LIST OF FIGURES
Figure 2.1.Use case Diagram...............................................................................................7
Figure 2.2.Gantt Chart .........................................................................................................9
Figure 2.3.ER Diagram......................................................................................................10
Figure 2.4.Level 0 DFD of Online Shop............................................................................11
Figure 2.5.Level 1 DFD of online shop.............................................................................12
Figure 2.6.Level 2.1 DFD of Online shop .........................................................................13
Figure 2.7.Level 2.1 DFD of online shop..........................................................................14
Figure 3.1.Dialogue Diagram of Online shopping.............................................................16
vi
LIST OF TABLES
Table 4.1Transaction table.................................................................................................18
Table 4.2 Transaction iteration 1 .......................................................................................19
Table 4.3 Transaction iteration 1 final table ......................................................................19
Table 4.4 Transaction iteration 2 .......................................................................................20
Table 4.6.Unit Testing .......................................................................................................21
Table 4.7.Integrated Testing ..............................................................................................22
Table 4.8.Sytem Testing ....................................................................................................23
vii
LIST OF ABBREVIATIONS
B2B Business-to-Business
B2C Business-to-Consumer
CRUD Create, Replace, Update and Delete
CSS Cascading Style Sheet
HTML Hyper Text Markup Language
IIS Internet Information Services
MVC Model View Controller
MYSQL MY Structured Query Language.
1
Chapter 1. INTRODUCTION
1.1.Introduction
Online Shopping “is a web-based project which is made for shopping through Internet. As
the technology is being advanced the way of life is changing accordance. Now a day’s we
can place the order for anything from our home. There is no need to go the shop of the
thing we want. Then order can be placed online through internet. Today the internet have
created a new economic scenario that not only stresses on the classical concept of the
“product” but also on the modern concept of “service”. It is this level of service that dictates
whether a commercial venture will succeed or not in the market. To provide a high
accessibility of service the online shopping website has being design, so that potential
customers need not go to a physical shop to buy products or services. Online shopping is
the process whereby consumers directly buy goods or services from a seller in real-time,
without an intermediary service, over the Internet. It is a form of electronic commerce. An
online shop, e-shop, e-store, Internet shop, web shop, web store, online store, or virtual
store evokes the physical analogy of buying products or services at a bricks-and-mortar
retailer or in a shopping center. The process is called business-to-consumer (B2C) online
shopping. When a business buys from another business, it is called business-to-business
(B2B) online shopping.
1.2.Problem Statement
Customer had to stand in rows to wait there turns to buy a particular thing from a popular
shop. People had to suffer the rush of the market when they went for shopping. They used
to think hundred times to buy any things due to sufficient money for shopping. The main
problem are rush, the quarrel at the time of buying the things, time is not saved, harder to
find things with the discount or sale items, has to go longer distance for buying things.
1.3.Objective
The objective of this websites are following given below:
 To provide the information about the product.
 To develop the online shopping site using Apriori algorithm for recommendation
2
1.4.Scope and Limitation
Scope:
Purchasing and selling products and services over the internet without the need of going
physically to the market is what online shopping all about. Online shopping is just like a
retail store shopping that we do by going to the market, but it is done through the internet.
Online shopping has made shopping painless and added more fun. Online stores offer
product description, pictures, comparisons, price and much more. Few examples of these
are Amazon.com, ebay.com, framt.com and the benefits of online shopping is that by
having direct access to consumer, the online stores can offer products that cater to the needs
of consumer, cookies can be used for tracking the customer selection over the internet or
what is of their interest when they visit the site again. Online shopping makes use of digital
technology for managing the flow of information, products, and payment between
consumer, site owners and suppliers. Online shopping can be either B2B (business to
business) or B2C (business to consumer).
Limitation:
The Limitation of online shopping are follows:
 More categories option is not available only limited product item.
 More user interactive features are currently unavailable like zooming, 3D picture etc.
 Only Short listed payment options, payment like Visa, MasterCard, PayPal, etc. and
also saving the card information for later checkouts is not available in our system.
1.5.Report Organization
In chapter 1 include short description about online shopping, problem occur during project,
objective of the system formation, scope and limitation of the system.
In chapter 2 include some reviews of the system, requirement analysis: functional and non-
functional, feasibility analysis of the system in various fields, and structure of the system
requirement as data modeling and process modeling.
In chapter 3 include the design of the system. This includes design of database, interface,
input output and dialogue.
3
In chapter 4 include implementing and testing of the system. Implementation includes
various tools used in the system and classes used in the system. Testing include various
types of testing done to verify the system.
In chapter 5 conclude the document with summary of the document and recommending for
further work which we fail to do.
4
Chapter 2. REQUIREMENT ANALYSIS AND FEASIBILITY
ANALYSIS
2.1.Literature Review
2.1.1.Existing System Study
Online Shopping for Time saving:
Consumers also expected that product delivery in online shopping will be quicker
compared to offline stores and timely delivery on their convenience time; factors that keep
consumers satisfy in using internet as a tool for shopping is timely and reliable delivery
expected the relationship between time or effort savings and purchase intentions is
strengthen; consumers will place more emphasis on the time and effort savings once they
have experienced how little time and effort takes to make an online purchase. This system
uses some modules such as login, logout, register, cart etc. This system also recommend
the user using recommendation algorithm due to which it save time. They suggested that
to save customer's time and fully reflect the convenience of online shopping, e- marketers
should strengthen the web site's transaction capability and make sure all operations can be
completed online [2].
Recommendation System using Apriori Algorithm:
Recommendation system is a novel interactive technology for fetching additional data for
any business from its transaction oriented database of customers. This system helps the
customers to find products which they want to buy from the site. Recommendation system
gives benefits to customers by enabling them to find products which they must buy.
Conversely, they also help business by generating more sales, increasing their revenue.
Recommendation systems are speedily becoming essential tools in E-commerce on the
web. The Recommendation System using Apriori algorithm [1] can be implemented with
four main functionalities: User Interface Component, Data Extraction, Web Usage Mining
and Pattern Recognition [1].
Algorithm
Apriori algorithm [1] is classical algorithm in data mining used for frequent item set mining
and association rule learning. It is devised to operate on a database containing a lot of
transactions, for instance, items brought by customers in a store. It is very important for
5
effective market basket analysis and help the customers in purchasing their items with more
ease which increase the sales of the market. It proceeds by identifying the frequent
individual items in the database and extending them to larger and larger item sets as long
as those item sets appear sufficiently often in the database. The frequent item sets
determined by Apriori can be used to determine association rules which highlight general
trends in the database.
Support:
The support of an itemset X, supp(X) is the proportion of transaction in the database in
which the item X appears. It signifies the popularity of an itemset.
Supp (X)=
Number of transaction in which X appears
total number of transaction
For example lets us suppose number of transaction in which X appears be 4 and total
number of transaction be 6 then Supp (X)=
4
6
= 0.66667
If the sales of particular product above certain proposition have a meaningful effect on
profits, that proportion can be considered as the support threshold.
Confidence:
The confidence of a rule is defined as follows:
Conf (X-> Y)=
𝑠𝑢𝑝𝑝(𝑋 ∪ 𝑌)
supp(X)
It signifies the likelihood of item Y being purchased when item X is purchased. So, let us
suppose for the rule {item1, item2} =>{item3},
Conf {(item1-> item2)=> (item3)}
𝑠𝑢𝑝𝑝(𝑖𝑡𝑒𝑚1,𝑖𝑡𝑒𝑚2,𝑖𝑡𝑒𝑚3)
supp(item1,item2)
=
3
6
∗
6
4
= 0.75
This implies that for 75% of the transactions containing item1 and item2, the rule is
correct.
6
Pseudo Code of Apriori Algorithm:
Apriori(T,∈)
L1← {large 1 – itemsets}
k←2
while Lk-1 ≠ 𝜃
Ck ←{a ∪ {b}| a ∈ Lk-1 ˄ b ∉ a} – {c|{s | s ⸦ c ˄|s|=k-1} ⸦ Lk-1}
For transactions t∈T
Ct ←{c|c ∈ Ck ˄ c ⸦ t}
For candidates c ∈ Ct
Count[c] ← count[c]+1
Lk←{c|c ∈ Ck ˄ count[c] > ∈ }
k←k+1
return U Lk
2.2.Requirement Analysis
2.2.1.Functional Requirements
Functional Requirement are statements of services that system should provide. It describes
what the system should do. They are helpful to describe the system function in details. Here
are some of the functional requirement for the system used by the users.
The system include different function which should be performed within the system
environment.
Use Case
Use case diagram is a graphic description of the interactions among the elements of a
system. In this system there are two user’s admin user and end user. The Admin user can
manage products and customers in the system. The Customer can view products, purchase
products, manage customer information, and create product reviews.
k
7
Figure 2.1.Use case Diagram
2.2.2.Non Functional Requirement.
 Efficiency
In our system customer can purchase product in an efficient manner using cart.
8
 Reliability
The system will provide a reliable environment to both customers and owner. All orders
will be reaching at the admin without any errors.
 Usability
The system is designed for user friendly environment and ease of use.
2.3.Feasibility Analysis.
This project carries goals that could be realistically accomplished. We have a clear goal of
this. Since, web based application is not going to be highly complex, it will not need a lot
of processing power.
2.3.1.Economical
The software used are open source software which can be easily available for free of cost.
We do not need complex and expensive hardware for the application.
2.3.2.Operational
The proposed system would solve the educational problems and take advantage of the
opportunities. The new systems would fit into the current day-to-day operations of the
client. The system would save the time and effort of the clients. Thus, the system would be
operationally feasible.
2.3.3.Technical
Technically, this project is very feasible because of use of current and latest technique. All
the technology needed for the system exists.This system is feasible on technical remarks
as the proposed system is more beneficiary in terms of having a sound proof system with
new technical components installed on the system. The proposed system can run on any
machines supporting Windows and Internet services and works on the best software and
hardware that had been used while designing the system so it would be feasible in all
technical terms of feasibility.
9
2.3.4.Schedule.
Gantt chart
Figure 2.2.Gantt Chart
2.4.Structuring System Requirements
2.4.1.Data Modeling
 ER Diagram
In below diagram, there are three entities and they are product, customer and store
whose primary keys are product_id, customer_id and purchase_id respectively.
Customer has relationship with all the other entities. It has many to many relationship
with store and one to many with product. There are one-to-many and many-to-many
relations in the diagram which gives relationships between the attributes in the system.
10
Figure 2.3.ER Diagram
2.4.2.Process Modeling
 DFD level 0
This DFD level 0 describes system in which there are two types of users of the system
one is customer (end user) and another is admin. Admin user get detail of the customer
and provides different types of services to the customer. End user/ customer places
order to the system and get items as needed.
11
Figure 2.4.Level 0 DFD of Online Shop
 DFD level 1
This DFD level 1 describes about the task which can be done by customer and admin
after login in the system. When the admin login into the system, system will verify the
admin when the verification is successful then only the admin user can do further work.
After verified the Admin can login and can get information of different items, users
and update category. After login by the customer, he or she can order goods, from the
system.
12
Figure 2.5.Level 1 DFD of online shop
 DFD level 2
This DFD level 2 describes about the customer. When the customer login if there is
account the it can do further work but if it is not then customer have to register
information in the system which helps to recognize the user by the system. After login
the user can get the product list, product detail, and can buy goods.
13
Figure 2.6.Level 2.1 DFD of Online shop
 DFD level 2.1
This level show the task which can be done by admin after login the system. When the
admin login into the system, the system will verify the admin and when the verification
is done then the admin is successfully login and the admin home page will be opened.
In that page the admin can add the user, update the user information, delete the user,
and view the user details and get to know about who are the users of the system. The
Admin User can get all the information about the order details of the products and the
customer too.
14
Figure 2.7.Level 2.1 DFD of online shop
.
15
Chapter 3. SYSTEM DESIGN
3.1.System Design
3.1.1.Database Schema Design
The name of the database of this system is dbconnect. It consists of 3 tables. Their names
are: Products, Carts and Users. The schema of the database with its table and attributes
are shown below:
 Products ( Id, Name, Price, Status, AddedDate, ModifiedDate)
 Carts ( Id, ProductId, Price, UserId, TransactionNo, Quantity)
 Users ( Id, FirstName, LastName, Address, Phone, Email, Password, AddedDate,
ModifiedDate, AdminRole, Status)
3.1.2.Interface Design
The interface design is done using HTML and CSS which includes the outlook of the
system which shows the home page, collection of items, details of the items, some pages
which takes the information from the user and store in the database which help to login and
logout process in the system. We have link some related pages due to which we can go
from one page to another page. For normal user just the interface can be shown and cannot
be edited but for Admin user the admin can operate CRUD operations in it.
3.1.3.Input Output Design
We get user information and user address information for input output design. The user
have to include the information which the registration page include and all the fields should
be include to register in the system. The input which are inserted by the user is stored in
the database and when the user register the page then the system check the input whether
it matches the database or not. To login the user the user have to insert the login id and
password after inserting the input the system checks the information in the system and then
if match then respective page will be opened otherwise registration page will be opened.
3.1.4.Dialogue Design
Using C# we link some related pages due to which we can go from one page to another
page. Login, Register is done from the Home page. From login page, normal home page is
accessed. Similarly from register we can access register Page. After login in the page we
16
can do cart and the cart items are checked out by the user. Finally we have a logout option
in user profile which can take back to home page.
Figure 3.1.Dialogue Diagram of Online shopping
17
Chapter 4. IMPLEMENTATION AND TESTING
4.1.Implementation
4.1.1.Tools Used
We have used various development technologies for our system development. They are
listed as below:
HTML and CSS are utilized to implement the frontend.
 HTML (Hyper Text Markup Language)
We have used HTML to build the main structure of the website. By the help of HTML
we have created some pages and link with each other and also we have add some
pictures in it.
 SQL Server
It is used to create database and tables to store data.
 JQuery
JQuery has been used in our project for better user experience by providing effective
website like loading time reduce, beautiful view etc.
 CSS
CSS is used to design the webpage to make it look more stylish. Without CSS the User
Interface does not look nice.
 ASP.NET MVC
The ASP.NET uses MVC pattern to separate the logic, entity and view. We have
followed the MVC pattern by placing all the entities that we will be using in Model
folder, all the view pages in View Folder and the business logics in the Controller
Folder.
 C#
All of the business logic are written in C# and it’s codes are written in Visual Studio.
 IIS
IIS is used to host the website locally.
18
 Entity Framework
Rather than writing SQL command we have used Entity Framework to map our object
to relational model. Queries are written using LINQ a feature provided by C# to write
queries. The entity framework translates this LINQ queries to T-SQL queries.
4.1.2.Algorithm Implementation
In the project we have form three tables for keeping record of products, cart, and user.
When the authorized user login into the system and cart some items and if the same user
visit the system again then the system will recommend some items to the user. This is the
simple work which the user can see in the user interface part. Actual work is done at the
backend of the system. To recommend the user, the system create a table which keeps the
record of item and transaction in this project that table is cart table which keeps the record.
After keeping record of transaction the system will make a set of items and count them and
keep the record. After this the system set support value as 2 with reference of the support
value the value of set in the table will be compared and if the value is less than 2 then that
set will be discarded from the list. Again form a table with set of three items and get the
frequency and store in table and the new frequency is again compare with support value.
When we get the last set in the table then the system will recommend the item in the set to
the user.
Let us suppose that we have some items in our system some of them are pant, shirt, sari, t-
shirt, coat. We have five items in the system. Now we keep those items in our transaction
table and list out as the items buy according to the transaction as:
Table 4.1Transaction table
Transaction Items
1 Pant, shirt ,coat
2 Shirt, sari
3 Coat, t-shirt, pant
4 Shirt t-shirt, pant
5 Shirt, sari ,coat
6 Pant, shirt, coat
19
From above table we get information about transaction and items in the system. Now we
make item set and find out the frequency and let us set support value be 2 do we compare
the values and keep those set whose value is greater than equal to 2:
Table 4.2 transaction iteration 1
Table 4.3 transaction iteration 1 final table
Itemset Support
Pant, shirt 3
Pant, coat 3
Shirt, sari 2
Pant, t-shirt 2
Shirt, coat 2
Now again make a set of three items and find out the frequency and compare the frequency
with support and find out new frequency.
Itemset Frequency Support
Pant, shirt 3 3
Pant, coat 3 3
Shirt, sari 2 2
Coat , t-shirt 1
Pant, t-shirt 2 2
Shirt, t-shirt 1
Shirt, coat 2 2
Sari, t-shirt 0
Sari, coat 1
20
Table 4.4 transaction iteration 2
Itemset frequency Support
Pant, shirt,coat 2 2
pant, t-shirt coat 1
Shirt, t-shirt, pant 1
Shirt, sari, coat 1
When we compare with the support value then our remaining set will be {pant, shirt, coat}.
Now when the customer purchase one item or two then the remaining item will be
recommended by the system to the user as the following :
{pant, shirt}=> coat
{pant, coat}=>shirt
{shirt, coat}=>pant
Pant=>{shirt, coat}
Shirt=>{pant, coat}
Coat=>{shirt, pant}
4.1.3.Listing of major class
 Cart controller
This class have code for add to cart and checkout button.
 Front controller
This class consist of code to start and remove session.
 Home controller
This class consist of the codes to extract list of products from database.
 Login controller
It has the codes to login user and admin, register the new users and reset password.
 Cart Module
Cart Module is a class where we invoke the function ProcessTransaction.
 ClothOrderDbContext
This class consists of the Dbsets that maps models with tables.
 Product module
21
This class is accessed only by admin to add, delete, edit and view the food items.
4.2.Testing
4.2.1.Unit Testing
Unit testing is a software verification and validation method where the programmer gains
confidence that individual units of source code are fit for use. A unit is the smallest testable
part of an application. In procedural programming a unit may be an individual program,
function, procedure, etc., while in object-oriented programming, the smallest unit is a class,
which may belong to a base/super class, abstract class or derived/child class.
Unit testing is done to test the small units of the system. In our system we do have some
units which are being tested using Unit testing.
Table 4.5.Unit Testing
Test no. Test cases Test data Expected
outcomes
Actual
result
Status
1 Admin
Login the
user
Enter id,
password
Login page
is opened
Login page
is opened
pass
2 Admin
create user
Enter the
required
filled
Successfully
registered
Connection
problem
fail
3 Admin
create user
Enter the
required
filled
Successfully
registered
Connection
successful
and
successfully
inserted the
value
pass
4 Admin
view user
Click on
view
button
Show all the
list of the
user
Connection
error
fail
5 Admin
view user
Click on
view
button
Show all the
list of the
user
Show the
list of the
user in
tabular
form
pass
6 Admin
delete the
user
Click on
delete
button
Delete the
respective
user
No change
in the
database
fail
22
7 Customer
login
Enter the
valid id,
password
Successfully
login
Open the
respective
page
pass
8 Customer
login
Enter the
valid id,
password
Successfully
login
Open the
registration
page
9 Customer
logout
Logout
button
pressed
Normal
home page
is opened
Session off
is not
execute so
login the
previous
user
fail
10 Customer
logout
Press the
logout
button
Normal
home page
is opened
Normal
home page
is opened
pass
4.2.2.Integration Testing
Integration testing, also known as integration and testing, is a software development
process which program units are combined and tested as groups in multiple ways. In this
context, a unit is defined as the smallest testable part of an application. Integration testing
can expose problems with the interfaces among program components before trouble occurs
in real-world program execution. Integration testing is a component of Extreme
Programming, a pragmatic method of software development that takes a meticulous
approach to building a product by means of continual testing and revision.
There are two major ways of carrying out an integration test, called the bottom-up method
and the top-down method. Bottom-up integration testing begins with unit testing, followed
by tests of progressively higher-level combinations of units called modules or builds. In
top-down integration testing, the highest-level modules are tested first and progressively
lower-level modules are tested after that. In a comprehensive software development
environment, bottom-up testing is usually done first, followed by top-down testing.
Table 4.6.Integrated Testing
Test no Test cases Test data Expected
outcomes
Actual
outcome
status
1 Registration Entry the
required
field
Successfully
registered
Failed to
register
Fail
23
2 Registration Entry the
required
field
Successfully
registered
Successfully
registered
pass
3 Update
item
Update
item by
admin
and
shown in
user
interface
Successfully
update but
not shown
in user
interface
Shown in
user
interface
fail
4 Update
items
Update
item by
admin
and
shown in
user
interface
Successfully
update and
shown in
user
interface
Shown in
user
interface
pass
4.2.3.System Testing
We provide dummy data and tested the complete system. The system was successfully able
to go to next step without creating much error. The result were expected and there was no
problem while entering user Id, selecting item and showing the information. Item detail
could be easily viewed and returning to the homepage and viewing recommended item and
many more were successful.
Table 4.7.Sytem Testing
Test case ID Test case Expected result Actual result
1 Entry the valid
date in user Id and
user password and
click on login
button on login
page.
Login page should be
display.
Login page opened.
2 Entry the invalid
date in user Id and
user password and
click on login
button on login
page.
Registration Page will
be displayed.
Login the user.
24
3 Select the item
and show the
information
Information shown to
the user.
Mission complete.
4 Select item and
show the
information
Information showed to
the user but another
product
Error message is display.
5 More than one
item is stored with
same name
Item is displayed on the
screen.
Actual output what the
user want is not
displayed.
6 Order the items in
the system
Request complete and
mail the customer
Mission not complete so
cannot order item
25
Chapter 5. CONCLUSION AND RECOMMENDATION
5.1.Conclusion
The project entitled “Online shopping for clothing” has completed successfully. The
system has been developed with much care and less errors and at the same time it is
efficient and less time consuming. The purpose of this project was to develop a web
application for purchasing items from online store. In this project, we have create user
interface with the help of HTML, and CSS. This project will give short information about
the products which are displayed in the web page which include color, size, brand etc. This
project include some links of Cloth Manufacture Company, Cloth Store, and Map location
from where we can get more detailed information. In the system the authorized user can
login and see more detail information and items in the website. Only the admin user can
change the content, user in the web site. In this project we have used Apriori Algorithm [1]
for recommending the items to the authorized user. The items which are clicked frequent
time are stored in the database and they are displayed on the screen after login by the
authorized user.
There is a scope for further development in our project to a great extent. A number of
features can be added to this system in future like providing moderator more control over
products so that each moderator can maintain their own products. Another feature we
wished to implement was providing classes for customers so that different offers can be
given to each class. System may keep track of history of purchases of each customer and
provide suggestions based on their history.
5.2.Recommendation
The following section discusses the work that will be implemented in future for further
development of the system.
 Detailed categories: Future work could involve adding more categories which are more
detailed and have additional items.
 Watch/Wish List: Work can add a watch list or wish list so that users can add an item
to a list to watch for item prices to go down or to see when there is a sale on any of
those items.
26
 Enhanced User Interface: Work on enhancing the user interface by adding more user
interactive features.
 Payment Options: Add different payment options, such as Visa, MasterCard, PayPal,
etc. where a user can also save the card information for later checkouts.
27
REFERENCES
[1] K. S. Talwar, A. Oraganti and a. et, "Recommendation System using Apriori Algorithm,"
IJSRD - International Journal for Scientific Research & Development, pp. Vol. 3, Issue
01, 2015.
[2] Broekhuizen, "Online Shopping," no. Time Saving, 2009.
28
BIBLIOGRAPHY
 A. Fernandez and . A. D. Miyazaki, "“Consumer Perceptions of Privacy and Security
Risks for Online Shopping.”".The Journal of Consumer Affairs 35.1 : 27-44.
 E. . B. and . M. , "purchasing decision process," 1990.
 B. M. Sarwar, G. Karypis, . J. A. Konstan and J. Reid, " Item-based collaborative filtering
recommendation algorithms," in In Proceedings of the 10th International World Wide
Web Conference, 285-295.
 J. S. Breese, D. Heckerman and C. Kadie, " Empirical analysis of predictive algorithms
for collaborative filtering," in In Proceedings of the Fourteenth Conference on
Uncertainty in Artifical Intelligence, 1998.
I
Appendix I
Screen Shot
Home page:
Admin
II
Registration
Login
Contact:
III
Gallery:
IV
Appendix II
Source Code:
Apriori Algorithm:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using Test.AprioriAlgorithm.Model;
namespace Test.AprioriAlgorithm.Implementation
{
public class AprioriAlgo
{
readonly Sorter _sorter = new Sorter();
public Output ProcessTransaction(double minSupport, double minConfidence,
IEnumerable<string> items, string[] transactions)
{
IList<Item> frequentItems = GetL1FrequentItems(minSupport, items, transactions);
ItemsDictionary allFrequentItems = new ItemsDictionary();
allFrequentItems.ConcatItems(frequentItems);
IDictionary<string, double> candidates = new Dictionary<string, double>();
double transactionsCount = transactions.Count();
do
{
candidates = GenerateCandidates(frequentItems, transactions);
frequentItems = GetFrequentItems(candidates, minSupport, transactionsCount);
allFrequentItems.ConcatItems(frequentItems);
}
while (candidates.Count != 0);
HashSet<Rule> rules = GenerateRules(allFrequentItems);
IList<Rule> strongRules = GetStrongRules(minConfidence, rules, allFrequentItems);
return new Output
{
StrongRules = strongRules,
FrequentItems = allFrequentItems
};}
private List<Item> GetL1FrequentItems(double minSupport, IEnumerable<string>
items, IEnumerable<string> transactions)
{
var frequentItemsL1 = new List<Item>();
double transactionsCount = transactions.Count();
foreach (var item in items)
V
{
double support = GetSupport(item, transactions);
if (support / transactionsCount >= minSupport)
{
frequentItemsL1.Add(new Item { Name = item, Support = support });
}}
return frequentItemsL1;
}
private double GetSupport(string generatedCandidate, IEnumerable<string>
transactionsList)
{
double support = 0;
foreach (string transaction in transactionsList)
{
if (CheckIsSubset(generatedCandidate, transaction))
{
support++;
} }
return support;
}
private bool CheckIsSubset(string child, string parent)
{
foreach (char c in child)
{
if (!parent.Contains(c))
{
return false;
}}
return true;
}
private Dictionary<string, double> GenerateCandidates(IList<Item> frequentItems,
IEnumerable<string> transactions)
{
Dictionary<string, double> candidates = new Dictionary<string, double>();
for (int i = 0; i < frequentItems.Count - 1; i++)
{
string firstItem = _sorter.Sort(frequentItems[i].Name);
for (int j = i + 1; j < frequentItems.Count; j++)
{
string secondItem = _sorter.Sort(frequentItems[j].Name);
string generatedCandidate = GenerateCandidate(firstItem, secondItem);
if (generatedCandidate != string.Empty)
VI
{
double support = GetSupport(generatedCandidate, transactions);
candidates.Add(generatedCandidate, support);
}}} return candidates;
}
private string GenerateCandidate(string firstItem, string secondItem)
{
int length = firstItem.Length;
if (length == 1)
{
return firstItem + secondItem;
}
else
{
string firstSubString = firstItem.Substring(0, length - 1);
string secondSubString = secondItem.Substring(0, length - 1);
if (firstSubString == secondSubString)
{
return firstItem + secondItem[length - 1];
}
return string.Empty;
}}
private List<Item> GetFrequentItems(IDictionary<string, double> candidates, double
minSupport, double transactionsCount)
{
var frequentItems = new List<Item>();
foreach (var item in candidates)
{
if (item.Value / transactionsCount >= minSupport)
{
frequentItems.Add(new Item { Name = item.Key, Support = item.Value });
}} return frequentItems;
}
GetClosedItemSets(ItemsDictionary allFrequentItems)
private Dictionary<string, double> GetItemParents(string child, int index,
ItemsDictionary allFrequentItems)
{
var parents = new Dictionary<string, double>();
for (int j = index; j < allFrequentItems.Count; j++)
{
string parent = allFrequentItems[j].Name;
if (parent.Length == child.Length + 1)
{
if (CheckIsSubset(child, parent))
{
parents.Add(parent, allFrequentItems[parent].Support);
VII
}}}
return parents;
}
private bool CheckIsClosed(string child, Dictionary<string, double> parents,
ItemsDictionary allFrequentItems)
{
foreach (string parent in parents.Keys)
{
if (allFrequentItems[child].Support == allFrequentItems[parent].Support)
{
return false;
}}
return true;
}
private HashSet<Rule> GenerateRules(ItemsDictionary allFrequentItems)
{
var rulesList = new HashSet<Rule>();
foreach (var item in allFrequentItems)
{
if (item.Name.Length > 1)
{
IEnumerable<string> subsetsList = GenerateSubsets(item.Name);
foreach (var subset in subsetsList)
{
string remaining = GetRemaining(subset, item.Name);
Rule rule = new Rule(subset, remaining, 0);
{
if (!rulesList.Contains(rule))
rulesList.Add(rule);
}}}}
return rulesList;
}
private IEnumerable<string> GenerateSubsets(string item)
{
IEnumerable<string> allSubsets = new string[] { };
int subsetLength = item.Length / 2;
for (int i = 1; i <= subsetLength; i++)
{
IList<string> subsets = new List<string>();
GenerateSubsetsRecursive(item, i, new char[item.Length], subsets);
allSubsets = allSubsets.Concat(subsets);
}
return allSubsets;
}
VIII
private void GenerateSubsetsRecursive(string item, int subsetLength, char[] temp,
IList<string> subsets, int q = 0, int r = 0)
{
if (q == subsetLength)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < subsetLength; i++)
{sb.Append(temp[i]); }
subsets.Add(sb.ToString());
} else {
for (int i = r; i < item.Length; i++)
{
temp[q] = item[i];
GenerateSubsetsRecursive(item, subsetLength, temp, subsets, q + 1, i + 1);
}}}
private string GetRemaining(string child, string parent)
{
for (int i = 0; i < child.Length; i++)
{
int index = parent.IndexOf(child[i]);
parent = parent.Remove(index, 1);}
return parent;}
private IList<Rule> GetStrongRules(double minConfidence, HashSet<Rule> rules,
ItemsDictionary allFrequentItems)
{ var strongRules = new List<Rule>();
foreach (Rule rule in rules)
{string xy = _sorter.Sort(rule.X + rule.Y);
AddStrongRule(rule, xy, strongRules, minConfidence, allFrequentItems);
}return strongRules; }
private void AddStrongRule(Rule rule, string XY, List<Rule> strongRules, double
minConfidence, ItemsDictionary allFrequentItems)
{double confidence = GetConfidence(rule.X, XY, allFrequentItems);
if (confidence >= minConfidence)
{Rule newRule = new Rule(rule.X, rule.Y, confidence);
strongRules.Add(newRule);}
confidence = GetConfidence(rule.Y, XY, allFrequentItems);
if (confidence >= minConfidence && !strongRules.Contains(new Rule(rule.X,
rule.Y, confidence)))
{Rule newRule = new Rule(rule.Y, rule.X, confidence);
strongRules.Add(newRule);}}
private double GetConfidence(string X, string XY, ItemsDictionary
allFrequentItems)
{
double supportX = allFrequentItems[X].Support;
double supportXY = allFrequentItems[XY].Support;
return supportXY / supportX;}}}

More Related Content

What's hot

SIP (Repaired) (1)
SIP (Repaired) (1)SIP (Repaired) (1)
SIP (Repaired) (1)
Nishat Hasan
 
FRM - U.P.S. Sirisena
FRM - U.P.S. SirisenaFRM - U.P.S. Sirisena
FRM - U.P.S. Sirisena
Saddha thissa
 
Indian women's wear market forecast to 2018
Indian women's wear market forecast to 2018Indian women's wear market forecast to 2018
Indian women's wear market forecast to 2018
IBNARESEARCH
 
PPS - U.P.S. Sirisena
PPS - U.P.S. SirisenaPPS - U.P.S. Sirisena
PPS - U.P.S. Sirisena
Saddha thissa
 

What's hot (15)

Internship report on polyplast by MJB
Internship report  on polyplast by MJBInternship report  on polyplast by MJB
Internship report on polyplast by MJB
 
SIP (Repaired) (1)
SIP (Repaired) (1)SIP (Repaired) (1)
SIP (Repaired) (1)
 
SBEP Procurement Manual
SBEP Procurement ManualSBEP Procurement Manual
SBEP Procurement Manual
 
BBA - Internship Report - Dynamic Dreams Tradelink Pvt. Ltd.
BBA - Internship Report - Dynamic Dreams Tradelink Pvt. Ltd.BBA - Internship Report - Dynamic Dreams Tradelink Pvt. Ltd.
BBA - Internship Report - Dynamic Dreams Tradelink Pvt. Ltd.
 
SBEP Human Resources Manual
SBEP Human Resources ManualSBEP Human Resources Manual
SBEP Human Resources Manual
 
Internship report
Internship reportInternship report
Internship report
 
Industrial Training Report on Woven Garments
Industrial Training Report on Woven GarmentsIndustrial Training Report on Woven Garments
Industrial Training Report on Woven Garments
 
Hiwot aydiko mota/WWW.ESHETIESTU.COM
Hiwot aydiko mota/WWW.ESHETIESTU.COMHiwot aydiko mota/WWW.ESHETIESTU.COM
Hiwot aydiko mota/WWW.ESHETIESTU.COM
 
Quantitative research on Customer Loyalty of Standard Chartered Bank
Quantitative research on Customer Loyalty of Standard Chartered BankQuantitative research on Customer Loyalty of Standard Chartered Bank
Quantitative research on Customer Loyalty of Standard Chartered Bank
 
FRM - U.P.S. Sirisena
FRM - U.P.S. SirisenaFRM - U.P.S. Sirisena
FRM - U.P.S. Sirisena
 
internship report
internship reportinternship report
internship report
 
Indian women's wear market forecast to 2018
Indian women's wear market forecast to 2018Indian women's wear market forecast to 2018
Indian women's wear market forecast to 2018
 
Final Document
Final DocumentFinal Document
Final Document
 
PPS - U.P.S. Sirisena
PPS - U.P.S. SirisenaPPS - U.P.S. Sirisena
PPS - U.P.S. Sirisena
 
Software Engineering Internship
Software Engineering InternshipSoftware Engineering Internship
Software Engineering Internship
 

Similar to Onlineshhopping final

Thesis paper On Magic Mirror
Thesis paper On Magic MirrorThesis paper On Magic Mirror
Thesis paper On Magic Mirror
Anika Habib
 
eab.com Student Affairs Forum Supporting International.docx
eab.com Student Affairs Forum Supporting International.docxeab.com Student Affairs Forum Supporting International.docx
eab.com Student Affairs Forum Supporting International.docx
sagarlesley
 
Adrian-Sorin Alexe - Creating growth in an online store (2)
Adrian-Sorin Alexe - Creating growth in an online store (2)Adrian-Sorin Alexe - Creating growth in an online store (2)
Adrian-Sorin Alexe - Creating growth in an online store (2)
Adrian - Sorin Alexe
 
Summer Training Report
Summer Training ReportSummer Training Report
Summer Training Report
Aalap Valia
 

Similar to Onlineshhopping final (20)

Title
TitleTitle
Title
 
Mobile d
Mobile dMobile d
Mobile d
 
Thesis paper On Magic Mirror
Thesis paper On Magic MirrorThesis paper On Magic Mirror
Thesis paper On Magic Mirror
 
online examination management system
online examination management systemonline examination management system
online examination management system
 
Self checkout application report
Self checkout application reportSelf checkout application report
Self checkout application report
 
digiinfo website project report
digiinfo website project reportdigiinfo website project report
digiinfo website project report
 
Online shopping-project-documentation-template
Online shopping-project-documentation-templateOnline shopping-project-documentation-template
Online shopping-project-documentation-template
 
UNDERSTAND THE ECOSYSTEM IN DIGITAL MEDIA MARKETING VICKY KUMAR.pdf
UNDERSTAND THE ECOSYSTEM IN DIGITAL MEDIA MARKETING VICKY KUMAR.pdfUNDERSTAND THE ECOSYSTEM IN DIGITAL MEDIA MARKETING VICKY KUMAR.pdf
UNDERSTAND THE ECOSYSTEM IN DIGITAL MEDIA MARKETING VICKY KUMAR.pdf
 
eab.com Student Affairs Forum Supporting International.docx
eab.com Student Affairs Forum Supporting International.docxeab.com Student Affairs Forum Supporting International.docx
eab.com Student Affairs Forum Supporting International.docx
 
Final Project: Online Shopping Web Application.pdf
Final Project: Online Shopping Web Application.pdfFinal Project: Online Shopping Web Application.pdf
Final Project: Online Shopping Web Application.pdf
 
Ravi's Dissertation
Ravi's DissertationRavi's Dissertation
Ravi's Dissertation
 
Ecommerce
EcommerceEcommerce
Ecommerce
 
Adrian-Sorin Alexe - Creating growth in an online store (2)
Adrian-Sorin Alexe - Creating growth in an online store (2)Adrian-Sorin Alexe - Creating growth in an online store (2)
Adrian-Sorin Alexe - Creating growth in an online store (2)
 
Flaming_Vortex_BDAL_ Econet_ MDP_240715
Flaming_Vortex_BDAL_ Econet_ MDP_240715Flaming_Vortex_BDAL_ Econet_ MDP_240715
Flaming_Vortex_BDAL_ Econet_ MDP_240715
 
MSSMT
MSSMTMSSMT
MSSMT
 
Online Test
Online TestOnline Test
Online Test
 
Abrek_Thesis
Abrek_ThesisAbrek_Thesis
Abrek_Thesis
 
print.pdf
print.pdfprint.pdf
print.pdf
 
Satya final project
Satya final projectSatya final project
Satya final project
 
Summer Training Report
Summer Training ReportSummer Training Report
Summer Training Report
 

More from Sabana Maharjan

More from Sabana Maharjan (20)

All in one mis
All in one misAll in one mis
All in one mis
 
All in one mis
All in one misAll in one mis
All in one mis
 
M commerce
M commerceM commerce
M commerce
 
E marketing
E marketingE marketing
E marketing
 
Online shopping presentation
Online shopping presentationOnline shopping presentation
Online shopping presentation
 
Erlonggg
ErlongggErlonggg
Erlonggg
 
Er diagram
Er diagramEr diagram
Er diagram
 
Er long
Er longEr long
Er long
 
Relational model
Relational modelRelational model
Relational model
 
Introduction to structured query language (sql)
Introduction to structured query language (sql)Introduction to structured query language (sql)
Introduction to structured query language (sql)
 
Good food for better life
Good food for better lifeGood food for better life
Good food for better life
 
Do not think about any consequences just travel around nepal
Do not think about any consequences just travel around nepalDo not think about any consequences just travel around nepal
Do not think about any consequences just travel around nepal
 
5 best place to watch sunrise and sunset naturally
5 best place to watch sunrise and sunset naturally5 best place to watch sunrise and sunset naturally
5 best place to watch sunrise and sunset naturally
 
Newari food
Newari foodNewari food
Newari food
 
This is indeed a life time experience
This is indeed a life time experienceThis is indeed a life time experience
This is indeed a life time experience
 
File tracking system
File tracking systemFile tracking system
File tracking system
 
MIS enterprise system for collaboration
MIS enterprise system for collaborationMIS enterprise system for collaboration
MIS enterprise system for collaboration
 
Mis presentation
Mis presentationMis presentation
Mis presentation
 
Chapter9
Chapter9Chapter9
Chapter9
 
Chapter8
Chapter8Chapter8
Chapter8
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Onlineshhopping final

  • 1. i ACKNOWLEDGEMENT We would like to express our deep sense of gratitude and convey thanks to everyone who have helped us and have supported us during the completion of this project. First, we would like to express a deep sense of gratitude to Hem Sharma for helping, guiding, and supporting us throughout our project completion. We also convey thanks to our all class members for helping us from time to time. We acknowledge our department for providing the courses and a great atmosphere that helped complete different chapters of this project. We especially thank our supervisor, Dabbal Singh Mahara, and Rajesh Pandey for supporting us and our concepts and for allowing us to do something the way we liked. Last but not least, we would like to thank our senior for their constant and unrelenting support towards our Project and their impartial love for us. Dipa Giri (3153/70) Rasbindra Bhattarai (3170/70) Roshish K.C (3174/70) Sabana Maharjan (3175/70)
  • 2. ii ABSTRACT This project is a web based shopping system for a shop. The project objective is to deliver the online shopping web-based application. This project is an attempt to provide the advantages of online shopping to customers of a real shop. It helps buying the products in the shop anywhere through internet by using a web-based application. Thus the customer will get the service of online shopping and home delivery from the shop. This system can be implemented to any retail shop in the locality. If shops are providing an online portal where their customers can enjoy easy shopping from anywhere, the shops won’t be losing any more customers to the trending online shops such as flip cart or eBay. Since the application is available in the web-based application it is easily accessible and always available. Keywords: Apriori Algorithm, Recommendation System, Relational Database, Association Rule
  • 3. iii TABLE OF CONTENTS ACKNOWLEDGEMENT....................................................................................................i ABSTRACT.........................................................................................................................ii LIST OF FIGURES .............................................................................................................v LIST OF TABLES..............................................................................................................vi LIST OF ABBREVIATIONS............................................................................................vii Chapter 1. INTRODUCTION .........................................................................................1 1.1. Introduction...........................................................................................................1 1.2. Problem Statement ................................................................................................1 1.3. Objective ...............................................................................................................1 1.4. Scope and Limitation ............................................................................................2 1.5. Report Organization..............................................................................................2 Chapter 2. REQUIREMENT ANALYSIS AND FEASIBILITY ANALYSIS ..............4 2.1. Literature Review..................................................................................................4 2.1.1. Existing System Study...................................................................................4 2.2. Requirement Analysis ...........................................................................................6 2.2.1. Functional Requirements ...............................................................................6 2.2.2. Non Functional Requirement.........................................................................7 2.3. Feasibility Analysis...............................................................................................8 2.3.1. Economical ....................................................................................................8 2.3.2. Operational.....................................................................................................8 2.3.3. Technical........................................................................................................8 2.3.4. Schedule.........................................................................................................9 2.4. Structuring System Requirements.........................................................................9 2.4.1. Data Modeling ...............................................................................................9 2.4.2. Process Modeling.........................................................................................10 Chapter 3. SYSTEM DESIGN ......................................................................................15
  • 4. iv 3.1. System Design.....................................................................................................15 3.1.1. Database Schema Design.............................................................................15 3.1.2. Interface Design...........................................................................................15 3.1.3. Input Output Design.....................................................................................15 3.1.4. Dialogue Design...........................................................................................15 Chapter 4. IMPLEMENTATION AND TESTING ......................................................17 4.1. Implementation....................................................................................................17 4.1.1. Tools Used ...................................................................................................17 4.1.2. Algorithm Implementation...........................................................................18 4.1.3. Listing of major class...................................................................................20 4.2. Testing.................................................................................................................21 4.2.1. Unit Testing .................................................................................................21 4.2.2. Integration Testing.......................................................................................22 4.2.3. System Testing.............................................................................................23 Chapter 5. CONCLUSION AND RECOMMENDATION...........................................25 5.1. Conclusion...........................................................................................................25 5.2. Recommendation.................................................................................................25 REFERENCES ..................................................................................................................27 BIBLIOGRAPHY..............................................................................................................28 Appendix I ............................................................................................................................I Appendix II........................................................................................................................IV
  • 5. v LIST OF FIGURES Figure 2.1.Use case Diagram...............................................................................................7 Figure 2.2.Gantt Chart .........................................................................................................9 Figure 2.3.ER Diagram......................................................................................................10 Figure 2.4.Level 0 DFD of Online Shop............................................................................11 Figure 2.5.Level 1 DFD of online shop.............................................................................12 Figure 2.6.Level 2.1 DFD of Online shop .........................................................................13 Figure 2.7.Level 2.1 DFD of online shop..........................................................................14 Figure 3.1.Dialogue Diagram of Online shopping.............................................................16
  • 6. vi LIST OF TABLES Table 4.1Transaction table.................................................................................................18 Table 4.2 Transaction iteration 1 .......................................................................................19 Table 4.3 Transaction iteration 1 final table ......................................................................19 Table 4.4 Transaction iteration 2 .......................................................................................20 Table 4.6.Unit Testing .......................................................................................................21 Table 4.7.Integrated Testing ..............................................................................................22 Table 4.8.Sytem Testing ....................................................................................................23
  • 7. vii LIST OF ABBREVIATIONS B2B Business-to-Business B2C Business-to-Consumer CRUD Create, Replace, Update and Delete CSS Cascading Style Sheet HTML Hyper Text Markup Language IIS Internet Information Services MVC Model View Controller MYSQL MY Structured Query Language.
  • 8. 1 Chapter 1. INTRODUCTION 1.1.Introduction Online Shopping “is a web-based project which is made for shopping through Internet. As the technology is being advanced the way of life is changing accordance. Now a day’s we can place the order for anything from our home. There is no need to go the shop of the thing we want. Then order can be placed online through internet. Today the internet have created a new economic scenario that not only stresses on the classical concept of the “product” but also on the modern concept of “service”. It is this level of service that dictates whether a commercial venture will succeed or not in the market. To provide a high accessibility of service the online shopping website has being design, so that potential customers need not go to a physical shop to buy products or services. Online shopping is the process whereby consumers directly buy goods or services from a seller in real-time, without an intermediary service, over the Internet. It is a form of electronic commerce. An online shop, e-shop, e-store, Internet shop, web shop, web store, online store, or virtual store evokes the physical analogy of buying products or services at a bricks-and-mortar retailer or in a shopping center. The process is called business-to-consumer (B2C) online shopping. When a business buys from another business, it is called business-to-business (B2B) online shopping. 1.2.Problem Statement Customer had to stand in rows to wait there turns to buy a particular thing from a popular shop. People had to suffer the rush of the market when they went for shopping. They used to think hundred times to buy any things due to sufficient money for shopping. The main problem are rush, the quarrel at the time of buying the things, time is not saved, harder to find things with the discount or sale items, has to go longer distance for buying things. 1.3.Objective The objective of this websites are following given below:  To provide the information about the product.  To develop the online shopping site using Apriori algorithm for recommendation
  • 9. 2 1.4.Scope and Limitation Scope: Purchasing and selling products and services over the internet without the need of going physically to the market is what online shopping all about. Online shopping is just like a retail store shopping that we do by going to the market, but it is done through the internet. Online shopping has made shopping painless and added more fun. Online stores offer product description, pictures, comparisons, price and much more. Few examples of these are Amazon.com, ebay.com, framt.com and the benefits of online shopping is that by having direct access to consumer, the online stores can offer products that cater to the needs of consumer, cookies can be used for tracking the customer selection over the internet or what is of their interest when they visit the site again. Online shopping makes use of digital technology for managing the flow of information, products, and payment between consumer, site owners and suppliers. Online shopping can be either B2B (business to business) or B2C (business to consumer). Limitation: The Limitation of online shopping are follows:  More categories option is not available only limited product item.  More user interactive features are currently unavailable like zooming, 3D picture etc.  Only Short listed payment options, payment like Visa, MasterCard, PayPal, etc. and also saving the card information for later checkouts is not available in our system. 1.5.Report Organization In chapter 1 include short description about online shopping, problem occur during project, objective of the system formation, scope and limitation of the system. In chapter 2 include some reviews of the system, requirement analysis: functional and non- functional, feasibility analysis of the system in various fields, and structure of the system requirement as data modeling and process modeling. In chapter 3 include the design of the system. This includes design of database, interface, input output and dialogue.
  • 10. 3 In chapter 4 include implementing and testing of the system. Implementation includes various tools used in the system and classes used in the system. Testing include various types of testing done to verify the system. In chapter 5 conclude the document with summary of the document and recommending for further work which we fail to do.
  • 11. 4 Chapter 2. REQUIREMENT ANALYSIS AND FEASIBILITY ANALYSIS 2.1.Literature Review 2.1.1.Existing System Study Online Shopping for Time saving: Consumers also expected that product delivery in online shopping will be quicker compared to offline stores and timely delivery on their convenience time; factors that keep consumers satisfy in using internet as a tool for shopping is timely and reliable delivery expected the relationship between time or effort savings and purchase intentions is strengthen; consumers will place more emphasis on the time and effort savings once they have experienced how little time and effort takes to make an online purchase. This system uses some modules such as login, logout, register, cart etc. This system also recommend the user using recommendation algorithm due to which it save time. They suggested that to save customer's time and fully reflect the convenience of online shopping, e- marketers should strengthen the web site's transaction capability and make sure all operations can be completed online [2]. Recommendation System using Apriori Algorithm: Recommendation system is a novel interactive technology for fetching additional data for any business from its transaction oriented database of customers. This system helps the customers to find products which they want to buy from the site. Recommendation system gives benefits to customers by enabling them to find products which they must buy. Conversely, they also help business by generating more sales, increasing their revenue. Recommendation systems are speedily becoming essential tools in E-commerce on the web. The Recommendation System using Apriori algorithm [1] can be implemented with four main functionalities: User Interface Component, Data Extraction, Web Usage Mining and Pattern Recognition [1]. Algorithm Apriori algorithm [1] is classical algorithm in data mining used for frequent item set mining and association rule learning. It is devised to operate on a database containing a lot of transactions, for instance, items brought by customers in a store. It is very important for
  • 12. 5 effective market basket analysis and help the customers in purchasing their items with more ease which increase the sales of the market. It proceeds by identifying the frequent individual items in the database and extending them to larger and larger item sets as long as those item sets appear sufficiently often in the database. The frequent item sets determined by Apriori can be used to determine association rules which highlight general trends in the database. Support: The support of an itemset X, supp(X) is the proportion of transaction in the database in which the item X appears. It signifies the popularity of an itemset. Supp (X)= Number of transaction in which X appears total number of transaction For example lets us suppose number of transaction in which X appears be 4 and total number of transaction be 6 then Supp (X)= 4 6 = 0.66667 If the sales of particular product above certain proposition have a meaningful effect on profits, that proportion can be considered as the support threshold. Confidence: The confidence of a rule is defined as follows: Conf (X-> Y)= 𝑠𝑢𝑝𝑝(𝑋 ∪ 𝑌) supp(X) It signifies the likelihood of item Y being purchased when item X is purchased. So, let us suppose for the rule {item1, item2} =>{item3}, Conf {(item1-> item2)=> (item3)} 𝑠𝑢𝑝𝑝(𝑖𝑡𝑒𝑚1,𝑖𝑡𝑒𝑚2,𝑖𝑡𝑒𝑚3) supp(item1,item2) = 3 6 ∗ 6 4 = 0.75 This implies that for 75% of the transactions containing item1 and item2, the rule is correct.
  • 13. 6 Pseudo Code of Apriori Algorithm: Apriori(T,∈) L1← {large 1 – itemsets} k←2 while Lk-1 ≠ 𝜃 Ck ←{a ∪ {b}| a ∈ Lk-1 ˄ b ∉ a} – {c|{s | s ⸦ c ˄|s|=k-1} ⸦ Lk-1} For transactions t∈T Ct ←{c|c ∈ Ck ˄ c ⸦ t} For candidates c ∈ Ct Count[c] ← count[c]+1 Lk←{c|c ∈ Ck ˄ count[c] > ∈ } k←k+1 return U Lk 2.2.Requirement Analysis 2.2.1.Functional Requirements Functional Requirement are statements of services that system should provide. It describes what the system should do. They are helpful to describe the system function in details. Here are some of the functional requirement for the system used by the users. The system include different function which should be performed within the system environment. Use Case Use case diagram is a graphic description of the interactions among the elements of a system. In this system there are two user’s admin user and end user. The Admin user can manage products and customers in the system. The Customer can view products, purchase products, manage customer information, and create product reviews. k
  • 14. 7 Figure 2.1.Use case Diagram 2.2.2.Non Functional Requirement.  Efficiency In our system customer can purchase product in an efficient manner using cart.
  • 15. 8  Reliability The system will provide a reliable environment to both customers and owner. All orders will be reaching at the admin without any errors.  Usability The system is designed for user friendly environment and ease of use. 2.3.Feasibility Analysis. This project carries goals that could be realistically accomplished. We have a clear goal of this. Since, web based application is not going to be highly complex, it will not need a lot of processing power. 2.3.1.Economical The software used are open source software which can be easily available for free of cost. We do not need complex and expensive hardware for the application. 2.3.2.Operational The proposed system would solve the educational problems and take advantage of the opportunities. The new systems would fit into the current day-to-day operations of the client. The system would save the time and effort of the clients. Thus, the system would be operationally feasible. 2.3.3.Technical Technically, this project is very feasible because of use of current and latest technique. All the technology needed for the system exists.This system is feasible on technical remarks as the proposed system is more beneficiary in terms of having a sound proof system with new technical components installed on the system. The proposed system can run on any machines supporting Windows and Internet services and works on the best software and hardware that had been used while designing the system so it would be feasible in all technical terms of feasibility.
  • 16. 9 2.3.4.Schedule. Gantt chart Figure 2.2.Gantt Chart 2.4.Structuring System Requirements 2.4.1.Data Modeling  ER Diagram In below diagram, there are three entities and they are product, customer and store whose primary keys are product_id, customer_id and purchase_id respectively. Customer has relationship with all the other entities. It has many to many relationship with store and one to many with product. There are one-to-many and many-to-many relations in the diagram which gives relationships between the attributes in the system.
  • 17. 10 Figure 2.3.ER Diagram 2.4.2.Process Modeling  DFD level 0 This DFD level 0 describes system in which there are two types of users of the system one is customer (end user) and another is admin. Admin user get detail of the customer and provides different types of services to the customer. End user/ customer places order to the system and get items as needed.
  • 18. 11 Figure 2.4.Level 0 DFD of Online Shop  DFD level 1 This DFD level 1 describes about the task which can be done by customer and admin after login in the system. When the admin login into the system, system will verify the admin when the verification is successful then only the admin user can do further work. After verified the Admin can login and can get information of different items, users and update category. After login by the customer, he or she can order goods, from the system.
  • 19. 12 Figure 2.5.Level 1 DFD of online shop  DFD level 2 This DFD level 2 describes about the customer. When the customer login if there is account the it can do further work but if it is not then customer have to register information in the system which helps to recognize the user by the system. After login the user can get the product list, product detail, and can buy goods.
  • 20. 13 Figure 2.6.Level 2.1 DFD of Online shop  DFD level 2.1 This level show the task which can be done by admin after login the system. When the admin login into the system, the system will verify the admin and when the verification is done then the admin is successfully login and the admin home page will be opened. In that page the admin can add the user, update the user information, delete the user, and view the user details and get to know about who are the users of the system. The Admin User can get all the information about the order details of the products and the customer too.
  • 21. 14 Figure 2.7.Level 2.1 DFD of online shop .
  • 22. 15 Chapter 3. SYSTEM DESIGN 3.1.System Design 3.1.1.Database Schema Design The name of the database of this system is dbconnect. It consists of 3 tables. Their names are: Products, Carts and Users. The schema of the database with its table and attributes are shown below:  Products ( Id, Name, Price, Status, AddedDate, ModifiedDate)  Carts ( Id, ProductId, Price, UserId, TransactionNo, Quantity)  Users ( Id, FirstName, LastName, Address, Phone, Email, Password, AddedDate, ModifiedDate, AdminRole, Status) 3.1.2.Interface Design The interface design is done using HTML and CSS which includes the outlook of the system which shows the home page, collection of items, details of the items, some pages which takes the information from the user and store in the database which help to login and logout process in the system. We have link some related pages due to which we can go from one page to another page. For normal user just the interface can be shown and cannot be edited but for Admin user the admin can operate CRUD operations in it. 3.1.3.Input Output Design We get user information and user address information for input output design. The user have to include the information which the registration page include and all the fields should be include to register in the system. The input which are inserted by the user is stored in the database and when the user register the page then the system check the input whether it matches the database or not. To login the user the user have to insert the login id and password after inserting the input the system checks the information in the system and then if match then respective page will be opened otherwise registration page will be opened. 3.1.4.Dialogue Design Using C# we link some related pages due to which we can go from one page to another page. Login, Register is done from the Home page. From login page, normal home page is accessed. Similarly from register we can access register Page. After login in the page we
  • 23. 16 can do cart and the cart items are checked out by the user. Finally we have a logout option in user profile which can take back to home page. Figure 3.1.Dialogue Diagram of Online shopping
  • 24. 17 Chapter 4. IMPLEMENTATION AND TESTING 4.1.Implementation 4.1.1.Tools Used We have used various development technologies for our system development. They are listed as below: HTML and CSS are utilized to implement the frontend.  HTML (Hyper Text Markup Language) We have used HTML to build the main structure of the website. By the help of HTML we have created some pages and link with each other and also we have add some pictures in it.  SQL Server It is used to create database and tables to store data.  JQuery JQuery has been used in our project for better user experience by providing effective website like loading time reduce, beautiful view etc.  CSS CSS is used to design the webpage to make it look more stylish. Without CSS the User Interface does not look nice.  ASP.NET MVC The ASP.NET uses MVC pattern to separate the logic, entity and view. We have followed the MVC pattern by placing all the entities that we will be using in Model folder, all the view pages in View Folder and the business logics in the Controller Folder.  C# All of the business logic are written in C# and it’s codes are written in Visual Studio.  IIS IIS is used to host the website locally.
  • 25. 18  Entity Framework Rather than writing SQL command we have used Entity Framework to map our object to relational model. Queries are written using LINQ a feature provided by C# to write queries. The entity framework translates this LINQ queries to T-SQL queries. 4.1.2.Algorithm Implementation In the project we have form three tables for keeping record of products, cart, and user. When the authorized user login into the system and cart some items and if the same user visit the system again then the system will recommend some items to the user. This is the simple work which the user can see in the user interface part. Actual work is done at the backend of the system. To recommend the user, the system create a table which keeps the record of item and transaction in this project that table is cart table which keeps the record. After keeping record of transaction the system will make a set of items and count them and keep the record. After this the system set support value as 2 with reference of the support value the value of set in the table will be compared and if the value is less than 2 then that set will be discarded from the list. Again form a table with set of three items and get the frequency and store in table and the new frequency is again compare with support value. When we get the last set in the table then the system will recommend the item in the set to the user. Let us suppose that we have some items in our system some of them are pant, shirt, sari, t- shirt, coat. We have five items in the system. Now we keep those items in our transaction table and list out as the items buy according to the transaction as: Table 4.1Transaction table Transaction Items 1 Pant, shirt ,coat 2 Shirt, sari 3 Coat, t-shirt, pant 4 Shirt t-shirt, pant 5 Shirt, sari ,coat 6 Pant, shirt, coat
  • 26. 19 From above table we get information about transaction and items in the system. Now we make item set and find out the frequency and let us set support value be 2 do we compare the values and keep those set whose value is greater than equal to 2: Table 4.2 transaction iteration 1 Table 4.3 transaction iteration 1 final table Itemset Support Pant, shirt 3 Pant, coat 3 Shirt, sari 2 Pant, t-shirt 2 Shirt, coat 2 Now again make a set of three items and find out the frequency and compare the frequency with support and find out new frequency. Itemset Frequency Support Pant, shirt 3 3 Pant, coat 3 3 Shirt, sari 2 2 Coat , t-shirt 1 Pant, t-shirt 2 2 Shirt, t-shirt 1 Shirt, coat 2 2 Sari, t-shirt 0 Sari, coat 1
  • 27. 20 Table 4.4 transaction iteration 2 Itemset frequency Support Pant, shirt,coat 2 2 pant, t-shirt coat 1 Shirt, t-shirt, pant 1 Shirt, sari, coat 1 When we compare with the support value then our remaining set will be {pant, shirt, coat}. Now when the customer purchase one item or two then the remaining item will be recommended by the system to the user as the following : {pant, shirt}=> coat {pant, coat}=>shirt {shirt, coat}=>pant Pant=>{shirt, coat} Shirt=>{pant, coat} Coat=>{shirt, pant} 4.1.3.Listing of major class  Cart controller This class have code for add to cart and checkout button.  Front controller This class consist of code to start and remove session.  Home controller This class consist of the codes to extract list of products from database.  Login controller It has the codes to login user and admin, register the new users and reset password.  Cart Module Cart Module is a class where we invoke the function ProcessTransaction.  ClothOrderDbContext This class consists of the Dbsets that maps models with tables.  Product module
  • 28. 21 This class is accessed only by admin to add, delete, edit and view the food items. 4.2.Testing 4.2.1.Unit Testing Unit testing is a software verification and validation method where the programmer gains confidence that individual units of source code are fit for use. A unit is the smallest testable part of an application. In procedural programming a unit may be an individual program, function, procedure, etc., while in object-oriented programming, the smallest unit is a class, which may belong to a base/super class, abstract class or derived/child class. Unit testing is done to test the small units of the system. In our system we do have some units which are being tested using Unit testing. Table 4.5.Unit Testing Test no. Test cases Test data Expected outcomes Actual result Status 1 Admin Login the user Enter id, password Login page is opened Login page is opened pass 2 Admin create user Enter the required filled Successfully registered Connection problem fail 3 Admin create user Enter the required filled Successfully registered Connection successful and successfully inserted the value pass 4 Admin view user Click on view button Show all the list of the user Connection error fail 5 Admin view user Click on view button Show all the list of the user Show the list of the user in tabular form pass 6 Admin delete the user Click on delete button Delete the respective user No change in the database fail
  • 29. 22 7 Customer login Enter the valid id, password Successfully login Open the respective page pass 8 Customer login Enter the valid id, password Successfully login Open the registration page 9 Customer logout Logout button pressed Normal home page is opened Session off is not execute so login the previous user fail 10 Customer logout Press the logout button Normal home page is opened Normal home page is opened pass 4.2.2.Integration Testing Integration testing, also known as integration and testing, is a software development process which program units are combined and tested as groups in multiple ways. In this context, a unit is defined as the smallest testable part of an application. Integration testing can expose problems with the interfaces among program components before trouble occurs in real-world program execution. Integration testing is a component of Extreme Programming, a pragmatic method of software development that takes a meticulous approach to building a product by means of continual testing and revision. There are two major ways of carrying out an integration test, called the bottom-up method and the top-down method. Bottom-up integration testing begins with unit testing, followed by tests of progressively higher-level combinations of units called modules or builds. In top-down integration testing, the highest-level modules are tested first and progressively lower-level modules are tested after that. In a comprehensive software development environment, bottom-up testing is usually done first, followed by top-down testing. Table 4.6.Integrated Testing Test no Test cases Test data Expected outcomes Actual outcome status 1 Registration Entry the required field Successfully registered Failed to register Fail
  • 30. 23 2 Registration Entry the required field Successfully registered Successfully registered pass 3 Update item Update item by admin and shown in user interface Successfully update but not shown in user interface Shown in user interface fail 4 Update items Update item by admin and shown in user interface Successfully update and shown in user interface Shown in user interface pass 4.2.3.System Testing We provide dummy data and tested the complete system. The system was successfully able to go to next step without creating much error. The result were expected and there was no problem while entering user Id, selecting item and showing the information. Item detail could be easily viewed and returning to the homepage and viewing recommended item and many more were successful. Table 4.7.Sytem Testing Test case ID Test case Expected result Actual result 1 Entry the valid date in user Id and user password and click on login button on login page. Login page should be display. Login page opened. 2 Entry the invalid date in user Id and user password and click on login button on login page. Registration Page will be displayed. Login the user.
  • 31. 24 3 Select the item and show the information Information shown to the user. Mission complete. 4 Select item and show the information Information showed to the user but another product Error message is display. 5 More than one item is stored with same name Item is displayed on the screen. Actual output what the user want is not displayed. 6 Order the items in the system Request complete and mail the customer Mission not complete so cannot order item
  • 32. 25 Chapter 5. CONCLUSION AND RECOMMENDATION 5.1.Conclusion The project entitled “Online shopping for clothing” has completed successfully. The system has been developed with much care and less errors and at the same time it is efficient and less time consuming. The purpose of this project was to develop a web application for purchasing items from online store. In this project, we have create user interface with the help of HTML, and CSS. This project will give short information about the products which are displayed in the web page which include color, size, brand etc. This project include some links of Cloth Manufacture Company, Cloth Store, and Map location from where we can get more detailed information. In the system the authorized user can login and see more detail information and items in the website. Only the admin user can change the content, user in the web site. In this project we have used Apriori Algorithm [1] for recommending the items to the authorized user. The items which are clicked frequent time are stored in the database and they are displayed on the screen after login by the authorized user. There is a scope for further development in our project to a great extent. A number of features can be added to this system in future like providing moderator more control over products so that each moderator can maintain their own products. Another feature we wished to implement was providing classes for customers so that different offers can be given to each class. System may keep track of history of purchases of each customer and provide suggestions based on their history. 5.2.Recommendation The following section discusses the work that will be implemented in future for further development of the system.  Detailed categories: Future work could involve adding more categories which are more detailed and have additional items.  Watch/Wish List: Work can add a watch list or wish list so that users can add an item to a list to watch for item prices to go down or to see when there is a sale on any of those items.
  • 33. 26  Enhanced User Interface: Work on enhancing the user interface by adding more user interactive features.  Payment Options: Add different payment options, such as Visa, MasterCard, PayPal, etc. where a user can also save the card information for later checkouts.
  • 34. 27 REFERENCES [1] K. S. Talwar, A. Oraganti and a. et, "Recommendation System using Apriori Algorithm," IJSRD - International Journal for Scientific Research & Development, pp. Vol. 3, Issue 01, 2015. [2] Broekhuizen, "Online Shopping," no. Time Saving, 2009.
  • 35. 28 BIBLIOGRAPHY  A. Fernandez and . A. D. Miyazaki, "“Consumer Perceptions of Privacy and Security Risks for Online Shopping.”".The Journal of Consumer Affairs 35.1 : 27-44.  E. . B. and . M. , "purchasing decision process," 1990.  B. M. Sarwar, G. Karypis, . J. A. Konstan and J. Reid, " Item-based collaborative filtering recommendation algorithms," in In Proceedings of the 10th International World Wide Web Conference, 285-295.  J. S. Breese, D. Heckerman and C. Kadie, " Empirical analysis of predictive algorithms for collaborative filtering," in In Proceedings of the Fourteenth Conference on Uncertainty in Artifical Intelligence, 1998.
  • 39. IV Appendix II Source Code: Apriori Algorithm: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using Test.AprioriAlgorithm.Model; namespace Test.AprioriAlgorithm.Implementation { public class AprioriAlgo { readonly Sorter _sorter = new Sorter(); public Output ProcessTransaction(double minSupport, double minConfidence, IEnumerable<string> items, string[] transactions) { IList<Item> frequentItems = GetL1FrequentItems(minSupport, items, transactions); ItemsDictionary allFrequentItems = new ItemsDictionary(); allFrequentItems.ConcatItems(frequentItems); IDictionary<string, double> candidates = new Dictionary<string, double>(); double transactionsCount = transactions.Count(); do { candidates = GenerateCandidates(frequentItems, transactions); frequentItems = GetFrequentItems(candidates, minSupport, transactionsCount); allFrequentItems.ConcatItems(frequentItems); } while (candidates.Count != 0); HashSet<Rule> rules = GenerateRules(allFrequentItems); IList<Rule> strongRules = GetStrongRules(minConfidence, rules, allFrequentItems); return new Output { StrongRules = strongRules, FrequentItems = allFrequentItems };} private List<Item> GetL1FrequentItems(double minSupport, IEnumerable<string> items, IEnumerable<string> transactions) { var frequentItemsL1 = new List<Item>(); double transactionsCount = transactions.Count(); foreach (var item in items)
  • 40. V { double support = GetSupport(item, transactions); if (support / transactionsCount >= minSupport) { frequentItemsL1.Add(new Item { Name = item, Support = support }); }} return frequentItemsL1; } private double GetSupport(string generatedCandidate, IEnumerable<string> transactionsList) { double support = 0; foreach (string transaction in transactionsList) { if (CheckIsSubset(generatedCandidate, transaction)) { support++; } } return support; } private bool CheckIsSubset(string child, string parent) { foreach (char c in child) { if (!parent.Contains(c)) { return false; }} return true; } private Dictionary<string, double> GenerateCandidates(IList<Item> frequentItems, IEnumerable<string> transactions) { Dictionary<string, double> candidates = new Dictionary<string, double>(); for (int i = 0; i < frequentItems.Count - 1; i++) { string firstItem = _sorter.Sort(frequentItems[i].Name); for (int j = i + 1; j < frequentItems.Count; j++) { string secondItem = _sorter.Sort(frequentItems[j].Name); string generatedCandidate = GenerateCandidate(firstItem, secondItem); if (generatedCandidate != string.Empty)
  • 41. VI { double support = GetSupport(generatedCandidate, transactions); candidates.Add(generatedCandidate, support); }}} return candidates; } private string GenerateCandidate(string firstItem, string secondItem) { int length = firstItem.Length; if (length == 1) { return firstItem + secondItem; } else { string firstSubString = firstItem.Substring(0, length - 1); string secondSubString = secondItem.Substring(0, length - 1); if (firstSubString == secondSubString) { return firstItem + secondItem[length - 1]; } return string.Empty; }} private List<Item> GetFrequentItems(IDictionary<string, double> candidates, double minSupport, double transactionsCount) { var frequentItems = new List<Item>(); foreach (var item in candidates) { if (item.Value / transactionsCount >= minSupport) { frequentItems.Add(new Item { Name = item.Key, Support = item.Value }); }} return frequentItems; } GetClosedItemSets(ItemsDictionary allFrequentItems) private Dictionary<string, double> GetItemParents(string child, int index, ItemsDictionary allFrequentItems) { var parents = new Dictionary<string, double>(); for (int j = index; j < allFrequentItems.Count; j++) { string parent = allFrequentItems[j].Name; if (parent.Length == child.Length + 1) { if (CheckIsSubset(child, parent)) { parents.Add(parent, allFrequentItems[parent].Support);
  • 42. VII }}} return parents; } private bool CheckIsClosed(string child, Dictionary<string, double> parents, ItemsDictionary allFrequentItems) { foreach (string parent in parents.Keys) { if (allFrequentItems[child].Support == allFrequentItems[parent].Support) { return false; }} return true; } private HashSet<Rule> GenerateRules(ItemsDictionary allFrequentItems) { var rulesList = new HashSet<Rule>(); foreach (var item in allFrequentItems) { if (item.Name.Length > 1) { IEnumerable<string> subsetsList = GenerateSubsets(item.Name); foreach (var subset in subsetsList) { string remaining = GetRemaining(subset, item.Name); Rule rule = new Rule(subset, remaining, 0); { if (!rulesList.Contains(rule)) rulesList.Add(rule); }}}} return rulesList; } private IEnumerable<string> GenerateSubsets(string item) { IEnumerable<string> allSubsets = new string[] { }; int subsetLength = item.Length / 2; for (int i = 1; i <= subsetLength; i++) { IList<string> subsets = new List<string>(); GenerateSubsetsRecursive(item, i, new char[item.Length], subsets); allSubsets = allSubsets.Concat(subsets); } return allSubsets; }
  • 43. VIII private void GenerateSubsetsRecursive(string item, int subsetLength, char[] temp, IList<string> subsets, int q = 0, int r = 0) { if (q == subsetLength) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < subsetLength; i++) {sb.Append(temp[i]); } subsets.Add(sb.ToString()); } else { for (int i = r; i < item.Length; i++) { temp[q] = item[i]; GenerateSubsetsRecursive(item, subsetLength, temp, subsets, q + 1, i + 1); }}} private string GetRemaining(string child, string parent) { for (int i = 0; i < child.Length; i++) { int index = parent.IndexOf(child[i]); parent = parent.Remove(index, 1);} return parent;} private IList<Rule> GetStrongRules(double minConfidence, HashSet<Rule> rules, ItemsDictionary allFrequentItems) { var strongRules = new List<Rule>(); foreach (Rule rule in rules) {string xy = _sorter.Sort(rule.X + rule.Y); AddStrongRule(rule, xy, strongRules, minConfidence, allFrequentItems); }return strongRules; } private void AddStrongRule(Rule rule, string XY, List<Rule> strongRules, double minConfidence, ItemsDictionary allFrequentItems) {double confidence = GetConfidence(rule.X, XY, allFrequentItems); if (confidence >= minConfidence) {Rule newRule = new Rule(rule.X, rule.Y, confidence); strongRules.Add(newRule);} confidence = GetConfidence(rule.Y, XY, allFrequentItems); if (confidence >= minConfidence && !strongRules.Contains(new Rule(rule.X, rule.Y, confidence))) {Rule newRule = new Rule(rule.Y, rule.X, confidence); strongRules.Add(newRule);}} private double GetConfidence(string X, string XY, ItemsDictionary allFrequentItems) { double supportX = allFrequentItems[X].Support; double supportXY = allFrequentItems[XY].Support; return supportXY / supportX;}}}