15.04.2018 Views

programming-for-dummies

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Machine Learning 653<br />

With LISP, every command is also considered data that can be manipulated.<br />

So a LISP program can literally rewrite its own commands and data while it<br />

runs. Prolog works in a similar way. Basically a Prolog program consists of<br />

rules and data, so Prolog programs can modify both the rules that they<br />

follow and their data.<br />

Both languages make self-modifying programs possible <strong>for</strong> mimicking<br />

machine learning, but using an artificial intelligence language alone doesn’t<br />

make your program any smarter. Instead, programmers also need specific<br />

methods <strong>for</strong> mimicking intelligence in a computer.<br />

Bayesian probability<br />

One simple example of machine learning is based on Bayes’ theorem, after<br />

Thomas Bayes. This theorem deals with probabilities. Put into practical<br />

application, many junk e-mail (spam) filters use Bayesian filtering, which<br />

basically examines junk e-mail and compares it to valid e-mail.<br />

Based on this comparison, a spam filter based on Bayes’ theorem can gradually<br />

assign probabilities that new messages are either junk or valid messages. The<br />

more junk and valid e-mail the Bayesian filter can examine, the “smarter” it gets<br />

in recognizing and sorting e-mail into their proper categories. Essentially an<br />

anti-spam filter’s “intelligence” is stored in its growing database of characteristics<br />

that identify spam.<br />

Neural networks<br />

One problem with machine learning is organizing in<strong>for</strong>mation so that the computer<br />

can modify its own data. Although languages — like LISP and Prolog —<br />

allow self-modifying programs, computer scientists have created a way to<br />

model the human brain using ordinary data structures, such as graphs with<br />

each node mimicking a neuron in a brain. This entire connection of interlocking<br />

nodes, or mimicking neurons, is a neural network, as shown in Figure 4-2.<br />

Book VII<br />

Chapter 4<br />

Artificial<br />

Intelligence<br />

Neurons<br />

Figure 4-2:<br />

A neural<br />

network.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!