Book Image

Mastering Python for Data Science

By : Samir Madhavan
Book Image

Mastering Python for Data Science

By: Samir Madhavan

Overview of this book

Table of Contents (19 chapters)
Mastering Python for Data Science
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
7
Estimating the Likelihood of Events
Index

Decision trees


A simple predictive model maps the outcomes of an item to the input data. It is a popular predictive modeling technique, which is used commonly in the industry:

Decision tree models are basically of two types:

  • Classification trees: These refer to dependent variables that take a finite value. In these tree structures, branches represent the rules of the features that lead to the class labels, and leaves represent the class labels of the outcome.

  • Regression trees: When dependent variables takes continuous values, then they're called regression trees.

Let's take an example. The following data represents whether you should play tennis or not, based on the overall outlook of weather, humidity, and wind intensity:

Play

Wind

Humidity

Outlook

No

Low

High

Sunny

No

High

Normal

Rain

Yes

Low

High

Overcast

Yes

Weak

Normal

Rain

Yes

Low

Normal

Sunny

Yes

Low

Normal

Overcast

Yes

High

Normal

Sunny

If you take...