Supervised Machine Learning with Python by Taylor Smith
Author:Taylor Smith
Language: eng
Format: mobi
Tags: COM018000 - COMPUTERS / Data Processing, COM051360 - COMPUTERS / Programming Languages / Python, COM051300 - COMPUTERS / Programming / Algorithms
Publisher: Packt
Published: 2019-05-21T08:05:29+00:00
The information gain metric is used by CART trees in a classification
context. It measures the difference in the gini or entropy before and
after a split to determine whether the split "taught" us anything.
If you remember from the last section, uncertainty is essentially the level of impurity, or entropy, induced by the split. When we compute InformationGain using either gini or entropy, our uncertainty is going to be metric pre-split:
def __init__(self, metric):
# let fail out with a KeyError if an improper metric
self.crit = {'gini': gini_impurity,
'entropy': entropy}[metric]
If we compute uncertainty, we would pass in a node and say compute Gini, for instance, on all of the samples inside of the node before we split, and then, when we call to actually compute InformationGain, we pass in mask for whether something is going left or right. We will compute the Gini on the left and right side, and return InformationGain:
def __call__(self, target, mask, uncertainty):
"""Compute the information gain of a split.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(11904)
Hello! Python by Anthony Briggs(9379)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9347)
The Mikado Method by Ola Ellnestam Daniel Brolund(9314)
Dependency Injection in .NET by Mark Seemann(8863)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(7857)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7328)
Grails in Action by Glen Smith Peter Ledbrook(7303)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7122)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(5962)
Kotlin in Action by Dmitry Jemerov(4647)
Practical Vim (for Kathryn Amaral) by Drew Neil(3728)
Cracking the GRE Premium Edition with 6 Practice Tests, 2015 (Graduate School Test Preparation) by Princeton Review(3598)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3419)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3249)
Learning Java by Patrick Niemeyer & Daniel Leuck(2872)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(2839)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(2704)
Mastering Java 9 by Dr. Edward Lavieri(2573)