0% found this document useful (0 votes)
209 views86 pages

3 Clustering

This document provides an abstract and introduction for a research paper on a clustering-based collaborative filtering recommender system that uses an incentivized/penalized user model. The introduction defines the problem of recommending appropriate content based on user experience and outlines collaborative filtering and its limitations. It also discusses prior work on improving recommendation accuracy and clustering-based recommendation methods. The goal of the proposed approach is to enhance user experience by giving items incentives or penalties based on user preferences within clusters derived from rating data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
209 views86 pages

3 Clustering

This document provides an abstract and introduction for a research paper on a clustering-based collaborative filtering recommender system that uses an incentivized/penalized user model. The introduction defines the problem of recommending appropriate content based on user experience and outlines collaborative filtering and its limitations. It also discusses prior work on improving recommendation accuracy and clustering-based recommendation methods. The goal of the proposed approach is to enhance user experience by giving items incentives or penalties based on user preferences within clusters derived from rating data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 86

TABLE OF CONTENETS

CHAPTER NO. TITLE PAGE NO.

ABSTRACT

1. INTRODUCTION

1.1 Problem Definition

1.2 Literature Survey

2. SYSTEM ANALYSIS

2.1 Existing System

2.2 Proposed System

2.3 System Requirements

2.3.1 Hardware Specification

2.3.2 Software Specification

2.3.3 About Software

3. PROJECT DESCRIPTION

4. SYSTEM DESIGN

5. SYSTEM IMPLEMENTATION

5.1 Sample Screens

5.2 Sample Source Code

6. CONCLUSION

7. REFERENCES
CLUSTERING-BASED COLLABORATIVE FILTERING USING
AN INCENTIVIZED/PENALIZED USER MODEL
Abstract

Giving or recommending appropriate content based on the quality of experience is the most
important and challenging issue in recommender systems. As collaborative filtering (CF) is one
of the most prominent and popular techniques used for recommender systems, we propose a new
clusteringbased CF (CBCF) method using an incentivized/penalized user (IPU) model only with
ratings given by users, which is thus easy to implement. We aim to design such a simple
clustering-based approach with no further prior information while improving the
recommendation accuracy. To be precise, the purpose of CBCF with the IPU model is to
improve recommendation performance such as precision, recall, and F1 score by carefully
exploiting different preferences among users. Specifically, we formulate a constrained
optimization problem, in which we aim to maximize the recall (or equivalently F1 score) for a
given precision. To this end, users are divided into several clusters based on the actual rating data
and Pearson correlation coefficient. Afterwards, we give each item an incentive/penalty
according to the preference tendency by users within the same cluster. Our experimental results
show a significant performance improvement over the baseline CF scheme without clustering in
terms of recall or F1 score for a given precision.

Key words: Clustering, Collaborative filtering, Incentivized/penalized user model, Pearson


correlation coefficient, Recommender system.
1. INTRODUCTION

People are likely to have an increasing difficulty in finding their favorite content effectively
since extensive collections of video, audio, papers, art, etc. have been created both online and
offline. For example, over hundreds of feature films and hundreds of thousands of books have
been produced and published every year in the US. However, one person would read at most
about 10,000 books in his/her life, and then he/she must choose his/her favorite books among
them. On the one hand, recommender systems have been developed and used in diverse domains
(e.g., the movie industry, the music industry, and so on) by helping people to select appropriate
content based on individual preferences [1]. Especially, online commerce industries such as
Amazon.com and Netflix have successfully exploited how to increase customer loyalty. For
example, Amazon.com and Netflix have generated much of their sales by providing personalized
items through their own recommender systems [2], [3].

While diverse recommender systems such as personalized recommendations, content-based


recommendations, and knowledge-based recommendations have been developed, collaborative
filtering (CF) is one of the most prominent and popular techniques used for recommender
systems [4], [5]. CF methods are generally classified into memory-based CF and model-based
CF. In model-based CF, training datasets are used to develop a model for predicting user
preferences. Different machine learning techniques such as Bayesian networks, clustering, and
rule-based approaches can also be utilized to build models. An alternating least squares with
weighted _-regularization (ALS-WR) scheme is a representative example of model-based CF.
ALS-WR is performed based on a matrix factorization algorithm and is tolerant of the data
sparsity and scalability [6], [7]. The main advantages of model-based CF are an improvement of
prediction performance and the robustness against the data sparsity. However, it has some
shortcomings such as an expensive cost for building a model [5]. On the other hand, memory-
based CF does not build a specific model, but directly computes the similarity between users or
items using the entire rating matrix or its samples. Hence, memory-based CF is easy to
implement and effective to manage. However, it has also some drawbacks such as dependence
on human ratings, performance decrement when data are sparse, and disability of
recommendation for new users (i.e., cold-start users) and items [5].
Memory-based CF approaches are again classified into user-based CF and item-based CF. The
main ideas behind the user-based CF and item-based CF approaches are to find the user
similarity and the item similarity, respectively, according to the ratings (or preferences). After
finding similar users, called neighbors, user-based CF recommends the top-N most preferable
items that an active user has not accessed yet. User-based CF has limitations related to
scalability, especially when the number of users is much larger than the number of items. Item-
based CF was proposed to mitigate this scalability problem, but cannot still entirely solve the
problem when the numbers of users and items are large. Despite such limitations, CF has been
employed as one of the most representative recommender systems leveraged in online
commerce.

In addition, there have been many studies on the design of CF algorithms in terms of reducing
the mean absolute error (MAE) or root mean squared error (RMSE) of rating prediction [8].
However, recommender systems designed in the sense of minimizing the MAE or RMSE do not
inherently improve recommendation accuracy. We assume that there are two recommender
systems having the same MAE or RMSE of the rating prediction. We note that they may differ
from each other in terms of user experience (UX) since there is a possibility that one
recommender system recommends an item whereas the other does not. For example, suppose
that the real preference of a user on an item is 4.2 and two recommender systems predict the
preference as 3.8 and 4.6, respectively. Then, when items having the predicted preference of
more than 4.0 are assumed to be recommended, the MAEs of two recommender systems are the
same but only the latter one will recommend the item. In order to redeem the above case, some
performance metrics related to UX such as precision, recall, and F1 score have been widely used
in the literature.

On the other hand, several companies, e.g., Pandora Internet Radio, Netflix, and Artsy, have
developed their own clustering-based recommendation methods, called Music Genome Project,
Micro-Genres of Movies, and Art Genome Project, respectively. These clustering-based
recommendation methods have successfully led to satisfactory performance, but the processing
cost for clustering is very expensive. For example, it is widely known that each song tends to be
analyzed by a musician through a process that takes usually 20 to 30 minutes per song in the case
of Music Genome Project.

1.1PROBLEM STATEMENT
The contribution of our work is to make a proper decision with which items should be
recommended or not under the same MAE or RMSE in terms of improving UX. If a
recommender system only suggests items whose predicted preference, then above two items will
be dropped by the system. However, there may be some users who are satisfied with the items,
and thus UX will decrease in this case. In order to enhance the UX, we give each item an
incentive or penalty according to the preference tendency by users. We cluster users into some
groups and make a decision on which items are given the incentive/penalty based on a group that
users belong to.

1.2 LITERATURE SURVEY

CF-aided recommender systems. CF is one of the most popular techniques used by


recommender systems, but has some shortcomings vulnerable to data sparsity and cold-start
problems [9]. If the data sparsity problem occurs with insufficient information about the ratings
of users on items, then the values of predicted preference become inaccurate. Moreover, new
users or items cannot be easily embedded in the CF process based on the rating information.
There have been a plenty of challenges tackling these two problems [10], [11]. On the other
hand, some of studies focused on how to improve prediction accuracy of CF-aided recommender
systems [8], [12], [13]. In [12], [13], new similarity models were presented by using proximity
impact popularity and Jaccard similarity measures, respectively. In [8], a typicality-based CF
method, termed TyCo, was shown by taking into account typicality degrees. Recently,
serendipitous CF-aided recommender systems
received an attention, where surprising and interesting items are recommended to users [14],
[15], [16].
Clustering methods. Clustering has been widely used in diverse data mining applications:
clustering algorithms such as k-Means and density-based spatial clustering of applications with
noise (DBSCAN) were implemented in [17] to monitor game stickiness; a novel objective
function based on the entropy was proposed in [18] to cluster different types of images; a cluster
validity index based on a one-class classification method was presented in [19] by calculating a
boundary radius of each cluster using kernel functions; a modified version of mean shift
clustering for one-dimensional data was proposed in [20] to meet the real-time requirements in
parallel processing systems; and a new criterion, called the cluster similar coefficient (CSC), was
introduced in [21] to determine the suitable number of clusters, to analyze the non-fuzzy and
fuzzy clusters, and to build clusters with a given CSC.
Clustering-based recommender systems. There has been diverse research to enhance
recommendation accuracy by means of clustering methods [22], [23], [24], [25]. In [22], CF and
content-based filtering methods were conducted by finding similar users and items, respectively,
via clustering, and then personalized recommendation to the target user was made. As a result,
improved performance on the precision, recall, and F1 score was shown. Similarly as in [22],
communities (or groups) were discovered in [23] before the application of matrix factorization to
each community. Social activeness and dynamic interest features were exploited to find similar
communities by item grouping, where items are clustered into several groups using cosine
similarity. As a result of grouping, the K most similar users based on the similarity measure were
selected for recommendation. The performance of user-based CF with several clustering
algorithms including K- Means, self-organizing maps (SOM), and fuzzy C-Means (FCM)
clustering methods was shown in [25]. It was shown that user-based CF based on the FCM has
the best performance in comparison with K-Means and SOM clustering methods.
Moreover, several clustering approaches were studied in CF-aided recommender systems:
heterogeneous evolutionary clustering was presented in [26] by dividing individuals with similar
state values into the same cluster according to stable states; another dynamic evolutionary
clustering was shown in [27] by computing user attribute distances; and more recently, dynamic
evolutionary clustering based on time weight and latent attributes was proposed in [28].

2. SYSTEM ANALYSIS

2.1 EXISTING SYSTEM


A cluster contains some similar services just like a club which contains some like-minded
users. Since the number of services in a cluster is much less than the total number of services, the
computation time of CF algorithm can be reduced significantly. The traditional CF techniques
have two main and major challenges. They are make decision within acceptable time.To generate
ideal recommendations from so many services.
Disadvantages
 dependence on human ratings, performance decrement when data are sparse, and
disability of recommendation for new users (i.e., cold-start users) and items.
 algorithms converge to a local minimum.
 Hierarchical clustering methods can be further classified into agglomerative or divisive,
depending on whether the clustering hierarchy is formed in a bottom-up or top-down
fashion.

2.2 PROPOSED SYSTEM

Our proposed method is built upon a predicted rating matrix-based clustering that can drastically
reduce the processing overhead of clustering. In our CBCF method, we aim to select items to be
recommended for users along with clustering. To this end, users are divided into several clusters
based on the actual rating data and Pearson correlation coefficient. Then, items are regarded as
more important or less important depending on the clusters that the users belong to. Afterwards,
we give each item an incentive/penalty according to the preference tendency by users within the
same cluster. The main contributions of our work are summarized as follows.
An easy-to-implement CBCF method using the IPU model is proposed to further enhance the
performance related to UX.
 To design our CBCF method, we first formulate a constrained optimization problem, in
which we aim to maximize the recall (or equivalently F1 score) for a given precision.
 We numerically find the amount of incentive/penalty that is to be given to each item
according to the preference tendency by users within the same cluster.
 We evaluate the performance of the proposed method via extensive experiments and
demonstrate that F1 score of
 the CBCF method using the IPU model is improved compared with the baseline CF
method without clustering,
 while recall for given (fixed) precision can be significantly improved by up to about 50%.

Advantages
 Model-based approaches offer the benefits of prediction speed and scalability, they have
some practical challenges such as inflexibility and quality of predictions.
 More specifically, building a model is often a time- and resource-consuming process; and
the quality of predictions depends heavily on the way that a model is built.

2.3 SYSTEM SPECIFICATION

2.3.1 HARDWARES REQUIRED

 System : Pentium IV 2.4 GHz

 Hard Disk : 40 GB

 Floppy Drive : 1.44 MB

 Monitor : 15 VGA colour

 Mouse : Logitech.

 RAM : 256 MB
2.3.2 SOFTWARES REQUIRED
 Server Side Programming : PHP.

 Middleware Programming : JAVASCRIPT

 Operating System : Windows XP Professional (Service Pack 2)

 Web Server : Apache Server

 Client Script : HTML, CSS and Java Script

 Database : MYSQL-Server 2005 Express Edition

2.3.3 SOFTWARE ENVIRONMENT

PHP

PHP is a server-side scripting language designed for web development but also used as a
general-purpose programming language. Originally created by Rasmus Lerdorf in 1994,the PHP
reference implementation is now produced by The PHP Group.PHP originally stood for Personal
Home Page,but it now stands for the recursive backronym PHP: Hypertext Preprocessor.

PHP code may be embedded into HTML code, or it can be used in combination with
various web template systems, web content management system and web frameworks. PHP code
is usually processed by a PHP interpreter implemented as a module in the web server or as a
Common Gateway Interface (CGI) executable. The web server combines the results of the
interpreted and executed PHP code, which may be any type of data, including images, with the
generated web page. PHP code may also be executed with a command-line interface (CLI) and
can be used to implement standalone graphical applications.
The standard PHP interpreter, powered by the Zend Engine, is free software released
under the PHP License. PHP has been widely ported and can be deployed on most web servers
on almost every operating system and platform, free of charge.

The PHP language evolved without a written formal specification or standard until 2014,
leaving the canonical PHP interpreter as a de facto standard. Since 2014 work has gone on to
create a formal PHP specification

PHP started out as a small open source project that evolved as more and more people
found out how useful it was. Ramus Lerdorf unleashed the first version of PHP way back in
1994.

PHP is a recursive acronym for "PHP: Hypertext Preprocessor".

PHP is a server side scripting language that is embedded in HTML. It is used to manage
dynamic content, databases, session tracking, even build entire ecommerce sites.

It is integrated with a number of popular databases, including MySQL, PostgreSQL,Oracle,


Sybase, Informix, and Microsoft SQL Server.

PHP is pleasingly zippy in its execution, especially when compiled as an Apache module on the
Unix side. The MySQL server, once started, executes even very complex queries with huge
result sets in record setting time.

PHP supports a large number of major protocols such as POP3, IMAP, and LDAP. PHP4 added
support for Java and distributed object architectures (COM and CORBA), making n-tier
development a possibility for the first time.

PHP is forgiving: PHP language tries to be as forgiving as possible.

PHP Syntax is C-like


Environment Setup:

In order to develop and run PHP Web pages, three vital components need to be installed
on your computer system.

WebServer- PHP will work with virtually all Web Server software, including Microsoft's
Internet Information Server (IIS) but then most often used is freely available Apache Server.
Download Apache for free here: http://httpd.apache.org/download.cg

Database- PHP will work with virtually all database software, including Oracle and Sybase but
most commonly used is freely available MySQL database. Download MySQL for free here:
http://www.mysql.com/downloads/index.html

PHP Parser- In order to process PHP script instructions, a parser must be installed to generate
HTML output that can be sent to the Web Browser. This tutorial will guide you how to install
PHP parser on your computer.

The PHP interpreter only executes PHP code within its delimiters. Anything outside its
delimiters is not processed by PHP, although non-PHP text is still subject to control structures
described in PHP code. The most common delimiters are <?php to open and ?> to close PHP
sections. The shortened form <? also exists. This short delimiter makes script files less portable,
since support for them can be disabled in the local PHP configuration and it is therefore
discouraged. However, there is no recommendation against the use of the echo short tag <?=.
Prior to PHP 5.4.0, this short syntax for echo() only works with the short_open_tag
configuration setting enabled, while for PHP 5.4.0 and later it is always available. The purpose
of all these delimiters is to separate PHP code from non-PHP content, such as JavaScript code or
HTML markup.
The first form of delimiters, <?php and ?>, in XHTML and other XML documents, creates
correctly formed XML processing instructions. This means that the resulting mixture of PHP
code and other markup in the server-side file is itself well-formed XML.

Variables are prefixed with a dollar symbol, and a type does not need to be specified in advance.
PHP 5 introduced type hinting that allows functions to force their parameters to be objects of a
specific class, arrays, interfaces or callback functions. However, before PHP 7.0, type hints could
not be used with scalar types such as integer or string.

Unlike function and class names, variable names are case sensitive. Both double-quoted ("") and
here doc strings provide the ability to interpolate a variable's value into the string. PHP treats
newlines as whitespace in the manner of a free-form language, and statements are terminated by
a semicolon. PHP has three types of comment syntax: /* */ marks block and inline comments; //
as well as # are used for one-line comments. The echo statement is one of several facilities PHP
provides to output text, e.g., to a web browser.

In terms of keywords and language syntax, PHP is similar to the C style syntax. if conditions, for
and while loops, and function returns are similar in syntax to languages such as C, C++, PHP,
Java and Perl.

Data types

PHP stores whole numbers in a platform-dependent range, either a 64-bit or 32-bit signed
integer equivalent to the C-language long type. Unsigned integers are converted to signed values
in certain situations; this behavior is different from other programming languages.Integer
variables can be assigned using decimal (positive and negative), octal, hexadecimal, and binary
notations.

Floating point numbers are also stored in a platform-specific range. They can be specified using
floating point notation, or two forms of scientific notation. PHP has a native Boolean type that is
similar to the native Boolean types in Java and C++. Using the Boolean type conversion rules,
non-zero values are interpreted as true and zero as false, as in Perl and C++.[
The null data type represents a variable that has no value; NULL is the only allowed value for
this data type.

Variables of the "resource" type represent references to resources from external sources.
These are typically created by functions from a particular extension, and can only be processed
by functions from the same extension; examples include file, image, and database resources.

Arrays can contain elements of any type that PHP can handle, including resources,
objects, and even other arrays. Order is preserved in lists of values and in hashes with both keys
and values, and the two can be intermingled. PHP also supports strings, which can be used with
single quotes, double quotes, nowdoc or heredoc syntax.

The Standard PHP Library (SPL) attempts to solve standard problems and implements
efficient data access interfaces and classes.

Functions

PHP defines a large array of functions in the core language and many are also available in
various extensions; these functions are well documented in the online PHP documentation.
However, the built-in library has a wide variety of naming conventions and associated
inconsistencies, as described under history above.

In lieu of function pointers, functions in PHP can be referenced by a string containing


their name. In this manner, normal PHP functions can be used, for example, as callbacks or
within function tables. User-defined functions may be created at any time without being
prototyped. Functions may be defined inside code blocks, permitting a run-time decision as to
whether or not a function should be defined. There is a function_exists function that determines
whether a function with a given name has already been defined. Function calls must use
parentheses, with the exception of zero-argument class constructor functions called with the PHP
operator new, in which case parentheses are optional.

Until PHP 5.3, support for anonymous functions and closures did not exist in PHP. While
create_function() exists since PHP 4.0.1, it is merely a thin wrapper around eval() that allows
normal PHP functions to be created during program execution.PHP 5.3 added syntax to define an
anonymous function or "closure"which can capture variables from the surrounding scope:

function getAdder($x) {
return function($y) use ($x) {
return $x + $y;
};
}
$adder = getAdder(8);
echo $adder(2); // prints "10"

In the example above, getAdder() function creates a closure using passed argument $x (the
keyword use imports a variable from the lexical context), which takes an additional argument $y,
and returns the created closure to the caller. Such a function is a first-class object, meaning that it
can be stored in a variable, passed as a parameter to other functions, etc

Unusually for a dynamically typed language, PHP supports type declarations on function
parameters, which are enforced at runtime. This has been supported for classes and interfaces
since PHP 5.0, for arrays since PHP 5.1, for "callables" since PHP 5.4, and scalar (integer, float,
string and boolean) types since PHP 7.0.PHP 7.0 also has type declarations for function return
types, expressed by placing the type name after the list of parameters, preceded by a colon.For
example, the getAdder function from the earlier example could be annotated with types like so in
PHP 7:

function getAdder(int $x): \Closure {


return function(int $y) use ($x) : int {
return $x + $y;
};
}
$adder = getAdder(8);
echo $adder(2); // prints "10"
echo $adder(null); // throws an exception because an incorrect type was passed
$adder = getAdder([]); // would also throw an exception

By default, scalar type declarations follow weak typing principles. So, for example, if a
parameter's type is int, PHP would allow not only integers, but also convertible numeric strings,
floats or booleans to be passed to that function, and would convert them. However, PHP 7 has a
"strict typing" mode which, when used, disallows such conversions for function calls and returns
within a file.

Objects

Basic object-oriented programming functionality was added in PHP 3 and improved in


PHP 4. This allowed for PHP to gain further abstraction, making creative tasks easier for
programmers using the language. Object handling was completely rewritten for PHP 5,
expanding the feature set and enhancing performance. In previous versions of PHP, objects were
handled like value types. The drawback of this method was that code had to make heavy use of
PHP's "reference" variables if it wanted to modify an object it was passed rather than creating a
copy of it. In the new approach, objects are referenced by handle, and not by value.

PHP 5 introduced private and protected member variables and methods, along with
abstract classes, final classes, abstract methods, and final methods. It also introduced a standard
way of declaring constructors and destructors, similar to that of other object-oriented languages
such as C++, and a standard exception handling model. Furthermore, PHP 5 added interfaces and
allowed for multiple interfaces to be implemented. There are special interfaces that allow objects
to interact with the runtime system. Objects implementing Array Access can be used with array
syntax and objects implementing Iterator or Iterator Aggregate can be used with the foreach
language construct. There is no virtual table feature in the engine, so static variables are bound
with a name instead of a reference at compile time.

If the developer creates a copy of an object using the reserved word clone, the Zend
engine will check whether a __clone() method has been defined. If not, it will call a default
__clone() which will copy the object's properties. If a __clone() method is defined, then it will be
responsible for setting the necessary properties in the created object. For convenience, the engine
will supply a function that imports the properties of the source object, so the programmer can
start with a by-value replica of the source object and only override properties that need to be
changed.

The following is a basic example of object-oriented programming in PHP:

class Person
{
public $firstName;
public $lastName;

public function __construct($firstName, $lastName = '') { // optional second argument


$this->firstName = $firstName;
$this->lastName = $lastName;
}

public function greet() {


return 'Hello, my name is ' . $this->firstName .
(($this->lastName != '') ? (' ' . $this->lastName) : '') . '.';
}

public static function staticGreet($firstName, $lastName) {


return 'Hello, my name is ' . $firstName . ' ' . $lastName . '.';
}
}

$he = new Person('John', 'Smith');


$she = new Person('Sally', 'Davis');
$other = new Person('iAmine');

echo $he->greet(); // prints "Hello, my name is John Smith."


echo '<br />';
echo $she->greet(); // prints "Hello, my name is Sally Davis."
echo '<br />';

echo $other->greet(); // prints "Hello, my name is iAmine."


echo '<br />';

echo Person::staticGreet('Jane', 'Doe'); // prints "Hello, my name is Jane Doe."

The visibility of PHP properties and methods is defined using the keywords public,
private, and protected. The default is public, if only var is used; var is a synonym for public.
Items declared public can be accessed everywhere. protected limits access to inherited classes
(and to the class that defines the item). private limits visibility only to the class that defines the
item.Objects of the same type have access to each other's private and protected members even
though they are not the same instance. PHP's member visibility features have sometimes been
described as "highly useful." However, they have also sometimes been described as "at best
irrelevant and at worst positively harmful."

Implementations

The original, only complete and most widely used PHP implementation is powered by the Zend
Engine and known simply as PHP. To disambiguate it from other implementations, it is
sometimes unofficially referred to as "Zend PHP". The Zend Engine compiles PHP source code
on-the-fly into an internal format that it can execute, thus it works as an interpreter.It is also the
"reference implementation" of PHP, as PHP has no formal specification, and so the semantics of
Zend PHP define the semantics of PHP itself. Due to the complex and nuanced semantics of
PHP, defined by how Zend works, it is difficult for competing implementations to offer complete
compatibility.

PHP's single-request-per-script-execution model, and the fact the Zend Engine is an interpreter,
leads to inefficiency; as a result, various products have been developed to help improve PHP
performance. In order to speed up execution time and not have to compile the PHP source code
every time the web page is accessed, PHP scripts can also be deployed in the PHP engine's
internal format by using an opcode cache, which works by caching the compiled form of a PHP
script (opcodes) in shared memory to avoid the overhead of parsing and compiling the code
every time the script runs. An opcode cache, Zend Opcache, is built into PHP since version
5.5.Another example of a widely used opcode cache is the Alternative PHP Cache (APC), which
is available as a PECL extension.

While Zend PHP is still the most popular implementation, several other implementations
have been developed. Some of these are compilers or support JIT compilation, and hence offer
performance benefits over Zend PHP at the expense of lacking full PHP compatibility.
Alternative implementations include the following:

 HipHop Virtual Machine (HHVM) – developed at Facebook and available as open


source, it converts PHP code into a high-level bytecode (commonly known as an
intermediate language), which is then translated into x86-64 machine code dynamically at
runtime by a just-in-time (JIT) compiler, resulting in up to 6× performance
improvements.
 Parrot – a virtual machine designed to run dynamic languages efficiently; Pipp transforms
the PHP source code into the Parrot intermediate representation, which is then translated
into the Parrot's bytecode and executed by the virtual machine.
 Phalanger – compiles PHP into Common Intermediate Language (CIL) bytecode
 HipHop – developed at Facebook and available as open source, it transforms the PHP
scripts into C++ code and then compiles the resulting code, reducing the server load up to
50%. In early 2013, Facebook deprecated it in favor of HHVM due to multiple reasons,
including deployment difficulties and lack of support for the whole PHP language,
including the create_function() and eval() constructs.

JAVASCRIPT
A scripting language developed by Netscape to enable Web authors to design interactive
sites. Although it shares many of the features and structures of the full Java language, it was
developed independently. JavaScript can interact with HTML source code, enabling Web authors
to spice up their sites with dynamic content. JavaScript is endorsed by a number of software
companies and is an open language that anyone can use without purchasing a license. It is
supported by recent browsers from Netscape and Microsoft, though Internet Explorer supports
only a subset, which Microsoft calls Jscript

What is JavaScript?

•It is a programming language.

•It is an interpreted language.

•It is object-based programming.

•It is widely used and supported

•It is accessible to the beginner

Uses of JavaScript

•Use it to add multimedia elements With JavaScript you can show, hide, change, resize images,
and create image rollovers. You can create scrolling text across the status bar.

•Create pages dynamically Based on the user's choices, the date, or otherexternal data, JavaScript
can produce pages that are customized to the user.

•Interact with the user It can do some processing of forms and can validate user input when the
user submits the form.

Writing JavaScript

JavaScript code is typically embedded in the HTML, to be interpreted and


run by the client's browser. Here are some tips to remember when writing

JavaScript commands.

•JavaScript code is case sensitive

•White space between words and tabs are ignored

•Line breaks are ignored except within a statement

•JavaScript statements end with a semi- colon ;

Implementing JavaScript

There are three ways to add JavaScript commands to your Web Pages.

•Embedding code

•Inline code

•External file

External File

You can use the SRC attribute of the <SCRIPT> tag to call JavaScript code from an
external text file. This is useful if you have a lot of code or you want to run it from several pages,
because any number of pages can call the same external JavaScript file. The text file itself
contains no HTML tags. It is call by the following tag:

<SCRIPT SRC="filename.js">

</SCRIPT>

Programming Basics
Programmers use variables to store values. A variable can hold several types of data. In
JavaScript you don't have to declare a variable's data type before using it. Any variable can hold
any JavaScript data type, including:

•String data

•Numbers

•Boolean values (T/F)

Variable Names

There are rules and conventions in naming variables in any programming language. It is
good practice to use descriptive names for variables. The following are the JavaScript rules:

•The variable name must start with a letter or an underscore. firstName or _myName

•You can use numbers in a variable name, but not as the first character.

name01 or tuition$

•You can't use space to separate characters. userName not user Name

•Capitalize the first letter of every word except the first salesTax or userFirstName.

Functions

With functions, you can give a name to a whole block of code, allowing you to reference it from
anywhere in yourprogram. JavaScript has built-in functions for several predefined operations.
Here are three some functions.

•alert("message")

•confirm("message")

•prompt("message")
User-Defined Functions

With user-defined functions, you can name a block of code and call it when

you need it. You define a function in the HEAD section of a web page. It is

defined with the functionkeyword, followed by the function name and any

arguments.

function functionName(argument)

statements

}
XAMPP

What is XAMPP?

XAMPP is an open-source web server package that works on various platforms. It is


actually an acronym with X meaning “cross” platform, A for Apache HTTP server, M for
MySQL, P for PHP, and P for Perl. XAMPP was designed to help webpage developers,
programmers, and designers check and review their work using their computers even without
connection to the web or internet. So, basically XAMPP may be used to stand as pages for
the internet even without connection to it. It can also be used to create and configure with
databases written in MySQL and/or SQLite. And since XAMPP is designed as a cross-platform
server package, it is available for a variety of operating systems and platforms like Microsoft
Windows, Mac OS X, Linux, and Solaris. To use XAMPP, only one zip, exe or tar file is needed.
Users just need to download this file and run the application. There is also not much
configuration and tinkering to be done in terms of settings and its components. The XAMPP
package is also updated on a regular basis to synchronize with the updates made on the different
platforms involved in the package like Apache, PHP, Perl, and MySQL.

Aside from being cross-platform, XAMPP is also a freeware. This means users on
different operating systems can download this server package free of charge. Not to mention that
there is no configuration necessary to setup the system. After downloading and extracting the
free application, users can immediately use XAMPP. Users also do not have to worry on
removing the application. If XAMPP is not needed by the user anymore, removing it should not
present any problem. One just needs to delete the XAMPP directory and all the files concerning
this server package will be deleted. Or if XAMPP was installed using the Windows installer
version, one just needs to go to the “uninstall” feature of the operating system to get rid of the
server package.
CSS

Cascading Style Sheets (CSS) is a style sheet language used for describing


the presentation of a document written in a markup language. Although most often used to set
the visual style of web pages and user interfaces written in HTML and XHTML, the language
can be applied to any XML document, including plain XML, SVG and XUL, and is applicable to
rendering in speech, or on other media. Along with HTML and JavaScript, CSS is a cornerstone
technology used by most websites to create visually engaging webpages, user interfaces for web
applications, and user interfaces for many mobile applications.

 CSS is designed primarily to enable the separation of document content from document


presentation, including aspects such as the layout, colors, and fonts. This separation can
improve content accessibility, provide more flexibility and control in the specification of
presentation characteristics, enable multiple HTML pages to share formatting by specifying
the relevant CSS in a separate .css file, and reduce complexity and repetition in the structural
content.
 This separation of formatting and content makes it possible to present the same markup page
in different styles for different rendering methods, such as on-screen, in print, by voice (when
read out by a speech-based browser or screen reader) and on Braille-based, tactile devices. It
can also be used to display the web page differently depending on the screen size or device
on which it is being viewed. Readers can also specify a different style sheet, such as a CSS
file stored on their own computer, to override the one the author has specified.
 Changes to the graphic design of a document (or hundreds of documents) can be applied
quickly and easily, by editing a few lines in the CSS file they use, rather than by changing
markup in the documents.
 The CSS specification describes a priority scheme to determine which style rules apply if
more than one rule matches against a particular element. In this so-called cascade, priorities
(or weights) are calculated and assigned to rules, so that the results are predictable.
APACHE

Apache is the most popular Web server software. It enables a computer to host one or
more websites that can be accessed over the Internet using a Web browser. The first version of
Apache was released in 1995 by the Apache Group. In 1999, the Apache Group became the
Apache Software Foundation, a non-profit organization that currently maintains the development
of the Apache Web server software.
Apache's popularity in the Web hosting market is largely because it is open source and
free to use. Therefore, Web hosting companies can offer Apache-based Web hosting solutions at
minimal costs. Other server software, such as Windows Server, requires a commercial license.
Apache also supports multiple platforms, including Linux, Windows, and Macintosh operating
systems. Since many Linux distributions are also open-source, the Linux/Apache combination
has become the most popular Web hosting configuration.
Apache can host static websites, as well as dynamic websites that use server-side
scripting languages, such as PHP, Python, or Perl. Support for these and other languages is
implemented through modules, or installation packages that are added to the standard Apache
installation. Apache also supports other modules, which offer advanced security options, file
management tools, and other features. Most Apache installations include a URL rewriting
module called "mod_rewrite," which has become a common way for webmasters to create
custom URLs.
While the Apache Web server software is commonly referred to as just "Apache," it is
technically called "Apache HTTP Server," since the software serves webpages over the
HTTP protocol. When Apache is running, its process name is "httpd," which is short for "HTTP
daemon."

Apache Open Office:

Apache Open Office is the leading open-source office software suite for word


processing, spreadsheets, presentations, graphics, databases and more. It is available in many
languages and works on all common computers. It stores all your data in an international open
standard format and can also read and write files from other common office software packages. It
can be downloaded and used completely free of charge for any purpose.

MYSQL

MySQL is an open source relational database management system (RDBMS) based on


Structured Query Language (SQL).

MySQL runs on virtually all platforms, including Linux, UNIX, and Windows. Although


it can be used in a wide range of applications, MySQL is most often associated with web-based
applications and online publishing and is an important component of an open source enterprise
stack called LAMP. LAMP is a Web development platform that uses Linux as the operating
system, Apache as the Web server, MySQL as the relational database management system
and PHP as the object-oriented scripting language. (Sometimes Perl or Python is used instead of
PHP.)

MySQL, which was originally conceived by the Swedish company MySQL AB, was
acquired by Oracle in 2008.  Developers can still use MySQL under the GNU General Public
License (GPL), but enterprises must obtain a commercial license from Oracle.

Offshoots of MySQL are called forks. They include:

Drizzle – a lightweight open source database management system in development based on


MySQL 6.0.

MariaDB – a popular community-developed "drop-in" replacement for MySQL that uses


MySQL APIs and commands.

Percona Server with XtraDB– an enhanced version of MySQL known for horizontal


scalability.
A MySQL installation provides support for creating databases in it and allows applications to
communicate with these databases when correct credentials are given via a database connection.
A MySQL database consists of set of data tables. MySQL uses Structured Query Language for
its commands (MySQL has also got few non-SQL commands).

We can use SQL to create a database and then create tables in it according to the format we
want. Usually in a web application, database and respective data tables are created at installer
time. Then data is inserted, fetched, updated and deleted from data tables in the runtime of the
application.

Data Types

You can see five MySQL data types in the table definition above: int for integers,
varchar for short text, tinyint for short integers, date for dates, and text for long text. In
addition to these, MySQL provides some more data types. Choosing the correct data type for
each column is important foran optimal database.

Naming Conventions

There isn’t a standard naming convention for MySQL. Following are some common
conventions.

• All names are lower case (Ex: employee).

• Words are separated by underscore (Ex: first_name).

• Use singular form (Ex: employee, not employees).

Database Operations
MySQL allows all four CRUD (Create, Read, Update, Delete) operations. Often you
would see these operations as Insert, Select, Update, and Delete relevant to their SQL statements.

Storage Engines

MySQL has several Storage Engines that enable different features on data tables. For
example, if you want to automatically delete all the corresponding records in employee
department table when an employee is deleted from the employee table, then you have to use
InnoDB storage engine (for defining constraints).

SQL Modes

MySQL has the ability to run in different SQL modes, enabling different restrictions. For
example, at default configuration, you can enter 0000-00-00 for a date field. But if you are
running in Traditional mode, MySQL will throw an error when you try to insert 0000-00-00
into a date field, since it’s not a valid date. You can set the SQL mode per session (generally for
the span of starting and stopping the MySQL server) or set it permanently by configuring the
MySQL configuration file (my.ini in Windows and my.cnf in Mac OS/Linux).

User Types

MySQL allows the creation of users and to assigning different privileges for defined
users. User credentials are needed when an application needs to make a connection with MySQL
and execute operations on a database. Allowing for different privileges makes operations on a
database safe. For example, for the same database, you can have one user with all the privileges
and another with only viewing privileges.

Executing Commands
All SQL commands you type at the MySQL prompt should have a semicolon (;) at their
ends. The commands will not run till you enter a semicolon (It’s possible to use \G instead of
semicolon as explained below).

In addition to the SQL commands, MySQL has its own set of commands. To see these
commands, type help at the MySQL prompt as below. These commands aren’t required to have
a semicolon at the end. After typing a command, hit Enter key to execute the command.

mysql> help

Command-line Pretty Output

If you find the output of a certain SQL command difficult to read, try \G in place of the
semicolon

as shown in the following example. This will display the output in a vertical format and remove

surrounding dashed lines.

mysql> SHOW TABLE STATUS FROM company_db \G

SHOW TABLE STATUS command is covered in Database Commands chapter.

Managing MySQL Users

In MySQL, you can create user accounts²⁵ with different privileges. Privileges can vary from

accessing several databases to accessing only one column in a table.

Root User
By default, MySQL has a super user called root that has all the privileges. You need to be
logged in as root to execute many MySQL administrative tasks, including managing users.

Changing Root Password

If you didn’t specifically set the root password when installing MySQL, most of the times it
would

be empty. If the root password is empty, make sure to reset it with a proper password for better

security.

In command-line, you can use the following command to change root password. Type your
preferred password in place of newpassword. After hitting the Enter key, it will ask you to enter
the current password. If the current password is empty, just hit the Enter key.

mysqladmin -u root -p password 'newpassword'

Logging as a User

Use the following command to log in as root user. For logging in as a different user, type that

username in place of root. After hitting the Enter key, it will ask you to enter the password.
After entering the correct password, you would see the MySQL prompt (mysql>) where you can
enter

MySQL commands.

mysql -u root -p

MySQL Extension
This was the first method PHP provided to interact with MySQL. This extension provides a set
of built-in functions for connecting and making database queries. If a PHP built-in function starts
with term mysql, it’s a function of this extension.

For example, the following is the function usedfor connecting to MySQL.


mysql_connect('hostname', 'username', 'password'); MySQL extension only supports features of
MySQL versions prior to 4.1.3. You can’t use advanced features of MySQL like Prepared
Statements that was introduced after MySQL version 5 with this extension. But since many PHP
applications only need to execute CRUD operations, you will still see functions of this extension
in use. As of PHP version 5.3, there is no further development in this extension and it is only
maintained.

PHP Data Objects (PDO)

PDO is a built-in object-oriented database abstraction layer that is available from PHP
version 5. It abstracts specific database operations and provides a common interface for
interacting with all supported databases. That is, if you use PDO for database operations in your
PHP application, you can switch from MySQL to PostgreSQL³⁰ with minimal code changes.

mysqli_connect()

This function is used for connecting to MySQL. Before doing any database operation,
you need to connect to MySQL. On success, this function returns a link identifier that you can
use in other MySQLi functions. On failure, it will throw an error. Following is how a user named
robin with password robin123 needs to connect to a database called company_db at localhost.
User robin should have privileges to access company_db.

$link = mysqli_connect('localhost', 'robin', 'robin123', 'company_db');


If your MySQL port is different from the default one (3308), you need to give the port
number as the fifth parameter.

CASE TOOL FOR ANALYSIS


CASE Building Blocks:

CASE Tools

Integration Framework

Portability Services

Operating System

Hardware Platform

Environment Architecture

 To test the developed software

 To maintain the implemented software

 To trained the new people in software development

 To get clear idea about software engineering processes

The compilers, editors and debuggers those are available to support most
conventional programming languages. Web development tools include to the generation of
text, graphics, forms, scripts and other elements of a web page.
UML

Unified Modeling Language (UML) is a standardized visual specification language


for object modeling. UML is a general-purpose modeling language that includes a graphical
notation used to create an abstract model of a system, referred to as a UML model.

User

Concern Details

Job Details
Maintaining

Exam Details
Report

Commands
3. PROJECT DESCRIPTION

MODULE DESCRIPTION
Login
This module is used by all the users to log into the account. The user is required to enter
his/her user name and password. The user will be prompted to enter the needed page provided
username and password are correct otherwise he/she will be asked to reenter password and
security authentication persevered. Technically a validation certificate is sent to the browser
client verify whether it is a secured session. Then only the web page is loaded into the browser
on any app. This is to avoid the software forgery attacks. After verification the login page is
loaded for user authentication. The password and username is transferred to the server after
encryption. After successful login user will be redirected to the user’s home page.

Data Initial Processing


The query submitted by the user contains parts of speech and special characters which are not
required for analysis as they do not truly reflect the relevance of a search result. If this query is
used for analysis, it may give inconsistent and inaccurate results. Therefore, the user query will
be pre-processed to identify the root words.

Data Collection
Data is a wider term that is used to describe the massive growth and availability of data, both
structured and unstructured. Data may be as important to business, society and the Internet. Data
is an all-encompassing term for any collection of data sets so complex that it becomes difficult to
process using traditional data processing applications. Data usually includes data sets with sizes
beyond the ability of commonly used software tools to capture, curate, manage, and process data
within a tolerable elapsed time.

Clustering based Collaborative Filtering


Collaborative filtering (CF) is a technique. Collaborative filtering is a method of making
automatic predictions. All services are stored in a table which is called service table. The
corresponding elements will be drawn from service table during the process of CF.
Advanced Search
The search proceeds by generating and testing each node that is reachable from a parent node
before it expands any of these children. Exhaustive systematic search is referred to a breadth-first
search. The system retrieves the stored records into memory. And find that the fastest method is
loading all data (about 320 MB) at once with one SQL query, instead of fetching one by one.

Item or User Rating


The system upgrades the search results which include the emphasized term or sentence. The
system rating the search results according to the user intention and shows the rating results to the
user.

4. SYSTEM DESIGN

SYSTEM ARCHITECTURE
USECASE DIAGRAM
register

login

add post

friend list

user
admin
friend request

search keyword

recommended to friend

review

logout

CLASS DIAGRAM
registration
friends
username login post
view request
password view post list
username search friends
mailid review
password send request
gender recomment to friends
send recommendation
address
signup()
view friends() search post()
signup()

Add post
Admin view review
name
name view all review
domain
password recommended to friends
description
admin login() view review()
update post list()

SEQUENCE DIAGRAM

user login view friends add search keyword review & admin
post&domain recommendation

authorization
reg&login

add domain & post

request&add friends

search by domain and post


review for post
view review

logout
logout

COLLABORATION DIAGRAM
9: logout

2: reg&login 4: request&add friends


user login view
friends

5: search by domain and post


search
add keyword 6: review for post
post&domain
1: authorization
review &
8: logout
recommendation
7: view review
3: add domain & post

admin

INPUT DESIGN AND OUTPUT DESIGN

INPUT DESIGN

The input design is the link between the information system and the user. It comprises the
developing specification and procedures for data preparation and those steps are necessary to put
transaction data in to a usable form for processing can be achieved by inspecting the computer to
read data from a written or printed document or it can occur by having people keying the data
directly into the system. The design of input focuses on controlling the amount of input required,
controlling the errors, avoiding delay, avoiding extra steps and keeping the process simple. The
input is designed in such a way so that it provides security and ease of use with retaining the
privacy. Input Design considered the following things:’

 What data should be given as input?


 How the data should be arranged or coded?
 The dialog to guide the operating personnel in providing input.
 Methods for preparing input validations and steps to follow when error occur.

OBJECTIVES

1. Input Design is the process of converting a user-oriented description of the input into a
computer-based system. This design is important to avoid errors in the data input process and
show the correct direction to the management for getting correct information from the
computerized system.

2. It is achieved by creating user-friendly screens for the data entry to handle large volume of
data. The goal of designing input is to make data entry easier and to be free from errors. The data
entry screen is designed in such a way that all the data manipulates can be performed. It also
provides record viewing facilities.

3. When the data is entered it will check for its validity. Data can be entered with the help of
screens. Appropriate messages are provided as when needed so that the user will not be in maize
of instant. Thus the objective of input design is to create an input layout that is easy to follow.

OUTPUT DESIGN

A quality output is one, which meets the requirements of the end user and presents the
information clearly. In any system results of processing are communicated to the users and to
other system through outputs. In output design it is determined how the information is to be
displaced for immediate need and also the hard copy output. It is the most important and direct
source information to the user. Efficient and intelligent output design improves the system’s
relationship to help user decision-making.
1. Designing computer output should proceed in an organized, well thought out manner; the right
output must be developed while ensuring that each output element is designed so that people will
find the system can use easily and effectively. When analysis design computer output, they
should Identify the specific output that is needed to meet the requirements.

2. Select methods for presenting information.

3. Create document, report, or other formats that contain information produced by the system.

The output form of an information system should accomplish one or more of the following
objectives.

 Convey information about past activities, current status or projections of the


 Future.
 Signal important events, opportunities, problems, or warnings.
 Trigger an action.
 Confirm an action.

SYSTEM STUDY

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

 Economical feasibility
 Technical feasibility

 Social feasibility
ECONOMICAL FEASIBILITY:

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

TECHNICAL FEASIBILITY:

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

SOCIAL FEASIBILITY:

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

SYSTEM TESTING

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

TYPES OF TESTS:
Testing is the process of trying to discover every conceivable fault or weakness in a work
product. The different type of testing is given below:

UNIT TESTING:

Unit testing involves the design of test cases that validate that the internal program logic is
functioning properly, and that program inputs produce valid outputs. All decision branches and
internal code flow should be validated. It is the testing of individual software units of the
application .it is done after the completion of an individual unit before integration.

This is a structural testing, that relies on knowledge of its construction and is invasive.
Unit tests perform basic tests at component level and test a specific business process, application,
and/or system configuration. Unit tests ensure that each unique path of a business process
performs accurately to the documented specifications and contains clearly defined inputs and
expected results.

INTEGRATION TESTING:

Integration tests are designed to test integrated software components to determine if


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

FUNCTIONAL TEST:
Functional tests provide systematic demonstrations that functions tested are available as
specified by the business and technical requirements, system documentation, and user manuals.
Functional testing is centered on the following items:
Valid Input : identified classes of valid input must be accepted.
Invalid Input : identified classes of invalid input must be rejected.
Functions : identified functions must be exercised.
Output : identified classes of application outputs must be exercised.
Systems/ Procedures: interfacing systems or procedures must be invoked.

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


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

SYSTEM TEST:
System testing ensures that the entire integrated software system meets requirements. It tests a
configuration to ensure known and predictable results. An example of system testing is the
configuration oriented system integration test. System testing is based on process descriptions
and flows, emphasizing pre-driven process links and integration points.
WHITE BOX TESTING:
White Box Testing is a testing in which in which the software tester has knowledge of the
inner workings, structure and language of the software, or at least its purpose. It is purpose. It is
used to test areas that cannot be reached from a black box level.
BLACK BOX TESTING:
Black Box Testing is testing the software without any knowledge of the inner workings,
structure or language of the module being tested. Black box tests, as most other kinds of tests,
must be written from a definitive source document, such as specification or requirements
document, such as specification or requirements document. It is a testing in which the software
under test is treated, as a black box .you cannot “see” into it. The test provides inputs and
responds to outputs without considering how the software works.
UNIT TESTING:
Unit testing is usually conducted as part of a combined code and unit test phase of the
software lifecycle, although it is not uncommon for coding and unit testing to be conducted as
two distinct phases.
Test strategy and approach
Field testing will be performed manually and functional tests will be written in detail.
Test objectives
 All field entries must work properly.
 Pages must be activated from the identified link.
 The entry screen, messages and responses must not be delayed.
Features to be tested
 Verify that the entries are of the correct format
 No duplicate entries should be allowed
 All links should take the user to the correct page.
INTEGRATION TESTING:
Software integration testing is the incremental integration testing of two or more
integrated software components on a single platform to produce failures caused by interface
defects. The task of the integration test is to check that components or software applications, e.g.
components in a software system or – one step up – software applications at the company level –
interact without error.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
ACCEPTANCE TESTING:
User Acceptance Testing is a critical phase of any project and requires significant
participation by the end user. It also ensures that the system meets the functional requirements.
Test Results: All the test cases mentioned above passed successfully. No defects encountered.

5. SYSTEM IMPLEMENTATION

5.1 SAMPLE SCREENS


5.2 SAMPLE SOURCE CODE

<?php

$user = $this->session->userdata('user');

extract($user);

?>

<!DOCTYPE html>

<html>

<head>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

<script>

$(document).ready(function(){

$("#myInput").on("keyup", function() {

var value = $(this).val().toLowerCase();

$("#myTable tr").filter(function() {

$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)

});

});

});

</script>
<script>

$(document).ready(function(){

$("#myInput1").on("keyup", function() {

var value = $(this).val().toLowerCase();

$("#myTable1 tr").filter(function() {

$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)

});

});

});

</script>

<style>

body {

font-family: Arial, Helvetica, sans-serif;

background-color:gray;

*{

box-sizing: border-box;

/* Add padding to containers */


.container {

padding: 16px;

background-color: white;

/* Full-width input fields */

input[type=text], input[type=password],textarea,input[type=date] {

width: 100%;

padding: 15px;

margin: 5px 0 22px 0;

display: inline-block;

border: none;

background: #f1f1f1;

input[type=text]:focus, input[type=password]:focus {

background-color: #ddd;

outline: none;

/* Overwrite default styles of hr */


hr {

border: 1px solid #f1f1f1;

margin-bottom: 25px;

/* Set a style for the submit button */

.registerbtn {

background-color: #4CAF50;

color: white;

padding: 16px 20px;

margin: 8px 0;

border: none;

cursor: pointer;

width: 100%;

opacity: 0.9;

.registerbtn:hover {

opacity: 1;

}
/* Add a blue text color to links */

a{

color: dodgerblue;

/* Set a grey background color and center the text of the "sign in" section */

.signin {

background-color: #f1f1f1;

text-align: center;

</style>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>

<meta charset="utf-8">

<title>CodeIgniter Login</title>

<link rel="stylesheet" type="text/css" href="<?php echo base_url();


?>bootstrap/css/bootstrap.min.css">

</head>

<body>
<div class="container">

<h1 class="page-header text-center text-uppercase text-danger">DESIGN A SYSTEM


IN CLUSTERING BASED IFILTERING USING A BOOST UP/PENALIZED USER MODEL

</h1>

<nav class="navbar navbar-inverse">

<div class="container-fluid">

<div class="navbar-header">

<a class="navbar-brand" href="#">welcome:<?php $un=$email; echo $un; ?></a>

</div>

<ul class="nav navbar-nav">

</ul>

<ul class="nav navbar-nav navbar-right">

<li><a href="<?php echo base_url(); ?>index.php/user/logout"><span class="glyphicon


glyphicon-log-in"></span> Logout</a></li>

</ul>

</div>

</nav>

<div CLASS="container">

<h1 id="1">VIEW PEOPLES</h1>

<B><table border="0" class="table table-hover table-responsive text-uppercase">

<input id="myInput" type="text" placeholder="Search..">


<TR class="bg-info">

<th>ID</th>

<th>NAME</th>

<th>phone</th>

<th>email</th>

<th>send request</th>

</TR>

<?php

if($view)

foreach($view->result() as $row)

echo" <tbody id='myTable'>";

echo "<tr>";

echo "<td>".$row -> id."</td>";

echo "<td>".$row -> name."</td>";

echo "<td>".$row -> phone."</td>";

echo "<td>".$row -> email."</td>";

?>
<td>

<form method="post" action="sendfrend">

<input type="hidden" value="<?php echo $row -> email?>" name="to_email">

<?php //echo anchor("user/request/{$row->id}", 'send request','class="btn bg-info"');?>

<input type='submit' value="send request" class="btn btn-primary">

</form>

</td>

<?php

echo "</tr>";

echo" <tbody>";

else

echo "no";

?>
</table></B></div>

<div CLASS="container" id="2">

<h1 id="1">FRIEND REQUEST</h1>

<table border="0" class="table table-hover table-responsive text-uppercase">

<TR class="bg-info">

<th>ID</th>

<th>email</th>

<th>phone</th>

<th>name</th>

<th>add friend</th>

</TR>

<?php

if($view1)

foreach($view1->result() as $row)

echo "<tr>";

echo "<td>".$row -> id."</td>";


echo "<td>".$row -> from_email."</td>";

echo "<td>".$row -> phone."</td>";

echo "<td>".$row -> name."</td>";

echo "<td>";

if($row -> status==0)

?>

<?php echo anchor("user/request/{$row->id}", 'acc','class="btn bg-info"');?></td><?php

else

?>

<?php echo anchor("user/request1/{$row->id}", 'unfriend request','class="btn


bg-info"');?></td><?php

"</td>";

?>

<?php

echo "</tr>";
}

else

echo "no";

?>

</table>

</div>

<div CLASS="container" id="2">

<h1 id="1">ALL FRIENDS</h1>

<table border="0" class="table table-hover table-responsive">

<TR class="bg-info">

<th>ID</th>

<th>email</th>

<th>status</th>

<th></th>

</TR>

<?php

echo $un;
$id=0;

if($view3)

foreach($view3->result() as $row)

$id++;

echo "<tr>";

echo "<td>".$id."</td>";

$from=$row ->from_email;

$to=$row ->to_email;

echo $from;

if(strcmp($un,$from)){

echo "<td>".$from."</td>";

else{

echo "<td>".$to."</td>";

echo "<td>";

if($row -> status==0)


{

echo "not friend";

else

echo "friend" ;

}"</td>";

?>

<?php

echo "</tr>";

else

echo "no";

?>

</table>
</div>

<div CLASS="container" id="2">

<h1 id="1">PRODUCTS</h1>

<input id="myInput1" type="text" placeholder="Search..">

<table border="0" class="table table-hover table-responsive text-uppercase">

<TR class="bg-info">

<th>ID</th>

<th>name</th>

<th>description</th>

<th>category</th>

<th>rating(in per)</th>

<th>image</th>

<th>recommend to friend</th>

</TR>

<?php

if($view4)

{
foreach($view4->result() as $row)

echo" <tbody id='myTable1'>";

echo "<tr>";

echo "<td>".$row ->id."</td>";

echo "<td>".$row -> name."</td>";

echo "<td>".$row -> discription."</td>";

echo "<td>".$row -> price."</td>";

$rate=$row -> rate;

$per=($rate*5)/100;

echo "<td>".$per."%</td>";

$img=$row -> image;

echo "<td><img src='http://localhost:81/filtering/uploads/$img' width='100px'


height='100px'></td>";

?>

<td>

<form method="post" action="addrec">

<input type="hidden" name="proid" value="<?php echo $row ->id?>">


<select name="friend">

<?php

if($view3)

foreach($view3->result() as $row)

$from=$row ->from_email;

$to=$row ->to_email;

if($un==$from){

?>

<option value="<?php echo $to;?>"><?php echo $to;?></option>

<?php }

else{?>

<option value="<?php echo $from;?>"><?php echo $from;?></option>

<?php

}}}?> </select>

<input type="submit" name="">

</form>
</td>

<?php

echo "</tr>";

echo" </tbody>";

}?>

</table>

</div>

<div class="container">

<h1 id="1">RECOMMENDATION LIST</h1>

<table class="table">

<?php

$id=0;

if($view5)

foreach($view5->result() as $row)

echo"<tr>";

echo "<td>".$row -> name."</td>";


echo "<td>".$row -> discription."</td>";

echo "<td>".$row -> price."</td>";

echo "<td>".$row -> send."</td>";

$img=$row -> image;

echo "<td><img src='http://localhost/filtering2/uploads/$img' width='100px'


height='100px'></td>";

echo"</tr>";

?>

<?php

else

echo "no";

?>

</table>

</div>
<div class="container">

<h1 id="1">RATING</h1>

<form method="post" action="rate">

<select name="pro" class="form-control">

<?php

if($view4)

foreach($view4->result() as $row)

?>

<option><?php echo $row ->name;?>

</option>

<?php

?>

</select><br>

<input type="number" class="form-control" name="rate" min="1" max="5"><br>


<input type="submit" class="form-control btn btn-info">

</form>

</div>

</body>

</html>

<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class User extends CI_Controller {

function __construct(){

parent::__construct();

$this->load->helper('url');

$this->load->model('users_model');

public function index(){

//load session library

$this->load->library('session');
//restrict users to go back to login if session has been set

if($this->session->userdata('user')){

redirect('home');

else{

$this->load->view('login_page');

public function reg()

if(isset($_POST['reg']))

$data['name']=$this->input->post('name');

$data['phone']=$this->input->post('phone');

$data['email']=$this->input->post('email');

$data['pass']=$this->input->post('pass');

$data['conpass']=$this->input->post('conpass');

$tablename="reg";

if($data['pass']==$data['conpass'])

{
$this->load->model('users_model');

$status=$this->users_model->insert($data,$tablename);

if($status){

echo "ok";

redirect('/');

else{

header('location:'.base_url().$this->index());

$this->session->set_flashdata('error','not registered');

else{

header('location:'.base_url().$this->index());

$this->session->set_flashdata('notmatch','password and confirm password


not match');

public function product_upload()


{

$name=$this->input->post('name');

$discription=$this->input->post('discription');

$price=$this->input->post('price');

$rate=1;

$tablename="product";

$config= array(

'upload_path'=>'uploads/',

'allowed_types'=>'*',

'max_size'=>0,

'filename'=>url_title($this->input->post('images')),

'encrypt_name'=>true

);

$this->load->model('users_model');

$status=$this->users_model->insertfileup($name,$discription,$price,$config,
$rate,$tablename);

if($status){

redirect('user/admin');

}
else{

echo"some problem";

public function addrec()

$this->load->library('session');

$user = $this->session->userdata('user');

extract($user);

$data['proid']=$this->input->post('proid');

$data['send']=$email;

$data['to']=$this->input->post('friend');

$tablename="prorec";

$this->load->model('users_model');

$status=$this->users_model->insert($data,$tablename);

if($status){

redirect('user/home');

else{

echo"some problem";
}

public function sendfrend()

{{

$this->load->library('session');

$user = $this->session->userdata('user');

extract($user);

$data['to_email']=$this->input->post('to_email');

$data['from_email']=$email;

$tablename="frendrequest";

$this->load->model('users_model');

$status=$this->users_model->insert($data,$tablename);

if($status){

redirect('user/home');

}
else{

echo"some problem";

public function rate()

$pro=$this->input->post('pro');

$rate=$this->input->post('rate');

$tablename="product";

$this->load->model('users_model');

$status=$this->users_model->rate($pro,$rate,$tablename);

redirect('user/home');

public function login(){

//load session library

$this->load->library('session');
$email = $_POST['email'];

$password = $_POST['password'];

$dbname="reg";

$data = $this->users_model->login($email,$password,$dbname);

if($data){

$this->session->set_userdata('user', $data);

redirect('user/home');

//echo "ok";

else{

header('location:'.base_url().$this->index());

$this->session->set_flashdata('loginerror','Invalid login. User not found');

//echo "no";

public function adminlogin()

$this->load->library('session');
if(isset($_POST['admin']))

$email = $_POST['email'];

$password = $_POST['password'];

$dbname="admin";

$data = $this->users_model->login($email, $password,$dbname);

if($data){

$this->session->set_userdata('user1', $data);

redirect('user/admin');

//$this->load->view('admin');

else{

//redirect('user/admin');

header('location:'.base_url().'index.php/user/admin');

$this->session->set_flashdata('erroradmin','Invalid login. User not found');

//echo "no";

}
//else{

//$this->load->view('adminlogin');

//}

public function home(){

//load session library

$this->load->library('session');

//restrict users to go to home if not logged in

if($this->session->userdata('user')){

$this->load->model('users_model');

$data['view']=$this->users_model->reqsend('reg');

$data['view1']=$this->users_model->sendreq('reg','frendrequest');

$data['view3']=$this->users_model->yourfriend('reg','frendrequest');

$data['view4']=$this->users_model->viewp('product');

$data['view5']=$this->users_model->prorec('prorec','product');

$this->load->view('home',$data);

}
else{

redirect('/');

public function admin(){

//load session library

$this->load->library('session');

//restrict users to go to home if not logged in

if($this->session->userdata('user1')){

$this->load->model('users_model');

$data['view']=$this->users_model->view('reg');

$data['view2']=$this->users_model->viewf('frendrequest');

$data['view4']=$this->users_model->viewp('product');

$this->load->view('admin',$data);

else{
$this->load->view('adminlogin');

//redirect('user/admin1');

public function logoutadmin(){

//load session library

$this->load->library('session');

$this->session->unset_userdata('user1');

$this->load->view('login_page');

//redirect('user/admin');

public function logout(){

//load session library

$this->load->library('session');

$this->session->unset_userdata('user');

redirect('/');

public function add()


{

if(isset($_POST['add']))

$data['name']=$this->input->post('name');

$data['fees']=$this->input->post('fees');

$data['Duration']=$this->input->post('Duration');

$this->load->model('users_model');

//$tablename="course";

$status=$this->users_model->insert($data);

if($status){

redirect('user/admin');

else{

echo"no";

}
function del1($row_id)

$this->load->model('users_model');

$status=$this->users_model->delrow($row_id,reg);

if($status==true)

//echo "ok";

redirect('user/admin#');

else

echo "no";

}
function request($row_id)

$this->load->library('session');

$this->load->model('users_model');

$user1 = $this->session->userdata('user');

extract($user1);

$status=$this->users_model->fiend($row_id,'frendrequest');

if($status==true)

//echo "ok";

redirect('user/home');

else

echo "no";

function request1($row_id)

$this->load->library('session');
$this->load->model('users_model');

$user1 = $this->session->userdata('user');

extract($user1);

$status=$this->users_model->unfriend($row_id,frendrequest);

if($status==true)

//echo "ok";

redirect('user/home');

else

echo "no";

function accept($row_id)

$this->load->library('session');

$this->load->model('users_model');

$user1 = $this->session->userdata('user');

extract($user1);
$status=$this->users_model->accept($row_id,'request');

if($status==true)

//echo "ok";

redirect('user/home');

else

echo "no";

6. CONCLUSION
Proposed a CBCF method using the IPU model in recommender systems by carefully exploiting
different preferences among users along with clustering. Specifically, in the proposed CBCF
method, formulated a constrained optimization problem in terms of maximizing the recall (or
equivalently F1 score) for a given precision. To this end, clustering was applied so that not only
users are divided into several clusters based on the actual rating data and Pearson correlation
coefficient but also an incentive/penalty is given to each item according to the preference
tendency by users within a same cluster. As a main result, it was demonstrated that the proposed
CBCF method using the IPU model brings a remarkable gain in terms of recall or F1 score for a
given precision. A possible direction of future research in this area includes the design of a new
clustering-based CF method by exploiting the properties of model-based CF approaches (e.g.,
matrix factorization).
REFERENCES
[1] G. Adomavicius and A. Tuzhilin, “Toward the next generation of recommender systems: A
survey of the state-of-the-art and possible extensions,” IEEE Trans. Knowl. Data Eng., vol. 17,
no. 6, pp. 734–749, Jun. 2005.
[2] G. Linden, B. Smith, and J. York, “Amazon. com recommendations: Item-to-item
collaborative filtering,” IEEE Internet Comput., no. 1, pp. 76–80, Jan. 2003.
[3] Y. Koren, R. Bell, and C. Volinsky, “Matrix factorization techniques for recommender
systems,” Computer, no. 8, pp. 30–37, Aug. 2009.
[4] J. A. Konstan and J. Riedl, “Recommender systems: from algorithms to user experience,”
User Modeling and User-Adapted Interact., vol. 22, no. 1, pp. 101–123, Mar. 2012
[5] X. Su and T. M. Khoshgoftaar, “A survey of collaborative filtering techniques,” Adv. AI, no.
4, p. 2, Jan. 2009.
[6] Y. Zhou, D. Wilkinson, R. Schreiber, and R. Pan, “Large-scale parallel collaborative filtering
for the netflix prize,” in Proc. 4th Int. Conf. Algo. Asp. Inf. Manag. (AAIM ’08), Shanghai,
China, Jun. 2008, pp. 337–348.
[7] Y. Hu, Y. Koren, and C. Volinsky, “Collaborative filtering for implicit feedback datasets,” in
Proc. 8th IEEE Int. Conf. Data Mining (ICDM ’08), Pisa, Italy, Dec. 2008, pp. 263–272.
[8] Y. Cai, H.-F. Leung, Q. Li, H. Min, J. Tang, and J. Li, “Typicality-based collaborative
filtering recommendation,” IEEE Trans. Knowl. Data Eng., vol. 26, no. 3, pp. 766–779, Jan.
2014.
[9] G. Guo, J. Zhang, and D. Thalmann, “Merging trust in collaborative filtering to alleviate data
sparsity and cold start,” Knowledge-Based Syst., vol. 57, pp. 57–68, Feb. 2014.
[10] J. Bobadilla, F. Ortega, A. Hernando, and J. Bernal, “A collaborative filtering approach to
mitigate the new user cold start problem,” Knowledge-Based Syst., vol. 26, pp. 225–238, Feb.
2012.
[11] H. Sobhanam and A. K. Mariappan, “A hybrid approach to solve cold start problem in
recommender systems using association rules and clustering technique,” Int. J. Comput. Appl.,
vol. 74, no. 4, pp. 17–23, Jul. 2013.
[12] H. Liu, Z. Hu, A. Mian, H. Tian, and X. Zhu, “A new user similarity model to improve the
accuracy of collaborative filtering,” Knowledge-Based Syst., vol. 56, pp. 156–166, 2014.
[13] B.-H. Huang and B.-R. Dai, “A weighted distance similarity model to improve the accuracy
of collaborative recommender system,” in Proc. 16th IEEE Int. Conf. Mobile Data Manag.
(MDM), Pittsburgh, PA, 2015, pp. 104–109.
[14] Q. Lu, T. Chen, W. Zhang, D. Yang, and Y. Yu, “Serendipitous personalized ranking for
top-N recommendation,” in Proc. IEEE/WIC/ACM Int. Conf. Web Intell. and Intell. Agent
Technol. (WI-IAT ’12), Washington, DC, Dec. 2012, pp. 258–265.
[15] K. Oku and F. Hattori, “Fusion-based recommender system for improving serendipity,” in
Proc. ACM Workshop on Novelty Diversity Rec. Sys. (DiveRS), Chicago, IL, Oct. 2011, pp.
19–26.
[16] P. Adamopoulos and A. Tuzhilin, “On unexpectedness in recommender systems: Or how to
expect the unexpected,” in Proc. ACM Workshop on Novelty Diversity Rec. Sys. (DiveRS),
Chicago, IL, Oct. 2011, pp. 11–18.

You might also like