download (1)

pdf

School

Georgia Institute Of Technology *

*We aren’t endorsed by this school

Course

7367

Subject

Philosophy

Date

Dec 6, 2023

Type

pdf

Pages

4

Uploaded by KevinYoung0507

Report
Mini Project 4 - Monster Identification Atabongnkeng Atabong aatabong 3 @gatech.edu 1 INTRODUCTION This paper discusses an agent I created to define a monster species, based on a sample set of positive and examples, which then uses that definition to classify whether a new monster is part of that species or not. I use a mathematical approach, the Naive Bayes algorithm, to create my classifier which successfully classifies new monsters given a sample set. 2 AGENT DESCRIPTION 2 . 1 How does your agent work? My agent is a classifier, built using the Naive Bayes technique. This technique determines the probability of an event, based on prior knowledge of conditions related to that event (Joyce, 2021 ). For this project, I have implemented this clas- sifier to determine the likelihood of a new monster being part of the monster species, based on prior probability calculations made with the provided sample set. 2 . 2 Attribute/Value conditional probability First, my agent calculates the conditional probability of all possible values for each monster attribute(size, color, covering, etc) which are part of the sample set, given the 2 possible outcomes of whether the monster is or is not part of the species. For example, take this sample ({’size’: ’huge’, ’color’: ’black’, ..., ’has-tail’: True}, True) from our training set, then my agent calculates: the probability that size is huge given that a monster is part of the species, the probability that size is huge given a monster is not part of the species, the probability that color is black given that a monster is (and is not) part of the species, the probability that has tail is true given that a monster is (and is not) parts of the species, and so on and so forth, for all attributes and possible values from the sample set. The formula is: P(attribute_value|true) = n_true / count_true 1
P(attribute_value|false) = n_false / count_false where n_true is the number of monsters in the sample with this attribute value that are part of the species, and count_true is the number of monsters in the sample set that are part of the species. And likewise for false outcome. 2 . 3 Probability for values not in training set Now, when a new monster is brought to test, we reference these calculated probabilities querying for all attributes/values this new monster has. If we come across a value that is not part of the training set, say size:tiny, then the probability of size being tiny given that a monsters is or is not part of the species will be 0 , since by the formula above n_true=0 . To handle this, I implemented a modified probability calculator of the formula above which relies on an alpha value to calculate the probability of an attribute and value, given an outcome as: P(attribute_value|true) = n_true + alpha / count_true + num_att * alpha where n_true and count_true are as before, num_att is the total number of attributes in our model, 12 , and alpha is 1 . Same formula for false outcome. I determined my alpha value by starting out small, testing a couple values, and finding out that 1 was indeed a good value that classified appropriately. This technique to incorporate and alpha value in conditional probability calculation is known as Laplace smoothing. 2 . 4 Prior Probability Calculation My agent also calculates the 2 probabilities of whether a monster is part of the species and whether it is not part of the species, by using the count of positive and negative examples in the sample. This formula is simply: P(true) = count_true/sample_size P(false) = count_false/sample_size . 2 . 5 Final prediction - Posterior Probability At this point, my classifier has all the probabilities needed to makes its predic- tion. It calculates the probability that the new monster is and is not part of the specicies by caculating the posterior probability for both outcomes and choosing the outcome with the higher probability. The formula is as follows: 2
P(true|newMon) = P(true) * P(att_val_i|true) * ...* P(att_val_j|true) P(false|newMon) = P(false) * P(att_val_i|false) * ... * P(att_val_j|false) for all possible i-j attribute and value pairs. 3 AGENT PERFORMANCE 3 . 1 How well does your agent perform? Does it struggle on any particular cases? My agent performs remarkably well and is able to solve all questions on Grade- scope, on first submission. Utilizing a probabilistic classifier is very efficient as it merely computes a bunch of probabilities and uses this information to choose whether a monster is part of the species or not. I found no cases where my agent struggled to classify a monster. As the number of labeled monsters grow, my agent will have to process more samples, as part of the prior knowledge and classification model but this does not affect performance in any significant way. I believe my agents approach to utilize the Naive Bayes algorithm to build a classifier from the sample set is a clever approach, as it simplifies our problem down to a matter of statistics and probabilities. 4 AGENT VS HUMAN 4 . 1 How does your agent compare to a human? Do you feel people approach the problem similarly? I think my agent differs heavily from what the average human would do. Because my agent is essentially a classification model, I don’t think this is how people would approach this problem, myself included. My first thought was not to build a Bayes classifier, but to instead build an ICL model or decision tree built from the different attributes of the positive and negative examples. I think this is the approach people would use, as opposed to a statistics approach, because that approach is more visual. I do think people with background knowledge on clas- sification models or familiarity with conditional probability might immediately see the problem and know its a good fit for a Naive Bayes classifier. But for the average person, I think my agents approach will differ completely from theirs. 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
5 REFERENCES [ 1 ] Joyce, James ( 2021 ). “Bayes’ Theorem”. In: The Stanford Encyclopedia of Phi- losophy . Ed. by Edward N. Zalta. Metaphysics Research Lab, Stanford Uni- versity. 4