unit-4
unit-4
Crisp Set: Crisp set is a collection of unordered distinct elements, which are derived from a
Universal set. A Universal set consists of all possible elements which take part in any
experiment.
Let X represents a set of natural numbers, so
X = {1, 2, 3, 4 …}
Sets are always defined with respect to some universal set. Let us derive two sets A and B from
this universal set X.
A = Set of even numbers = {2, 4, 6 …}
B = Set of odd number = {1, 3, 5 …}
Elements in the set are unique, i.e. A = {1, 1, 2, 2, 3, 3}, B = {1, 2, 3}, C = {1, 2, 2, 3, 3, 3} all
are the same.
The order of elements in the set is not important, i.e. A = {1, 2, 3}, B = {2, 1, 3}, C = {3, 1,
2}, all correspond to identical set.
The element of the set is called a member of the set. If any element is present in the set then
it is considered a member of the set otherwise it is not a member. In a crisp set, there is no
concept of partial membership. Element is either fully present in the set or it is fully outside the
set.
A crisp set is very important to model or represents many real-world entities, such as a set of
boys, a set of books, a set of elements, a set of employees, a set of colours etc.
The membership function can be used to define a set A given by
ΧA (x) = {1, 0, ifx∈Aifx∉A}
Fuzzy Logic:
The 'Fuzzy' word means the things that are not clear or are vague. Sometimes, we cannot
decide in real life that the given problem or statement is either true or false. At that time, this
concept provides many values between the true and false and gives the flexibility to find the
best solution to that problem.
Example:
Fuzzy logic contains the multiple logical values and these values are the truth values of a
variable or problem between 0 and 1. This concept was introduced by Lofti
Zadeh in 1965 based on the Fuzzy Set Theory. This concept provides the possibilities which
are not given by computers, but similar to the range of possibilities generated by humans.
In the Boolean system, only two possibilities (0 and 1) exist, where 1 denotes the absolute truth
value and 0 denotes the absolute false value. But in the fuzzy system, there are multiple
possibilities present between the 0 and 1, which are partially false and partially true.
The Fuzzy logic can be implemented in systems such as micro-controllers, workstation-based or
large network-based systems for achieving the definite output. It can also be implemented in
both hardware and software.
Characteristics of Fuzzy Logic
This concept is flexible and we can easily understand and implement it.
It is used for helping the minimization of the logics created by the human.
It is the best method for finding the solution of those problems which are suitable for
approximate or uncertain reasoning.
It always offers two values, which denote the two possible solutions for a problem and
statement.
It allows users to build or create the functions which are non-linear of arbitrary
complexity.
In fuzzy logic, everything is a matter of degree.
In the Fuzzy logic, any system which is logical can be easily fuzzified.
It is based on natural language processing.
It is also used by the quantitative analysts for improving their algorithm's execution.
It also allows users to integrate with the programming.
1. Rule Base: Rule Base is a component used for storing the set of rules and the If-Then
conditions given by the experts are used for controlling the decision-making systems.
3. Inference Engine: This component is a main component in any Fuzzy Logic system (FLS),
because all the information is processed in the Inference Engine. It allows users to find the
matching degree between the current fuzzy input and the rules. After the matching degree, this
system determines which rule is to be added according to the given input field. When all rules
are fired, then they are combined for developing the control actions.
4. Defuzzification: Defuzzification is a module or component, which takes the fuzzy set inputs,
generated by the Inference Engine, and then transforms them into a crisp value. The crisp value
is a type of value which is acceptable by the user. Various techniques are present to do this, but
the user has to select the best one for reducing the errors.
Operations on Fuzzy Set: Given A and B is the two fuzzy sets, and X is the universe of
discourse with the following respective member functions:
The operations of Fuzzy set are as follows:
1. Union Operation: The union operation of a fuzzy set is defined by:
μA∪B(x) = max (μA(x), μB(x))
Example:
Let's suppose A is a set which contains following elements:
A = {( X1, 0.6 ), (X2, 0.2), (X3, 1), (X4, 0.4)}
And, B is a set which contains following elements:
B = {( X1, 0.1), (X2, 0.8), (X3, 0), (X4, 0.9)}
then,
AUB = {( X1, 0.6), (X2, 0.8), (X3, 1), (X4, 0.9)}
Because, according to this operation
For X1
μA∪B(X1) = max (μA(X1), μB(X1))
μA∪B(X1) = max (0.6, 0.1)
μA∪B(X1) = 0.6
For X2
μA∪B(X2) = max (μA(X2), μB(X2))
μA∪B(X2) = max (0.2, 0.8)
μA∪B(X2) = 0.8
For X3
μA∪B(X3) = max (μA(X3), μB(X3))
μA∪B(X3) = max (1, 0)
μA∪B(X3) = 1
For X4
μA∪B(X4) = max (μA(X4), μB(X4))
μA∪B(X4) = max (0.4, 0.9)
μA∪B(X4) = 0.9
2. Intersection Operation:The intersection operation of fuzzy set is defined by:
μA∩B(x) = min (μA(x), μB(x))
Example:
Let's suppose A is a set which contains following elements:
A = {( X1, 0.3 ), (X2, 0.7), (X3, 0.5), (X4, 0.1)}
And, B is a set which contains following elements:
B = {( X1, 0.8), (X2, 0.2), (X3, 0.4), (X4, 0.9)}
then,
A∩B = {( X1, 0.3), (X2, 0.2), (X3, 0.4), (X4, 0.1)}
1. This theory is a class of those sets 1. This theory is a class of those sets having
having sharp boundaries. un-sharp boundaries.
2. This set theory is defined by exact 2. This set theory is defined by ambiguous
boundaries only 0 and 1. boundaries.
4. This theory is widely used in the 4. It is mainly used for fuzzy controllers.
design of digital systems.
Membership Function:
The membership function is a function which represents the graph of fuzzy sets, and allows
users to quantify the linguistic term. It is a graph which is used for mapping each element of x
to the value between 0 and 1. This function is also known as indicator or characteristics
function.
This function of Membership was introduced in the first papers of fuzzy set by Zadeh. For the
Fuzzy set B, the membership function for X is defined as: μB:X → [0,1]. In this function X,
each element of set B is mapped to the value between 0 and 1. This is called a degree of
membership or membership value.
Defuzzification: Defuzzification may be defined as the process of reducing a fuzzy set into a
crisp set or to convert a fuzzy member into a crisp member. Mathematically, the process of
Defuzzification is also called "rounding it off". Defuzzification basically transforms an
imprecise data into precise data. However, it is a relatively complex to implement
defuzzification as compared to fuzzification.
Defuzzification is basically the reverse process of fuzzification because it converts the fuzzy
data into crisp data. In some practical implementations, the defuzzification process is required
for crisp control actions to operate the control.
Now, let us discuss the differences between fuzzification and defuzzification.
Applications of FIS:
A fuzzy inference system is used in different fields, for example, information order, choice
examination, master system, time arrangement forecasts, advanced mechanics, and example
acknowledgment. It is otherwise called a fuzzy rule-based system, fuzzy model, fuzzy logic
controller, fuzzy expert system, and fuzzy associative memory.
It is the vital unit of a fuzzy logic system that deals with decision-making and choosing
essential tasks. It utilizes the “IF… . At that point” leads alongside the connectors “AND” “OR”
to draw fundamental choice standards.
The various steps involved in designing a fuzzy logic controller are as follows:
Step 1: Locate the input, output, and state variables of the plane under consideration. I
Step 2: Split the complete universe of discourse spanned by each variable into a number of
fuzzy subsets, assigning each with a linguistic label. The subsets include all the elements in the
universe.
Step 3: Obtain the membership function for each fuzzy subset.
Step 4: Assign the fuzzy relationships between the inputs or states of fuzzy subsets on one side
and the output of fuzzy subsets on the other side, thereby forming the rule base.
Step 5: Choose appropriate scaling factors for the input and output variables for normalizing the
variables between [0, 1] and [-1, I] interval.
Step 6: Carry out the fuzzification process.
Step 7: Identify the output contributed from each rule using fuzzy approximate reasoning.
Step 8: Combine the fuzzy outputs obtained from each rule.
Step 9: Finally, apply defuzzification to form a crisp output.
Applications:
Traffic Control
Steam Engine
Aircraft Flight Control
Missile Control
Adaptive Control
Liquid-Level Control
Helicopter Model
Automobile Speed Controller
Braking System Controller
Process Control (includes cement kiln control)
Robotic Control
Elevator (Automatic Lift) control
Automatic Running Control
Cooling Plant Control
Water Treatment
Boiler Control
Nuclear Reactor Control
Power Systems Control
FUZZY CLUSTERING:
Fuzzy clustering is an unsupervised machine learning technique that divides the given data into
different clusters based on their distances (similarity) from each other.
The unsupervised k-means clustering algorithm gives the values of any point lying in some
particular cluster to be either as 0 or 1 i.e., either true or false. But the fuzzy logic gives the
fuzzy values of any particular data point to be lying in either of the clusters. Here, in fuzzy c-
means clustering, we find out the centroid of the data points and then calculate the distance of
each data point from the given centroids until the clusters formed become constant.
Suppose the given data points are {(1, 3), (2, 5), (6, 8), (7, 9)}
Fuzzy Clustering is a type of clustering algorithm in machine learning that allows a data point
to belong to more than one cluster with different degrees of membership. Unlike traditional
clustering algorithms, such as k-means or hierarchical clustering, which assign each data point
to a single cluster, fuzzy clustering assigns a membership degree between 0 and 1 for each data
point for each cluster.
Applications in several fields of Fuzzy clustering:
1. Image segmentation: Fuzzy clustering can be used to segment images by grouping pixels
with similar properties together, such as color or texture.
2. Pattern recognition: Fuzzy clustering can be used to identify patterns in large datasets by
grouping similar data points together.
3. Marketing: Fuzzy clustering can be used to segment customers based on their preferences
and purchasing behavior, allowing for more targeted marketing campaigns.
4. Medical diagnosis: Fuzzy clustering can be used to diagnose diseases by grouping
patients with similar symptoms together.
5. Environmental monitoring: Fuzzy clustering can be used to identify areas of
environmental concern by grouping together areas with similar pollution levels or other
environmental indicators.
6. Traffic flow analysis: Fuzzy clustering can be used to analyze traffic flow patterns by
grouping similar traffic patterns together, allowing for better traffic management and
planning.
7. Risk assessment: Fuzzy clustering can be used to identify and quantify risks in various
fields, such as finance, insurance, and engineering.
Advantages of Fuzzy Clustering:
Flexibility: Fuzzy clustering allows for overlapping clusters, which can be useful when
the data has a complex structure or when there are ambiguous or overlapping class
boundaries.
Robustness: Fuzzy clustering can be more robust to outliers and noise in the data, as it
allows for a more gradual transition from one cluster to another.
Interpretability: Fuzzy clustering provides a more nuanced understanding of the structure
of the data, as it allows for a more detailed representation of the relationships between
data points and clusters.
Disadvantages of Fuzzy Clustering:
Complexity: Fuzzy clustering algorithms can be computationally more expensive than
traditional clustering algorithms, as they require optimization over multiple membership
degrees.
Model selection: Choosing the right number of clusters and membership functions can be
challenging, and may require expert knowledge or trial and error.
If you’re interested in learning more about fuzzy clustering, you might consider reading
“Fuzzy Clustering and Its Applications” by James C. Bezdek or “An Introduction to
Fuzzy Clustering” by Witold Pedrycz and Fernando Gomide.
PATTERN RECOGNITION:
Pattern recognition aims to imitate the capabilities of the human brain. Think about it this way:
predictions on unseen data are feasible because of a models’ ability to identify recurring
patterns. In the meantime, that may happen with any data format, be it an image, video, text,
audio, etc.
While inherently complex, pattern recognition involves analyzing the input data, extracting
patterns, and comparing them against the stored data. The procedure can be broken down into
two phases: explorative, when the algorithms explore patterns, and descriptive, when algorithms
group and attribute the found patterns to the initial data. If we break this further, pattern
recognition in machine learning encompasses the following path:
Data collection: Using open-source datasets may cut off a great deal of time, as opposed to the
tedious manual data collection. Data quality control should still be your priority. An alternative
scenario is when your data is impossible to collect manually and the only way to go is to
generate or design artificial sets on your own, i.e., synthetic datasets.
Pre-processing: Pre-processing is all about fixing impurities to produce more comprehensive
sets of data and increase the chances of top-notch predictions.
Feature extraction: The input data is transformed into a feature vector, a reduced
representation of a set of features. That is to solve the issue of the high-dimensionality of the
input set, which means that only relevant information, namely selected features should be
extracted, as opposed to a full-size input.
Classification: Extracted features are used to compare them against similar patterns,
associating each one to the relevant class. The learning procedure, as we know, can take place
in two ways: With supervised learning, the classifiers will have prior knowledge of each pattern
category on top of the metrics and relevant parameters to distinguish among different patterns.
With regard to unsupervised learning, the parameters are defined or updated upon the
introduction of the input data. The model here relies on the inherent patterns in data it is capable
of determining to generate the desired output. Final heads-up: pattern recognition doesn’t end
with the raw output. It is usually followed by post-processing, which involves further decision-
making on how to use those results to properly guide the system.
RETRIEVAL SYSTEM:
The concept of Information Retrieval System (IRS) is self-explanatory from the terminological
point of view and refers to a ‘system which retrieves information’. IRS is concerned with two
basic aspects:
(i) How to store information, and
(ii) How to retrieve information.
IRS is comprised of a set of interacting components, each of which is designed to serve a
specific function for a specific purpose. All these components are interrelated to achieve a goal.
The concept of IR thus is based on the fact that there are some items of information which have
been organized in a suitable order for easy retrieval. An information retrieval system is
designed to analyze process and store sources of information and retrieve those that match a
particular user’s requirements. Modern information retrieval systems can either retrieve
bibliographic items or the exact text that matches a user’s search criteria from a stored database
of documents. IRS originally meant text retrieval systems as they were dealing with textual
documents. Modern information retrieval systems deal not only with textual information but
also with multimedia information comprising text, audio, images and video. Thus, modern
information retrieval systems deal with storage, organization and access to text, as well as
multimedia information resources. Thus, an IR system is a set of rules and procedures, for
performing some or all of the following operations:
a) Indexing (or constructing of representations of documents);
b) Search formulation (or constructing of representations of information needs);
c) Searching (or matching representations of documents against representations of needs); and
d) Index language construction (or generation of rules of representation) So information
retrieval is collectively defined as a “science of search” or a process, method and procedure
used to select or recall, recorded and/or indexed information from files of data.
NLP benefits:
o Perform large-scale analysis:.
o Get a more objective and accurate analysis:
o Streamline processes and reduce costs
o Improve customer satisfaction
o Better understand your market
o Empower your employees
o Get real, actionable insights
NLP limitations:
o Contextual words and phrases and homonyms
o Synonyms
o Irony and sarcasm
o Ambiguity
o Errors in text or speech
o Colloquialisms and slang
o Domain-specific language
o Low-resource languages
o Lack of research and development
SYSTEM ARCHITECTURE
1. Data Collection: Data is collected from various sources, such as yahoo finance and
google finance, which are in the form of .csv format. For news data gathering system
uses Google News API.
2. Analysis Manipulation and Visualization of data: Analysis Manipulation and
Visualization of Data: Data collected is cleaned and pre mal algorithms and models. And
along with this data visualization is also performed. The cleaned and pre-processed data
is used to create, build and train various machine learning algorithms which can be used
in predictions.
3. Build a Model: After the model has been built successfully, the next thing to do is
predict an outcome pattern for a particular stock and check the accuracy of the
predictions. esults of all Algorithms:
4. Predict Combining Results of all algorithms: After models are built system combines
their results for better prediction and high accuracy and predicts the output based on real
time data provided to it. Predict an outcome after models are built system combines their
results for better data provided to it.
Artificial Intelligence is shaping the future of stock trading. Using Artificial Intelligence, Robo-
advisers analyze millions of data points and execute trades at the optimal price, analysts
forecast markets with greater accuracy and trading firms efficiently mitigate risk to provide for
higher returns.