Fake
Fake
In the present generation, the social life of everyone has become associated with the online
social networks. Adding new friends and keeping in contact with them and their updates
has become easier. The online social networks have impact on the science, education,
grassroots organizing, employment, business, etc. Researchers have been studying these
online social networks to see the impact they make on the people. Teachers can reach the
students easily through this making a friendly environment for the students to study,
teachers nowadays are getting themselves familiar to these sites bringing online classroom
pages, giving homework, making discussions, etc. which improves education a lot. The
employers can use these social networking sites to employ the people who are talented and
interested in the work, their background check can be done easily. Social Networks are
gaining more momentum in businesses around the world and has become one of the most
used and popular platforms of digital marketing and to check the latest trends among the
public and to better understand what people wants. Fake Social Profiles are increasing
rapidly that spreads fake news and information over this growing channel
CHAPTER 1
INTRODUCTION
Introduction
A social networking site is a website where each user has a profile and can keep in
contact with friends, share their updates, meet new people who have the same interests.
These Online Social Networks (OSN) uses web2.0 technology, which allows users to
These social networking sites are growing rapidly and changing the way people keep in
contact with each other. The online communities bring people with same interests together
History
These social networking sites starting with http://www.sixdegrees.com in 1997, then came
very soon but new sites like myspace, LinkedIn, Bebo became successful and facebook
was launched in 2004 and presently it is the largest social networking site in the world
Social Impact
In the present generation, the social life of everyone has become associated with the online
11
social networks. These sites have made a drastic change in the way we pursue our social
life. Adding new friends and keeping in contact with them and their up- dates has become
easier.
The online social networks have impact on the science, education, grassroots organiz- ing,
employment, business, etc. Researchers have been studying these online social networks to
see the impact they make on the people. Teachers can reach the stu- dents easily through
this making a friendly environment for the students to study, teachers now-a-days teachers
are getting themselves familiar to these sites bringing online classroom pages, giving
homework, making discussions, etc. which improves education a lot. The employers can
use these social networking sites to employ the people who are talented and interested in
the work, their background check can be done easily using this. Most of the OSN are free
but some charge the membership fee and uses this for business purposes and the rest of
them raise money by using the advertising. This can be used by the government to get the
The examples of these social networking sites are sixdegrees.com, The Sphere, Nex- opia
which is used in Canada, Bebo, Hi5, Facebook, MySpace, Twitter, LinkedIn, Google+,
Orkut, Tuenti used in Spain, Nasza-Klasa in Poland, Cyworld mostly used in Asia, etc. are
There are many social networking sites are available through which we build a network
among various people around us this is known as social network. Thousands of social sites
are available Nowadays for ex. Facebook, Twitter, Instagram, Whatsapp and many more.
12
Social network is becoming a business even many persons run their work with the help of
this network. We can attach intentionally or unintentionally with many people on the
social network. Social networks having many advantages and disadvantages also. Due to
our daily requirement whether it could be official or unofficially we are dependent on the
social networking sites. Facebook is one of the most popular social networking sites and
most commonly used and Facebook was perhaps the first that surpassed the landmark of 1
billion user accounts. Apart from the ability to network with friends and relatives you also
relate with many unknown users and different applications are available to promote your
business brand and products by using Facebook ads. But recently there is a major issue
which arise trust issue about millions of users which are accessing Facebook whether they
are trusted or not. We discuss about trust issue in this paper. Here the motive is to just
predict that whether the person created account is trusted or not many of the surveys had
been done on this and on the recently research according to that trust issues are still alive.
Because of huge amount of data is available on the Facebook. So, it is not easy to predict
whether the Facebook account is fake or not. We tried to predict fake accounts on
Facebook using machine learning. According to Facebook privacy and security policies. It
ensures to people that the profile which is created is not fake while creating accounts on
Facebook. Facebook rights and responsibilitiesusers should provide their real and rigid
information. Once they created their profiles. Even due to this policies also, there are many
fake accounts also created. We discuss briefly on this topic about fake Facebook profiles in
this paper, we focused on the problem of how predicting fake accounts and presenting a
smart predicting system to handle this problem based on prediction and classification
13
technique of data mining. Our work is motivated by works presented. In where researchers
presenting a smart detection system (FB Checker) to predict our motive is to better analyze
data and to improve predictions on fake profiles and to develop better technique which
Statistics
These online social networks are growing rapidly and there are more than 160 major social
network websites exist in the world. 300 million active accounts in Facebook, 50
Issues
The social networking sites are making our social lives better but nevertheless there are a
lot of issues with using these social networking sites. The issues are privacy, online
bullying, potential for misuse, trolling, etc. These are done mostly by using fake profiles.
In todays online social networks there have been a lot of problems like fake profiles,
online impersonation, etc. Till date, no one has come up with a feasible solution to these
problems.
In this project we intend to give a framework with which the automatic detection of fake
profiles can be done so that the social life of people become secured and by using this
automatic detection technique we can make it easier for the sites to manage the huge
14
Nowadays, Online Social Media is dominating the world in several ways. Day by day the
number of users using social media is increasing drastically. The main advantage of online
social media is that we can connect to people easily and communicate with them in a better
way. This provided a new way of a potential attack, such as fake identity, false
information, etc.A recent survey suggest that the number of accounts present in the social
media is much greater than the users using it.This suggest that fake accounts have been
increased in the recent years. Online social media providers face difficulty in identifying
these fake accounts. The need for identifying these fake accounts is that social media is
In today's world, Online Social Media is king in a number of forms the number of people
who use the service is growing every day. The use of social media is skyrocketing. The
primary benefit is that we can easily communicate with people via online social media and
communicate with them in a more effective manner. This opened up a new avenue of a
possible attack, such as a forged identity, false information and so on. According to a
recent study, the number of accounts in the number of people who use social media is
much higher than the number of people who use it. These fake accounts are difficult to
detect for online social media providers. Since social media is flooded with false
information, ads, and other types of content, it is essential to recognise these fake accounts.
From an online social media dataset, we offer a method for detecting fraudulent accounts.
We employed boosting methods to improve the accuracy of the standard technique, rather
15
16
CHAPTER 2
LITERATURE REVIEW
Fake profiles are the profiles which are not genuine i.e. they are profiles of persons who
claim to be someone they are not, doing some malicious and undesirable activity, causing
2.1Social Engineering
Social Engineering in terms of security means the art of stealing confidential infor- mation
from people or gaining access to some computer system mostly not by using technical
skills but by manipulating people themselves in divulging information. The hacker doesnt
The social engineering techniques are like Pretexting, Diversion theft, phishing, bait- ing,
Eg: Creating a profile of some person X not in some online social networking site like
facebook. Adding the friends of the X in facebook and making them believe that its the
profile of X. They can get the private information meant for only X by commu- nicating
with Xs friends in facebook. yahoo news which shows the best example of social
engineering done using an online social network facebook, in which some spies created a
17
fake facebook account in the name of James Stavridis, the chief of NATO. They sent
requests to many other officials in NATO and some officials in other important
The other reason why people create fake profiles is to defame the persons they do not like.
People create profiles in the name of the people they dont like and post abusive posts and
pictures on their profiles misleading everyone to think that the person is bad and thus
Fig 2.2 shows the screenshot from a website which shows that a man named Mohammad
Osman Ali has created a fake profile of a woman in Facebook and tried to defame her. The
police finally caught and arrested him. This shows a very serious problem existing now-a-
days
Imagine a scenario where a movie is released and one of your friends in facebook posted
that the movie was awesome. This makes a first impression on you that the movie is good
and you would want to watch it. This is how advertising and campaigning works through
OSN.
The review posted by a genuine user is always desirable but these reviews when posted by
Assume that Fig 2.3 shows a social graph where the blue nodes shown are real profiles, the
18
red circled profiles show fake profiles and the edges show the connections between them.
If the fake profiles start advertising a brand or campaigning for some politician then the
users connected to the fake profiles are misled in believing them. Inturn the profiles who
didnt add the fake profiles are effected using the mutual connections.
screenshot, which shows the post in Newyork Times showing the most successful internet
campaigning done by Obama which collected around 500 million dollars of election fund
for him. Obama might not have used fake profiles in his internet campaigning but this
shows the power of internet campaigning. Imagine a case where a non deserving candidate
Social bots are semi-automatic or automatic computer programs that replicate the human
behavior in OSN. These are used mostly by hackers now-a-days to attack online social
networks. These are mostly used for advertising, campaigning purposes and to steal users
These social bots communicate with each other and are controlled by a program called
botmaster. The botmaster may or may not have inputs from a human attacker. The social
bots look like human profiles with a randomly chosen human name, randomly chosen
human profile picture and the profile information posted randomly from a list prepared
from before by the attacker. These social bots send requests to random users from a list.
19
When someone accepts the request, they send requests to the friends of the user who
accepted the request, which increases the acceptance rate due to existence of mutual
friends.
Recently a researcher from university of british Columbia made a social botnet of 103 bots
in facebook and added 3000 friends in just 8 weeks. He was able to extract around 250 GB
of personal data of users. This shows the extent of the applications of social bots by the
attackers.
When we consider facebook, it has its own security system to protect its users from
spamming, phishing, etc. and this is called facebook immune system. FIS does real
time checks on every single click and every read and write operation done by it. This is
around 25 Billion checks per day and as high as 620,000 checks per minute at peak as of
may, 2011.
20
the adversarial cycle in which the top part is controlled by the attacker and the bottom part
shows the response by the FIS to control the attack, which when detected by the attacker,
he/she mutates the attack and attacks it again. This goes on like a cycle and is never
ending. FIS is able to detect the spam, malware and phishing produced by the
compromised ad fake accounts. They are actually able to reduce the spam to less than 0.4
FIS is not successful in detecting the social bots and the fake accounts created by humans.
This can be seen by the example mentioned above where a researcher created
103 social bots to collect a lot of personal data of users and facebook couldnt detect this
attack.
The gradient boosting algorithm is similar to the random forest algorithm in that it relies
heavily on decision trees. We have modified the way we find fake accounts, using new
approaches to locate them. Spam commenting, interaction rate, and artificial behaviour are
some of the techniques used. The gradient boosting algorithm uses these inputs to build
decision trees, which are then used in the gradient boosting algorithm. Even if some inputs
are missing, this algorithm produces a result. This is the primary reason for using this
algorithm. We were able to obtain extremely accurate results by using this algorithm.
XGBoost and GBM performed brilliantly when compared with the previous work. It
outperforms the accuracy of fake account identification by a large margin even with the
default values of the hyperparameters provided in. Finally, we achieved a better result than
earlier attempts.
The main objective of this paper is to detect fake accounts. Gradient boosting algorithm is
21
used in this project to detect fake accounts accurately. Identifying these fake accounts is
As proposed earlier, this detection method uses gradient boost and extreme gradient
boosting algorithms to detect fake accounts. The technologies we have used are Python
and Python’s Standard libraries like Numpy, Pandas, Matplotlib, Scipy and Sklearn. A.
Python Python is our major programming language. It is used for our dataset to detect fake
accpounts. It provides various tools and libraries that help in detecting fake accounts upto
from multiple decision trees. Keep in mind that in a gradient boosting machine, all of the
poor learners are decision trees.But how is using a hundred decision trees better than using
a single decision tree if we're using the same algorithm? What are the different ways that
different decision trees capture different signals/information from data? The trick is that
each node in the decision tree uses a different subset of features to choose the best split.
This means that the individual trees aren't all the same, and they can absorb different
Boosting). In reality, XGBoost is just a tweaked GBM algorithm! XGBoost follows the
same steps as GBM in terms of operation. XGBoost builds trees in a sequential fashion,
attempting to fix previous trees errors. However, there are a few features that render
XGBM and GBM is that XGBM uses parallel pre-processing (at the node level), making it
22
faster. Regularization strategies in XGBoost help to reduce overfitting and improve overall
efficiency. Setting the XGBoost algorithm's hyperparameters allows you to choose the
regularisation technique.
There is a tremendous increase in technologies these days.. Mobiles are becoming smart.
Technology is associated with online social networks which has become a part in every
one’s life in making new friends and keeping friends , their interests are known easier. But
this increase in networking online make many problems like faking their profiles, online
impersonation having become more and more in present days. Users are fed with more
unnecessary knowledge during surfing which are posted by fake users. Researches have
observed that 20% to 40% profiles in online social networks like facebook are fake
profiles. Thus this detection of fake profiles in online social networks results into solution
using frameworks. Online social media is the place each person has a outlook then be able
to keep connecting their relations, transfer their updates, join with the people having same
likes. Online Social Networks makes use of front end technologies, which permits
permanency accounts in accordance with to know each other. Facebook, Twitter are
developing along with humans to maintain consultation together with all others. The
online accounts welcome people including identical hobbies collectively who makes users
easier after perform current friends. Gaming and entertaining web sites which have extra
followers unintentionally that means more fan base and supreme ratings. Ratings drives
compete more with their neighbours. By these analogies , the maximum famous candidate
23
in an election commonly get more number of votes. Happening of fake social media
accounts and interests may be known. Instance is fake online account being sold on-line at
a online market places for minimum price , brought from collaborative working offerings.
More often feasible to have Twitter fans and Facebook media likes in online. Fake user
accounts may be created by humans or computers like bots , cyborgs. Cyborg is half bot
and half human account. These accounts are usually opened by human, but their actions
are made by bots. The another reason for people to create fake profiles for defaming
accounts they dislike. This type of users create accounts with the username of the people
they hate and post irrelevant stories and snap shots on their accounts to redirect everybody
so that they assume that particular person is awful and make their reputation low. Most
attackers are in it to make money. They make money by distributing unwanted ads (spam)
or capturing accounts they can reuse or resale (phishing). Spammers gather resources to
know fake and real users, email ids ,ip locations and computing knowledge power. Every
one of these advantages can have a huge expense related with them, and an assault, similar
to any business adventure, needs benefit to continue onward. Attackers more often use
facebook logins, applications, Events, Group users to gather login credentials, spam users,
and ultimately gain profits. They need email records, treats, and a wide scope of IP
delivers to go around notoriety based protections. Moreover, they use telephone numbers,
taken charge cards, and CAPTCHA arrangements trying to go around validation checks.
Facebook security privileges its system to gather users to prevent spams and fishing
accounts. Facebook Immune System does continuous minds all gather and each its activity
made by it. Social bot is a known that stops and controls social online accounts. Bots
24
socially is an auto generated software. Precised way a social account duplicates relies upon
at the social media, also in contrast to general bot, a social bot interacting more in different
customers that the social bot is a actual man or woman. More auto generated programs or
semi generated computer programs that duplicate the human behaviour in Social media. So
to use them hackers attack online social networks. Thus primarily used for campaign,
advertise and also thieve user non-public in more large scales. The bot online master
gather inputs because of attackers. Cyborg bots appear like accounts of human from
random calls of human, often selected human users image and user records published more
often from collective accounts to be prepare from before online account attackers. Cyborg
bots ship gather random users. If a person acknowledge the request from user, ship to get
request of the account who agree request, will increase popularity price because of
2.7 A dataset for the detection of fake profiles on social networking services.:
—The use of multiple social media platforms is a common practice on more than two-third
of all Internet users, according to OurWorld In Data. From this perspective, the
verification of a real profile is a matter of growing interest, because false virtual identity
could trigger problems such as spoofing, bots, grooming, sextortion, just to name a few.
This paper presents a method to detect fake profiles on social media platforms by
deploying some machine learning detection methods over a novel dataset. The dataset was
designed with 17 metadata features from real and fake profiles and it was tested on
Instagram profiles. After deploying different machine learning algorithms, the obtained
25
detection rate was near to 96% with good false positive rates.
Online impersonating or identity theft has become a bigger problem with each year that
passes. According to [1] impersonating and phishing are becoming uprising threats
because of the evolution of technology. This evolution is helping these kind of attacks to
become more and sofisticated and thats why security technologies have to evolve too.
Also, the consecuences of this kind of online attacks may keep becoming worse as their
scope grows, embracing the stealing of personal information and money. According to the
proposal of [2], this type of attack mostly represents a challenge for authentication
methods in different types of networks and also for the early detection of cases of
impersonation and phishing. This can be achieved through the implementation of different
technologies such as PHY security in IoT systems. All this taking into account the factors
problems can be found in social networks too and they are becoming the most used tool for
this malicious purposes because of the social networks increasing usage. As said in [3],
social networks such as Facebook, Twitter, LinkedIn and tumblr are some of the most used
social networks having millions of connections in just one day. Millions of people using
social networks are mostly unaware of the dangers and security risks that exists in this
privacy risks, fake profiles, sexual harassment among others. Personal information stealing
and impersonation are strongly related problems as one can derivate from the other. In [3],
expose a hypothetical of creation of a fake Facebook profile and the privacy consequences
it may have is included. Exposed step by step, the attacker created a profile with detailed
26
false information and tried to establish contact with the victim by sending a friend request.
In this case, if the victim agrees, part of the information is automatically exposed.
Additionally if the attacker tries to dig deeper, more sensitive information can be exposed
to an unwanted third party. All the information extracted using this technique, such as lists
of friends, places of work and study, can be used for future and wider attacks or simply as
a collection of valuable information. Fake profiles are not always managed by a person,
these profiles can be bots that mimic human behavior and are in charge of accumulating
information from different users. In [3] it is mentioned that these bots are also often used
to cause massive spam, manipulation of social network statistics and sudden increases in
server traffic. additionally, friend lists are often used to expand and multiply the impact of
the consequences of these bots. Another bot related attack that can be made using any
social networks fake accounts it’s called Sybil attack. According to [4] this kind of attack
seeks for establishing a huge and solid fake accounts network to later attempt to
manipulate the system in ways it is not meant to be manipulated. In fact, this is contrary to
the most common rule on social media wich dictates that one user can have one account
only. After establishing these fake accounts into the network by sending an enormous
quantity of friend requests or follow request, these fake accounts become more a more
trustfull cause they have been building relevance in the selected platform. Additionally as
stated in [4], this accounts can be used to manipulate poll results and for spreading false
27
CHAPTER 3
SYSTEM DESIGN
EXSISITNG SYSTEM:
Social networking sites like Facebook, Instagram, Twitter etc.., where each user has a
profile and can keep in contact with friends, share their updates, meet new people who
have the same interests. These Online Social Networks (OSN) use web2.0 technology,
which allows users to interact with each other. Social networking sites are growing rapidly
and changing the way people keep in contact with each other. But some cyber criminals
use this technology in a wrong way and one among them is taking details of women
including their profile picture. Using those details they create a fake account and start
misusing in the name of the victim. To prevent this we have proposed a model which helps
to identify fake accounts.The social network, a crucial part of our life is plagued by online
Report’ published by Facebook on March 2018, about 583 million fake accounts were
taken down just in quarter 1 of 2018 and as many as 3-4% of its active accounts during this
time were still fake. In this project, we propose a model that could be used to classify an
account as fake or genuine. This model uses Support Vector Machine as a classification
technique and can process a large dataset of accounts at once, eliminating the need to
evaluate each account manually. The community of concern to us here is Fake Accounts
28
and our problem can be said to be a classification or a clustering problem.
PROPOSED SYSTEM:
The Application Domain of the following project was Community Detection. Community
extracting useful information from them. In this project, we came up with a framework
through which we can detect a fake profile using machine learning algorithms so that the
2. Once the profile is selected, the useful features are extracted for the purpose of
classification.
6. The result of classification algorithm is then verified and feedback is fed back into the
classifier.
7. As the number of training data increases the classifier becomes more and more accurate
FLOW DIAGRAM
29
APPLICATIONS:
The social networking sites are making our social lives better but nevertheless there are a
The issues are privacy, online bullying, potential for misuse, trolling, etc. These are done
In this project, we came up with a framework through which we can detect a fake profile
using machine learning algorithms so that the social life of people become secured.
BLOCK DIAGRAM:
30
31
CHAPTER 4
SOFTWARE DESCRIPTION
PYTHON 3.7:
Guido van Rossum and first released in 1991, Python's design philosophy emphasizes code
level data structures and a simple but effective approach to object- oriented programming.
Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it
an ideal language for scripting and rapid application development in manya reason most
platforms and
may be freely distributed. The same site also contains distributions of and pointers to many
free third party Python modules, programs and tools, and additional documentation. The
Python interpreter is easily extended with new functions and data types implemented in C
or C++ (or other languages callable from C). Python is also suitable as an extension
language for customizable applications. This tutorial introduces the reader informally to
the basic concepts and features of the Python language and system. It helps to have a
Python interpreter handy for hands-on experience, but all examples are self-contained, so
the tutorial can be read off- line as well. For a description of standard objects and modules,
write extensions in C or C++, read extending-index and c-api-index. There are also several
books covering Python in depth. This tutorial does not attempt to be comprehensive and
32
cover every single feature, or even every commonly used feature. Instead, it introduces
many of Python’s most notes worthy features, and will give you a good idea of the
language’s flavor and style. After reading it, you will be able to read and write Python
modules and programs, and you will be ready to learn more about the various Python
to automate. For example, you may wish to perform a search-and-replace over a large
number of text files, or rename and rearrange a bunch of photo files in a complicated way.
GUI application or a simple game. If you’re a professional software developer, you may
have to work with several C/C++/Java libraries but find the usual write/compile/test/re-
compile cycle is too slow. Perhaps you’re writing a test suite for such a library and find
writing the testing code a tedious task. Or maybe you’ve written a program that could use
an extension language, and you don’t want to design and implement a whole new language
primary prompt causes the interpreter to exit with a zero exit status. If that doesn’t work,
you can exit the interpreter by typing the following command: quit(). The interpreter’s
line-editing features include interactive editing, history substitution and code completion
on systems that support read line. Perhaps the quickest check to see whether command line
editing is supported is typing Control-P to the first Python prompt you get. If it beeps, you
have command line editing; see Appendix Interactive Input Editing and History
33
Substitution for an introduction to the keys. Ifnothing appears to happen, or if ^P is
echoed, command line editing isn’t available; you’ll only be able to use backspace to
remove characters from the current line. The interpreter operates somewhat like the Unix
shell: when called with standard input connected to a tty device, it reads and executes
commands interactively; when called with a file name argument or with a file as standard
input, it reads and executes a script from that file. A second way of starting the interpreter
is python -c command [arg] ..., which executes the statement(s) in command, analogous to
the shell’s -c option. Since Python statements often contain spaces or other characters that
using python-m module [arg]...,which executes the source file for the module as if you had
spelled out its full name on the command line. When a script file is used, it is sometimes
useful to be able to run the script and enter interactive mode afterwards. This can be done
There are tools which use doc strings to automatically produce online or printed
documentation or to let the user interactively browse through code; it’s good practice to
include doc strings in code that you write, so make a habit of it. The execution of a
function introduces a new symbol table usedfor the local variables of the function. More
precisely, all variable assignments in a functions to read the value in the local symbol
table; whereas variable references first look in the local symbol table, then in the local
symbol tables of enclosing functions, then in the global symbol table, and finally in the
table of built-in names. Thus, global variables cannot be directly assigned a value within a
34
function (unless named in a global statement), although they may be referenced. The actual
parameters (arguments) to a function call are introduced in the local symbol table of the
called function when it is called; thus, arguments are passed using call by value (where the
value is always an object reference, not the value of the object).1 When a function calls
another function, a new local symbol table is created for that call. A function definition
introduces the function name in the current symbol table. The value of the function name
has a type that is recognized by the interpreter as a user-defined function. This value can
Annotations are stored in the annotations attribute of the function as a dictionary and
haven o effect on any other part of the function. Parameter annotations are defined by a
colon after the parameter name, followed by an expression evaluating to the value of the
between the parameter list and the colon denoting the end of the def statement.
The comparison operators in and not in check whether a value occurs (does not occur) in a
sequence. The operator is and does not compare whether two objects are really the same
object; this only matters for mutable objects like lists. All comparison operators have the
same priority, which is lower than that of all numerical operators. Comparisons can be
may be combined using the Boolean operators and the outcome of a comparison (or of any
other Boolean expression) may be negated with not. These have lower priorities than
comparison operators; between them, not has the highest priority and or the lowest, so that
A and not B or C is equivalent to (A and (not B)) or C. As always, parentheses can be used
35
to express the desired composition. The Boolean operators and are so-called short-circuit
operators: their arguments are evaluated from left to right, and evaluation stops as soon as
the outcome is determined. For example, if A and C are true but Bis false, A and B and C
does not evaluate the expression C. When used as a general value and not as a Boolean,
Classes provide a means of bundling data and functionality together. Creating a new class
creates a new type of object, allowing new instances of that type to be made. Each class
instance can have attributes attached to it for maintaining its state. Class instances can also
have methods (defined by its class) for modifying its state. Compared with other
programming languages, Python’s class mechanism adds classes with a minimum of new
syntax and semantics. It is a mixture of the class mechanisms found in C++ and Modula-3.
Python classes provide all the standard features of Object Oriented Programming: the class
inheritance mechanism allows multiple base classes, a derived class can override any
methods of its base class or classes, and a method can call the method of a base class with
the same name. Objects can contain arbitrary amounts and kinds of data. As is true for
modules, classes partake of the dynamic nature of Python: they are created at runtime, and
can be modified further after creation. In C++ terminology, normally class members
(including the data members) are public (except see below Private Variables), and all
member functions are virtual. A sin Modula-3, there are no short hands for referencing the
object’s members from its methods: the method function is declared with an explicit first
argument representing the object, which is provided implicitly by the call. A sin Small
talk, classes themselves are objects. This providesSemantics for importing and renaming.
36
Unlike C++ and Modula-3, built-in types can be used as base classes for extension by the
user. Also, like in C++, most built-in operators with special syntax (arithmetic operators,
sub scripting etc.) can be redefined for class instances.(Lacking universally accepted
terminology to talk about classes, I will make occasional use of Smalltalk and C++ terms. I
would use Modula-3 terms, since its object- oriented semantics are closer to those of
Python than C++, but I expect that few readers have heard of it.)
Objects have individuality, and multiple names (in multiple scopes) can be bound to the
same object. This is known as aliasing in other languages. This is usually not appreciated
on a first glance at Python, and can be safely ignored when dealing with immutable basic
types (numbers, strings, tuples).However, aliasing has a possibly surprising effect on these
mantic of Python code involving mutable objects such as lists, dictionaries, and most other
types. This is usually used to the benefit of the program, since aliases behave like pointers
in some respects. For example, passing an object is cheap since only a pointer is passed by
the implementation; and if a function modifies an object passed as an argument, the caller
will see the change — this eliminates the need for two different argument passing
mechanisms as in Pascal.
A namespace is a mapping from names to objects. Most name spaces are currently
implemented as Python dictionaries, but that’s normally not noticeable in any way (except
for performance), and it may change in the future. Examples of name spaces are: these to f
built-in names (containing functions such as abs(), and built-in exception names); the
global names in a module; and the local names in a function invocation. In a sense the set
of attributes of an object also form a namespace. The important thing to know about
37
namespaces is that there is absolutely no relation between names in different namespaces;
for instance, two different modules may both define a function maximize without
confusion — users of the modules must prefix it with the module name. By the way, I use
the word attribute for any name following a dot — for example, in the expression z. real,
real is an attribute of the object z. Strictly speaking, references to names in modules are
and funcname is an attribute of it. In this case there happens to be a straight forward
mapping between the module’s attributes and the global names defined in the module: they
share the same namespace!1 Attributes may be read-only or writable. In the latter case,
assignment to attributes is
write modname.the_answer = 42. Writable attributes may also be deleted with the del
statement. For example, del mod name .the_ answer will remove the attribute the_answer
from the object named by mod name. Namespaces are created at different moments and
have different lifetimes. The namespace containing the built-in names is created when the
Python interpreter starts up, and is never deleted. The global namespace for a module is
created when the module definition is read in; normally, module namespaces also last until
the interpreter quits.The statements executed by the top-level invocation of the interpreter,
either read from a script file or interactively, are considered part of a module called main,
so they have their own global namespace.(The built-in names actually also live in a
module; this is called built ins.) The local namespace for a function is created when the
38
function is called, and deleted when the function returns or raises an exception that is not
handled within the function. (Actually, forgetting would be a better way to describe what
actually happens.) Of course, recursive invocations each have their own local namespace.
file; it generally contains the Python version number. For example, in CPython release 3.3
convention allows compiled modules from different releases and different versions of
Python to coexist. Python checks the modification date of the source against the compiled
version to see if it’s out of date and needs to be recompiled. This is a completely automatic
process. Also, the compiled modules are platform-independent, so the same library can be
shared among systems with different architectures. Python does not check the cache in two
circumstances. First, it always recompiles and does not store the result for the module
that’s loaded directly from the command line. Second, it does not check the cache if there
module must be in the source directory, and there must not be a source module. Some tips
for experts:
39
You can use the -O or -OO switches on the Python command to reduce the size of a
compiled module. The -O switch removes assert statements, the -OO switch removes both
strings. Since some programs may rely on having these available, you should only use this
modules have an opt- tag and are usually smaller. Future releases may change the effects
of optimization.
A program doesn’t run any faster when it is read from a .pyc file than when it is read from
a .py file; the only thing that’s faster about .pyc files is the speed with which they are
loaded.
The module compile all can create .pyc files for all modules in a directory.
There is more detail on this process, including a flow chart of the decisions
40
CHAPTER 5
MODULES USED
Tk/Tcl has long been an integral part of Python. It provides a robust and platform
the tkinter package, and its extension, the tkinter.tix and the tkinter.ttk modules.
The tkinter package is a thin object-oriented layer on top of Tcl/Tk. To use tkinter, you
don’t need to write Tcl code, but you will need to consult the Tk documentation, and
occasionally the Tcl documentation. tkinter is a set of wrappers that implement the Tk
tkinter’s chief virtues are that it is fast, and that it usually comes bundled with Python.
Although its standard documentation is weak, good material is available, which includes:
references, tutorials, a book and others. tkinter is also famous for having an outdated look
and feel, which has been vastly improved in Tk 8.5. Nevertheless, there are many other
GUI libraries that you could be interested in. The Python wiki lists several alternative GUI
The tkinter package (“Tk interface”) is the standard Python interface to the Tcl/Tk GUI
toolkit. Both Tk and tkinter are available on most Unix platforms, including macOS, as
Running python -m tkinter from the command line should open a window demonstrating a
simple Tk interface, letting you know that tkinter is properly installed on your system, and
also showing what version of Tcl/Tk is installed, so you can read the Tcl/Tk
41
Tkinter supports a range of Tcl/Tk versions, built either with or without thread support.
The official Python binary release bundles Tcl/Tk 8.6 threaded. See the source code for
Tkinter is not a thin wrapper, but adds a fair amount of its own logic to make the
experience more pythonic. This documentation will concentrate on these additions and
changes, and refer to the official Tcl/Tk documentation for details that are unchanged.
Tcl/Tk is not a single library but rather consists of a few distinct modules, each with
separate functionality and its own official documentation. Python’s binary releases also
Tcl
Tcl is a dynamic interpreted programming language, just like Python. Though it can be
Tcl library has a C interface to create and manage one or more instances of a Tcl
interpreter, run Tcl commands and scripts in those instances, and add custom commands
implemented in either Tcl or C. Each interpreter has an event queue, and there are facilities
to send events to it and process them. Unlike Python, Tcl’s execution model is designed
around cooperative multitasking, and Tkinter bridges this difference (see Threading
Tk
manipulate GUI widgets. Each Tk object embeds its own Tcl interpreter instance with Tk
42
loaded into it. Tk’s widgets are very customizable, though at the cost of a dated
appearance. Tk uses Tcl’s event queue to generate and process GUI events.
Ttk
Themed Tk (Ttk) is a newer family of Tk widgets that provide a much better appearance
on different platforms than many of the classic Tk widgets. Ttk is distributed as part of Tk,
module, tkinter.ttk.
Internally, Tk and Ttk use facilities of the underlying operating system, i.e., Xlib on
When your Python application uses a class in Tkinter, e.g., to create a widget,
the tkinter module first assembles a Tcl/Tk command string. It passes that Tcl command
string to an internal _tkinter binary module, which then calls the Tcl interpreter to evaluate
it. The Tcl interpreter will then call into the Tk and/or Ttk packages, which will in turn
Tkinter Modules
Support for Tkinter is spread across several modules. Most applications will need the
main tkinter module, as well as the tkinter.ttk module, which provides the modern themed
The Tk class is instantiated without arguments. This creates a toplevel widget of Tk which
43
usually is the main window of an application. Each instance has its own associated Tcl
interpreter.
The Tcl() function is a factory function which creates an object much like that created by
the Tk class, except that it does not initialize the Tk subsystem. This is most often useful
when driving the Tcl interpreter in an environment where one doesn’t want to create
extraneous toplevel windows, or where one cannot (such as Unix/Linux systems without
an X server). An object created by the Tcl() object can have a Toplevel window created
tkinter
tkinter.colorchooser
tkinter.commondialog
Base class for the dialogs defined in the other modules listed here.
tkinter.filedialog
tkinter.font
tkinter.messagebox
44
tkinter.scrolledtext
tkinter.simpledialog
tkinter.ttk
Themed widget set introduced in Tk 8.5, providing modern alternatives for many of the
Additional modules:
_tkinter
imported by the main tkinter module, and should never be used directly by application
programmers. It is usually a shared library (or DLL), but might in some cases be statically
idlelib
tkinter.constants
Symbolic constants that can be used in place of strings when passing various parameters to
tkinter.dnd
(experimental) Drag-and-drop support for tkinter. This will become deprecated when it is
tkinter.tix
45
(deprecated) An older third-party Tcl/Tk package that adds several new widgets. Better
turtle
This section is not designed to be an exhaustive tutorial on either Tk or Tkinter. For that,
refer to one of the external resources noted earlier. Instead, this section provides a very
The remainder of this section will help you to identify the classes, methods, and options
you’ll need in your Tkinter application, and where to find more detailed documentation on
46
CHAPTER 6
RESULTS
47
CHAPTER 7
CONCLUSION
The model presented in this project demonstrates that is an elegant and robust
on public profiles for various purposes. This project uses only publicly available
information which makes it convenient for organizations that want to avoid any
breach of privacy, but organizations can also use private data available to them
ther existing approaches based on the larger data set and more profile
domains to find successful solutions to the problem where the least amount of
information is available. In future work we expect to run our model using more
analyze user posts, and comportments. This later concept can improve the
4
8
FUTURE WORK
Since we have limited data to train the classifier, our approach is facing a high
variance problem which can be observed in the learning curve as follows High
variance problems can usually be mitigated by increasing the size of the dataset
4
9
REFERENCES:
study for detecting fake Facebook profiles using supervised mining techniques."
Cham, 2019.
Facebook." 2017 ISEA Asia Security and Privacy (ISEASP). IEEE, 2017.
Learning." (2019).
7. Fire, Michael, et al. "Friend or foe? Fake profile identification in online social
8. Sami, Memoona, et al. "An automated framework for finding fake accounts
5
0
and Engineering 7.2 (2018): 8-16.
10. Singh, Naman, et al. "Detection of fake profile in online social networks
12. Gurav, Subhadra, et al. "Survey on Automated System for Fake News
13. Sowmya, M., and J. Shiva Shankar. "A Survey on Detection of Fake News
(SCOReD).
5
1
17. Marco L. Della Vedova, Eugenio Tacchini, Stefano Moret, Gabriele
Science.
detection: Methods for finding fake news.”, Proceedings of the Association for
22. S. Maheshwari, “How fake news goes viral: A case study”, Nov.2016.
5
2