1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vinvika [58]
3 years ago
11

For this programming assignment you will implement the Naive Bayes algorithm from scratch and the functions to evaluate it with

a k-fold cross validation (also from scratch). You can use the code in the following tutorial to get started and get ideas for your implementation of the Naive Bayes algorithm but please, enhance it as much as you can (there are many things you can do to enhance it such as those mentioned at the end of the tutorial):
Computers and Technology
1 answer:
DanielleElmas [232]3 years ago
8 0

Bayes’ Theorem provides a way that we can calculate the probability of a piece of data belonging to a given class, given our prior knowledge.

P(class|data) = (P(data|class) * P(class)) / P(data)

Where P(class|data) is the probability of class given the provided data.

Explanation:

  • Naive Bayes is a classification algorithm for binary  and multiclass classification problems.
  • It is called Naive Bayes or idiot Bayes because the calculations of the probabilities for each class are simplified to make their calculations tractable.

This Naive Bayes tutorial is broken down into 5 parts:

Step 1: Separate By Class :  Calculate the probability of data by the class they belong to, the so-called base rate. Separate our training data by class.

Step 2: Summarize Dataset : The two statistics we require from a given dataset are the mean and the standard deviation

The mean is the average value and can be calculated using :

mean = sum(x)/n * count(x)

Step 3: Summarize Data By Class : Statistics from our training dataset organized by class.

Step 4: Gaussian Probability Density Function : Probability or likelihood of observing a given real-value. One way we can do this is to assume that the values are drawn from a distribution, such as a bell curve or Gaussian distribution.

Step 5: Class Probabilities :  The statistics calculated from our training data to calculate probabilities for new data.  Probabilities are calculated separately for each class. This means that we first calculate the probability that a new piece of data belongs to the first class, then calculate the second class, on for all the classes.

You might be interested in
​ A webpage gets a new modification date for all of the following EXCEPT:
riadik2000 [5.3K]

Answer:

a.  ​daily

Explanation:

A webpage gets a new modification date whenever any change is made. This is irrespective of whether the change is large or small, significant or insignificant. Any update to the webpage will change its modification date. But this change will not be carried out automatically everyday unless an actual modification is carried out on that day.Otherwise it will continue to carry the modification date corresponding to the day of last update.

4 0
3 years ago
Suppose we are sorting an array of nine integers using heapsort, and we have just finished one of the reheapifications downward.
Ilia_Sergeevich [38]

Answer:

3

Explanation:

Heap sort pick an item from the first or last position in an array and compares it with other items in other positions in the array, swapping position if they meet the condition.

The array above has three maximum items arranged sequentially in the array, this is prove that there have been 3 reheapifications in the array.

7 0
3 years ago
Assume that an int variable is Quadrilateral has been declared, and that another int variable, number Of Sides has been declared
kondor19780726 [428]

Answer:

The answer to this question can be given as:

Statement:

isQuadrilateral = (numberOfSides == 4) ? 1 : 0;

//check condition using ternary operator.

Explanation:

we know that both(Quadrilateral, numberOfSides) is already declared in the program. So the statement for check condition is (isQuadrilateral = (numberOfSides == 4) ? 1 : 0;). To check this condition we use the ternary operator. In this operator, we also check another condition. The syntax of ternary operator (condition ? value_if_true : value_if_false).In this statement on the lift side we use the variable for check condition and right side we check condition if the value is true it prints 1 else it will print 0.

4 0
3 years ago
Wikis are designed for ________, which is allowing people to contribute more than just posting a response
Viefleur [7K]

Answer:

collabirations

Explanation

Wikis are designed for collabirations, which is allowing people to contribute more than just posting a response.

4 0
3 years ago
Which one of the following UNIX utilities is purpose-built to quickly return the location (filepath) of files by querying a data
Galina-37 [17]

Answer:

a.locate

Explanation:

locate utility in Unix is used to quickly return the filepath of the file searched for.find also used to do the same work but it is not as fast as locate.

locate is faster than find because it does not read the filesystem to search the file infact it refers to the database to search the file and produces it's output and the database is created by updatedb command.

4 0
3 years ago
Other questions:
  • What type of survey can help a network administrator make decisions about bands, channels, and widths when installing new access
    9·1 answer
  • How do you ask someone for help?
    6·1 answer
  • which of these paste options is commonly available from the paste options button? A> use the destination them. B. keep the em
    14·2 answers
  • What's another word for contact print?
    15·2 answers
  • .In Python, comments begin with the comment marker and continue ______.
    14·1 answer
  • 01110100 01101000 01101001 01110011 00100000 01110011 01110101 01100011 01101011 01110011 00100000 01100010 01100001 01101100 01
    12·2 answers
  • Choose the tag required for each stated goal.
    12·1 answer
  • Will, there be any presents this year
    15·1 answer
  • The area of the spreadsheet highlighted in red is the _____.
    12·1 answer
  • In cells D6 through D8, enter formulas to calculate the values of the stocks. The formulas should multiply the number of shares
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!