Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Sami Assagnment12

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

WOLLEGA UNIVERSITY

INSTITUTE OF TECHNOLOGY

SCHOOL OF GRADUATE STUDIES

DEPARTMENT OF COMPUTER SCIENCE

GIS Mini Project On:

NEKEMTE TOWN GIS BASED HIGH SCOOL AND

HIGHER EDUCATION INFORMATION SYSTEM

Submitted by:

Name ID

1. MICHAEL BELEW 11007743

Submitted to: Dr. Samy.

March 2020
Contents
Questions...........................................................................................................................................................3
1. Explain about the Fuzzy Logic with an example.................................................................................4
1.1. Definition of fuzzy...........................................................................................................................4
1.2. What is fuzzy logic:.........................................................................................................................4
1.3. Implementation................................................................................................................................5
1.4. Fuzzy Logic Systems Architecture..................................................................................................5
1.5. Membership Function......................................................................................................................6
1.6. Example of a Fuzzy Logic System..................................................................................................7
1.7. Development....................................................................................................................................7
1.8. Application Areas of Fuzzy Logic...................................................................................................9
1.9. Advantages of FLSs.......................................................................................................................10
1.10. Disadvantages of FLSs..................................................................................................................10
2. How do you make use of Neuro fuzzy System?.................................................................................10
2.1. Neuro Fuzzy System......................................................................................................................10
3. Explain the Navie Base Algorithm......................................................................................................11
3.1. What is Naive Bayes algorithm?....................................................................................................11
3.2. How Naive Bayes algorithm works?.............................................................................................12
5. What is Tensor flow and how is it used?.............................................................................................18
5.1. What is Tensor Flow............................................................................................................................18
5.2. How Tensor flow is it used..................................................................................................................18

Wollega University Department of Computer Science MSc Page 2


Questions
1. Explain about the Fuzzy Logic with an example (4)
2. How do you make use of Neuro fuzzy System (4)
3. Explain the Navie Base Algorithm (4)
4. What is Tensor flow and how is it used? (4)

Wollega University Department of Computer Science MSc Page 3


1. Explain about the Fuzzy Logic with an example

1.1. Definition of fuzzy

• Fuzzy – “not clear, distinct, or precise; blurred”


1.2. What is fuzzy logic: - is an approach to computing based on "degrees of
truth" rather than the usual "true or false" (1 or 0) Boolean logic on which the modern
computer is based.
Fuzzy Logic (FL) is a method of reasoning that resembles human reasoning. The approach
of FL imitates the way of decision making in humans that involves all intermediate
possibilities between digital values YES and NO. The conventional logic block that a
computer can understand takes precise input and produces a definite output as TRUE or
FALSE, which is equivalent to human’s YES or NO.
The fuzzy logic works on the levels of possibilities of input to achieve the definite output.
Take a look at the following diagram. It shows that in fuzzy systems, the values are
indicated by a number in the range from 0 to 1. Here 1.0 represents absolute
truth and 0.0 represents absolute falseness. The number which indicates the value
in fuzzy systems is called the truth value.

Wollega University Department of Computer Science MSc Page 4


In other words, we can say that fuzzy logic is not logic that is fuzzy, but logic that is used to
describe fuzziness. There can be numerous other examples like this with the help of which
we can understand the concept of fuzzy logic.
Fuzzy Logic was introduced in 1965 by Lofti A. Zadeh in his research paper “Fuzzy Sets”.
He is considered as the father of Fuzzy Logic.

1.3. Implementation

 It can be implemented in systems with various sizes and capabilities ranging from
small micro-controllers to large, networked, workstation-based control systems.
 It can be implemented in hardware, software, or a combination of both.
Why Fuzzy Logic?
 Fuzzy logic is useful for commercial and practical purposes.
 It can control machines and consumer products.
 It may not give accurate reasoning, but acceptable reasoning.
 Fuzzy logic helps to deal with the uncertainty in engineering.

1.4. Fuzzy Logic Systems Architecture

It has four main parts as shown

Fuzzification Module − It transforms the system inputs, which are crisp numbers, into fuzzy sets. It splits
the input signal into five steps such as: -
LP X is large Positive
MP X is medium positive
S X is small
MN X is medium negative
LN X is large negetive
Knowledge Base − It stores IF-THEN rules provided by experts.
Inference Engine − It simulates the human reasoning process by making fuzzy inference on the inputs and
IF-THEN rules.
Defuzzification Module − It transforms the fuzzy set obtained by the inference engine into a crisp value.

Wollega University Department of Computer Science MSc Page 5


The membership functions work on fuzzy sets of variables.

1.5. Membership Function

Membership functions allow you to quantify linguistic term and represent a fuzzy set
graphically. A membership function for a fuzzy set A on the universe of discourse X is
defined as μA:X → [0,1].
Here, each element of X is mapped to a value between 0 and 1. It is called membership
value or degree of membership. It quantifies the degree of membership of the element
in X to the fuzzy set A.
x axis represents the universe of discourse.
y axis represents the degrees of membership in the [0, 1] interval.
There can be multiple membership functions applicable to fuzzify a numerical value. Simple
membership functions are used as use of complex functions does not add more precision in
the output.

All membership functions for LP, MP, S, MN, and LN are shown as below

Wollega University Department of Computer Science MSc Page 6


The triangular membership function shapes are most common among various other
membership function shapes such as trapezoidal, singleton, and Gaussian.

Here, the input to 5-level fuzzifier varies from -10 volts to +10 volts. Hence the
corresponding output also changes.

1.6. Example of a Fuzzy Logic System

Let us consider an air conditioning system with 5-level fuzzy logic system. This system
adjusts the temperature of air conditioner by comparing the room temperature and the target
temperature value.

Algorithm
 Define linguistic variables and terms.
 Construct membership functions for them.
 Construct knowledge base of rules.
 Convert crisp data into fuzzy data sets using membership functions. fuzzification
 Evaluate rules in the rule base. interface engine
 Combine results from each rule. interface engine
 Convert output data into non-fuzzy values. defuzzification

1.7. Development

Step 1 − Define linguistic variables and terms


Linguistic variables are input and output variables in the form of simple words or sentences.
For room temperature, cold, warm, hot, etc., are linguistic terms.
Temperature (t) = {very-cold, cold, warm, very-warm, hot}
Every member of this set is a linguistic term and it can cover some portion of overall
temperature values.
Wollega University Department of Computer Science MSc Page 7
Step 2 − Construct membership functions for them
The membership functions of temperature variable are as shown

Step3 − Construct knowledge base rules


Create a matrix of room temperature values versus target temperature values that an air
conditioning system is expected to provide.

RoomTemp.
Very_Cold Cold Warm Hot Very_Hot
/Target

Very_Cold No_Change Heat Heat Heat Heat

Cold Cool No_Change Heat Heat Heat

Warm Cool Cool No_Change Heat Heat

Hot Cool Cool Cool No_Change Heat

Very Hot Cool Cool Cool Cool No_Change

Build a set of rules into the knowledge base in the form of IF-THEN-ELSE structures.

Sr. Condition Action


No
.

1 IF temperature = (Cold OR Very Cold) AND target=Warm THEN Heat

Wollega University Department of Computer Science MSc Page 8


2 IF temperature = (Hot OR Very Hot) AND target=Warm THEN Cool

3 IF (temperature=Warm) AND (target=Warm) THEN No Change

Step 4 − Obtain fuzzy value


Fuzzy set operations perform evaluation of rules. The operations used for OR and AND are
Max and Min respectively. Combine all results of evaluation to form a final result. This
result is a fuzzy value.

Step 5 − Perform defuzzification

Defuzzification is then performed according to membership function for output variable.

1.8. Application Areas of Fuzzy Logic

The key application areas of fuzzy logic are as given −


Automotive Systems

 Automatic Gearboxes
 Four-Wheel Steering
 Vehicle environment control

Consumer Electronic Goods

 Hi-Fi Systems

Wollega University Department of Computer Science MSc Page 9


 Photocopiers
 Still and Video Cameras
 Television

Domestic Goods

 Microwave Ovens
 Refrigerators
 Toasters
 Vacuum Cleaners
 Washing Machines

Environment Control

 Air Conditioners/Dryers/Heaters
 Humidifiers

1.9. Advantages of FLSs

 Mathematical concepts within fuzzy reasoning are very simple.


 You can modify a FLS by just adding or deleting rules due to flexibility of fuzzy logic.
 Fuzzy logic Systems can take imprecise, distorted, noisy input information.
 FLSs are easy to construct and understand.
 Fuzzy logic is a solution to complex problems in all fields of life, including medicine, as it
resembles human reasoning and decision making.

1.10. Disadvantages of FLSs

 There is no systematic approach to fuzzy system designing.


 They are understandable only when simple.
 They are suitable for the problems which do not need high accuracy.

2. How do you make use of Neuro fuzzy System?

2.1. Neuro Fuzzy System

A neuro-fuzzy system is a fuzzy system that uses a learning algorithm derived from or
inspired by neural network theory to determine its parameters (fuzzy sets and fuzzy rules)
by processing data samples.
Neuro-fuzzy systems are basically adaptive fuzzy systems developed by exploiting the
similarities between fuzzy systems and certain forms of neural networks. Neural Networks

Wollega University Department of Computer Science MSc Page 10


have their Strengths Fuzzy Logic has its Strengths.
 Were created to solve the trade-off between:
o The mapping precision & automation of Neural Networks
o The interpretability of Fuzzy Systems
 Combines both such that either:
o Fuzzy system gives input to Neural Network
o Neural Network gives input to Fuzzy Systems

The neurons of NN has been designed using the concept of fuzzy set theory
An FNN has been developed in the following way:
1. Real input but fuzzy weights
2. Fuzzy inputs but real weights
3. Fuzzy inputs and fuzzy weights

Wollega University Department of Computer Science MSc Page 11


3. Explain the Navie Base Algorithm

3.1. What is Naive Bayes algorithm?

It is a classification technique based on Bayes' Theorem with an assumption of independence


among predictors. In simple terms, a Naive Bayes classifier assumes that the presence of a
particular feature in a class is unrelated to the presence of any other feature.
For example: -
a fruit may be considered to be an apple if it is red, round, and about 3 inches in diameter.
Even if these features depend on each other or upon the existence of the other features, all of
these properties independently contribute to the probability that this fruit is an apple and that
is why it is known as ‘Naive’.
Naive Bayes model is easy to build and particularly useful for very large data sets. Along
with simplicity, Naive Bayes is known to outperform even highly sophisticated classification
methods.

Bayes theorem provides a way of calculating posterior probability P(c|x) from P(c), P(x) and
P(x|c). Look at the equation below:

Above,

 P(c|x) is the posterior probability of class (c, target) given predictor (x, attributes).


 P(c) is the prior probability of class.
 P(x|c) is the likelihood which is the probability of predictor given class.
Wollega University Department of Computer Science MSc Page 12
 P(x) is the prior probability of predictor.

3.2. How Naive Bayes algorithm works?

Let’s understand it using an example. Below I have a training data set of weather and
corresponding target variable ‘Play’ (suggesting possibilities of playing). Now, we need to
classify whether players will play or not based on weather condition. Let’s follow the below
steps to perform it.

Step 1: Convert the data set into a frequency table

Step 2: Create Likelihood table by finding the probabilities like Overcast probability = 0.29
and probability of playing is 0.64.

Step 3: Now, use Naive Bayesian equation to calculate the posterior probability for each
class. The class with the highest posterior probability is the outcome of prediction.

Problem: Players will play if weather is sunny. Is this statement is correct?

Wollega University Department of Computer Science MSc Page 13


We can solve it using above discussed method of posterior probability.

P(Yes | Sunny) = P( Sunny | Yes) * P(Yes) / P (Sunny)

Here we have P (Sunny |Yes) = 3/9 = 0.33,

P(Sunny) = 5/14 = 0.36, P( Yes)= 9/14 = 0.64

Now, P (Yes | Sunny) = 0.33 * 0.64 / 0.36 = 0.60, which has higher probability.

Naive Bayes uses a similar method to predict the probability of different class based on
various attributes. This algorithm is mostly used in text classification and with problems
having multiple classes.

Now suppose we want to calculate the probability of playing when the weather is overcast.

Probability of playing:

P(Yes | Overcast) = P(Overcast | Yes)  P(Yes) / P (Overcast) .....................(1)


1. Calculate Prior Probabilities:
P(Overcast) = 4/14 = 0.29
P(Yes)= 9/14 = 0.64
2. Calculate Posterior Probabilities:
P(Overcast |Yes) = 4/9 = 0.44
3. Put Prior and Posterior probabilities in equation (1)
P (Yes | Overcast) = 0.44 * 0.64 / 0.29 = 0.98(Higher)

Similarly, you can calculate the probability of not playing:

Probability of not playing:

P(No | Overcast) = P(Overcast | No)  P(No) / P (Overcast) .....................(2)


1. Calculate Prior Probabilities:
P(Overcast) = 4/14 = 0.29
P(No)= 5/14 = 0.36
2. Calculate Posterior Probabilities:
P(Overcast |No) = 0/9 = 0
3. Put Prior and Posterior probabilities in equation (2)

Wollega University Department of Computer Science MSc Page 14


P (No | Overcast) = 0 * 0.36 / 0.29 = 0

The probability of a 'Yes' class is higher. So you can determine here if the weather is overcast
than players will play the sport.

Now suppose you want to calculate the probability of playing when the weather is overcast,
and the temperature is mild.

Probability of playing:

P(Play= Yes | Weather=Overcast, Temp=Mild) = P(Weather=Overcast, Temp=Mild |


Play= Yes)P(Play=Yes) ..........(1)

P(Weather=Overcast, Temp=Mild | Play= Yes)= P(Overcast |Yes) P(Mild |Yes) ………..(2)


1. Calculate Prior Probabilities: P(Yes)= 9/14 = 0.64
2. Calculate Posterior Probabilities: P(Overcast |Yes) = 4/9 = 0.44 P(Mild |Yes) = 4/9 =
0.44
3. Put Posterior probabilities in equation (2) P(Weather=Overcast, Temp=Mild | Play=
Yes) = 0.44 * 0.44 = 0.1936(Higher)
4. Put Prior and Posterior probabilities in equation (1) P(Play= Yes | Weather=Overcast,
Temp=Mild) = 0.1936*0.64 = 0.124

Similarly, you can calculate the probability of not playing:

Probability of not playing:

P(Play= No | Weather=Overcast, Temp=Mild) = P(Weather=Overcast, Temp=Mild | Play=


No)P(Play=No) ..........(3)

P(Weather=Overcast, Temp=Mild | Play= No)= P(Weather=Overcast |


Play=No) P(Temp=Mild | Play=No) ………..(4)
1. Calculate Prior Probabilities: P(No)= 5/14 = 0.36
2. Calculate Posterior Probabilities: P(Weather=Overcast |Play=No) = 0/9 = 0
P(Temp=Mild | Play=No)=2/5=0.4

Wollega University Department of Computer Science MSc Page 15


3. Put posterior probabilities in equation (4) P(Weather=Overcast, Temp=Mild | Play=
No) = 0 * 0.4= 0
4. Put prior and posterior probabilities in equation (3) P(Play= No | Weather=Overcast,
Temp=Mild) = 0*0.36=0

 The probability of a 'Yes' class is higher. So you can say here that if the weather is
overcast than players will play the sport.

 Second Approach (In case of multiple features)

Now suppose you want to calculate the probability of playing when the weather is overcast,
and the temperature is mild.

Probability of playing:

Wollega University Department of Computer Science MSc Page 16


P(Play= Yes | Weather=Overcast, Temp=Mild) = P(Weather=Overcast, Temp=Mild |
Play= Yes)P(Play=Yes) ..........(1)

P(Weather=Overcast, Temp=Mild | Play= Yes)= P(Overcast |Yes) P(Mild |Yes) ………..(2)


1. Calculate Prior Probabilities: P(Yes)= 9/14 = 0.64
2. Calculate Posterior Probabilities: P (Overcast |Yes) = 4/9 = 0.44 P(Mild |Yes) = 4/9 =
0.44
3. Put Posterior probabilities in equation (2) P(Weather=Overcast, Temp=Mild | Play=
Yes) = 0.44 * 0.44 = 0.1936(Higher)
4. Put Prior and Posterior probabilities in equation (1) P(Play= Yes | Weather=Overcast,
Temp=Mild) = 0.1936*0.64 = 0.124

Similarly, you can calculate the probability of not playing:

Probability of not playing:

P(Play= No | Weather=Overcast, Temp=Mild) = P(Weather=Overcast, Temp=Mild | Play=


No)P(Play=No) ..........(3)

P(Weather=Overcast, Temp=Mild | Play= No)= P(Weather=Overcast |


Play=No) P(Temp=Mild | Play=No) ………..(4)
1. Calculate Prior Probabilities: P(No)= 5/14 = 0.36
2. Calculate Posterior Probabilities: P(Weather=Overcast |Play=No) = 0/9 = 0
P(Temp=Mild | Play=No)=2/5=0.4
3. Put posterior probabilities in equation (4) P(Weather=Overcast, Temp=Mild | Play=
No) = 0 * 0.4= 0
4. Put prior and posterior probabilities in equation (3) P(Play= No | Weather=Overcast,
Temp=Mild) = 0*0.36=0

 The probability of a 'Yes' class is higher. So, you can say here that if the weather is
overcast than players will play the sport.

Wollega University Department of Computer Science MSc Page 17


5. What is Tensor flow and how is it used?

5.1. What is Tensor Flow

TensorFlow is one of the most popular open source libraries in the Machine Learning and
Deep Learning community. We see breakthroughs in diverse fields on a weekly basis and
more often than not, TensorFlow is at the heart of the final model. Open Source Python
artificial intelligence library using data flow graphs to build models. Helps to create a deep
neural network architecture. Used in language understanding, image recognition,
classification and prediction.
Since its release, the TensorFlow team has continuously worked on improving the library by
making it simpler and interactive for the users. TensorFlow Developer Summit is an event
that brings together TensorFlow users from all over the globe to see all the new products,
tools, libraries, and use cases presented by the TensorFlow team and industry leaders. In
general tensor flow is the second machine learning framework that Google created
and used to design, build, and train deep learning models.

5.2. How Tensor flow is it used

TensorFlow allows developers to create dataflow graphs—structures that describe how data


moves through a graph, or a series of processing nodes. Each node in the graph represents a

Wollega University Department of Computer Science MSc Page 18


mathematical operation, and each connection or edge between nodes is a multidimensional
data array, or tensor.

TensorFlow provides all of this for the programmer by way of the Python language. Python is
easy to learn and work with, and provides convenient ways to express how high-level
abstractions can be coupled together. Nodes and tensors in TensorFlow are Python objects,
and TensorFlow applications are themselves Python applications.

The actual math operations, however, are not performed in Python. The libraries of
transformations that are available through TensorFlow are written as high-performance C++
binaries. Python just directs traffic between the pieces, and provides high-level programming
abstractions to hook them together.

 Companies using TensorFlow

 Google  eBay
 Airbus  DeepMind
 Uber  Dropbox
 OpenAI  Snapchat
 A bunch of startups

Wollega University Department of Computer Science MSc Page 19

You might also like