Select your font size 
 
about us products & services consulting & support news & events contact us
Paul Meagher explains the meaning of a positive cancer test result, and in so doing he shows how to calculate conditional probability.

Learning from experience - Nunavut

print this article 
 

To appreciate how the getConditionalProbabiltity function might be used in practice, consider a doctor confronted with the problem of determining whether a patient has cancer given that the patient tested positive on some cancer test. The test could be something as simple as a "yes" or "no" answer to a question (such as, were you ever exposed to high levels of radiation?) or it could be the result of a physical examination of the patient.

To compute the conditional probability of cancer given a positive test result, the doctor might tally the number of past cases where cancer and a positive test result occurred together and divide by the overall number of positive test results. The following code computes this probability based on a total of four past cases where this co-variation information was collected -- perhaps from the doctor's personal experiences with this particular cancer test.

Listing 2. Computing a conditional probability using getConditionalProbabiltity

<?php 
require "getConditionalProbability.php"; 

/** 
* The elements of the $Data array use this coding convention: 
* +cancer - patient has cancer 
* -cancer - patient does not have cancer 
* +test - patient tested positive on cancer test 
* -test - patient tested negative on cancer test 
**/ 

$Data[0] = array("+cancer", "+test"); 
$Data[1] = array("-cancer", "-test"); 
$Data[2] = array("+cancer", "+test"); 
$Data[3] = array("-cancer", "+test");

// specify query variable $A and conditioning variable $B 
$A = "+cancer"; $B = "+test"; 

// compute the conditional probability of having cancer given 1) 
// a positive test and 2) a sample of covariation data 
$probability = getConditionalProbabilty($A, $B, $Data); 
echo "P($A|$B) = $probability"; 
// P(+cancer|+test) = 0.66666666666667 

?>

As you can see, the probability of having cancer given:

  1. A positive test result
  2. The data collected to date

is estimated at 67 percent. In other words, in the next 100 cases where a patient tests positive, the best point estimate is that in 67 of those cases, the patient will actually have cancer. The doctor will need to weight this probability along with other information to arrive at a final diagnosis if one is warranted.

I can summarize what has been demonstrated here in more radical terms as follows:

An agent that derives a conditional probability estimate using the enumeration method appears to learn from experience and will provide an optimal estimate of the true conditional probability if it has enough representative data to draw upon.

If I replace the hypothetical doctor with a software agent implementing the enumeration algorithm above and being fed a steady diet of the case data, I might expect the agent's conditional probability estimates to become increasingly more reliable and accurate. I might say that such an agent is capable of "learning from experience."

If this is so, perhaps I want to ask what the relationship is between this simple enumeration technique for computing a conditional probability and more legitimate examples of "learning from experience," such as the semi-automated classification of spam using Bayes methods. In the next section, I will show a simple spam filter can be constructed using the enumerative power of a database.



Page:   1  2  3  4  5  6  7  8  9  10  11 Next Page: Conditional probability and SQL

The content shown in this page was first published by IBM developerWorks and is reprinted with permission from Paul Meagher (www.datavore.com)


Most Recent Website and Regional Updates

 Emergency Management Services
The prototypical emergency involves a shutdown of essential services for a finite period of time. What will your organization do when a world-wide financial crisis strikes?

 
 High Scalability - Large Systems Optimization
Transparen Corporation lends its expertise to clients experiencing rapid and sudden growth in traffic or server utilization, bottlenecks, systems instability, downtime during peak traffic, or which would like to plan to avoid such issues.

 
 Fast RAID Server Data Recovery Service
Transparen's Vancouver International Response Team provides the option in Canada and USA to get a raid server back running in hours - eliminating costly waiting associated with typical RAID recoveries.

 
 Data Recovery Service
Have you deleted a mission critical file? Accidentally dropped a computer, or formatted a hard drive? No recent backup? Mistakes can happen, but the data might still be there.

 
 About Transparen
Transparen is committed to serving its clients.

 
 Research Tools
Measure human resource allocation and collect data with the goal of determining patterns that will bring forward actionable insights which may lead to policy changes, saving money and improving quality of service.

 
 Process Evaluation Questions
Questions to help focus discussion about process improvement

 
 Operations Research
Operations Research (frequently called OR), is the methodical study of how to do things better. It is also called Optimization Theory.

 
 Our Role in Operations Optimization
Meet objectives more efficiently by improving operational effectiveness and profitability.

 
 Monte Carlo Method
Short description of the Monte Carlo Method in optimization theory.

 
 01/12/2008: The Big Three & the Future of the Auto Industry
One way or another, the Big Three automakers will have a huge impact on Windsor's future. But the future of those companies is being decided by forces well beyond this city's borders.

 
 28/11/2008: Greenpeace and the DRC
For more than a decade, the Democratic Republic of Congo has seen one humanitarian disaster after another. But there's an environmental catastrophe as well. And Greenpeace thinks it deserves our attention too.

 
 27/11/2008: The Agony of Stephen Harper
Stephen Harper got into politics to make government smaller. Now he's facing an economic crisis that seems to cry out for big time public intervention.

 
 26/11/2008: Albino Killings in Tanzania
A horrifying story of an underground trade in human body parts, one that allegedly targets albinos in Tanzania and is said to be fueled by witchdoctors.

 
 25/11/2008: Cyber Crime and Bullying
Today on the podcast, the tragic story of a young life cut short that shows there's nothing virtual about on-line bullying. Find out how social networking web sites are being used to promote bullying and hate and why some people think our real world laws are failing to keep up with these kinds of cyber crimes.

 

Google
 
Web transparen.com

Contact Information

Related Information

 
   
 
E C M | © 2003-2007 Transparen Corp.      

Standardized Services: Data Recovery Service / Creative Services / Premium Web Hosting Services / System Administration Tech Support Services
Recent Projects: Full-Service Mortgage and Financing Company / System to manage flights from Vancouver to Tofino / Photo exchange verification service
Our Vancouver BC Server Proudly Hosts: automated parking and revenue control systems, leafside lane at southlands, cost effective alternative power sources, Higher Grade Learning Centres, pacific forage bag supply, sunburst medical, neosonic design, roger mahler photography - passionate, intriguing, desirable, the connection between east and west, affordable flights to victoria and tofino, low interest mortgage brokers in vancouver, richmond, surrey, toronto, Toronto Calgary and Vancouver IT staffing and talent search
Arctic Bay, Arviat, Baker Lake, Bathurst Inlet, Cambridge Bay, Cape Dorset, Chesterfield Inlet, Clyde River, Coral Harbour, Gjoa Haven, Grise Fiord, Hall Beach, Igloolik, Iqaluit, Frobisher Bay, Kimmirut, Lake Harbour, Kugaaruk, Pelly Bay, Kugluktuk, Coppermine, Pangnirtung, Pond Inlet, Qikiqtarjuaq, Rankin Inlet, Repulse Bay, Resolute, Sanikiluaq, Taloyoak, Spence Bay, Whale Cove, * Bernard Harbour (PIN-C), on the mainland * Bray Island (FOX-A) * Brevoort Island (BAF-3) * Broughton Island (FOX-5) * Byron Bay (PIN-4) * Cambridge Bay (CAM-MAIN) * Cape Dyer (DYE-MAIN), on Baffin Island * Cape Hooper (FOX-4) * Cape Mcloughlin (CAM-5A) * Cape Mercy (BAF-2) * Cape Peel West (PIN-EB) * Cape Young (PIN-2) * Clifton Point (PIN-B) * Clinton Point (PIN-1) * Croker River (PIN 1BG) * Dewar Lakes (FOX-3) * Durban Island (FOX-E) * Edinburgh Island (PIN-DA) * Ekalugad (FOX-C) * Gjoa Haven (CAM-CB) * Gladman Point (CAM-2) * Hall Beach (FOX.MAIN) * Harding River (PIN-2A) * Hat Island (CAM-B) * Jenny Lind Island (CAM-1) * Kangok Fjord (FOX-CA) * Keats Point (PIN-1BD) * Keith Bay (CAM-E) * Kivitoo, (FOX-D) * Lady Franklin Point (PIN-3) * Lailor River (CAM-FA) * Loks Land (BAF-4A) * Longstaff Bluff (FOX-2) * Mackar Inlet (CAM-5) * Matheson Point (CAM-C) * Nudluardjuk Lake (FOX-B) * Pelly Bay (CAM-4) * Resolution Island (BAF-5) * Ross Point (PIN-D) * Rowley Island (FOX-1) * Scarpa Lake (CAM-F) * Shepherd Bay (CAM-3) * Simpson Lake (CAM-D) * Sturt Point (CAM-A3A) * Alert * Ennadai, at Ennadai Lake * Eureka, on Ellesmere Island * Fox Five * Isachsen, on Ellef Ringnes Island * Jericho Diamond Mine * Little Cornwallis Island * Lupin Mine * Nanisivik (), on Baffin Island * Craig Harbour, on Ellesmere Island * Dundas Harbour, on Devon Island * Nuwata, on Baffin Island * Padlei, on the mainland * Tavani, on the mainland * Umingmaktok (Umingmaktuuq , formerly Bay Chimo), on the mainland * Wager Bay, (Ukkusiksalik ) on the mainland