{"id":262610,"date":"2026-07-13T19:09:59","date_gmt":"2026-07-13T16:09:59","guid":{"rendered":"https:\/\/1kitap1.com\/en\/hands-on-machine-learning-with-scikit-learn-keras-and-tensorflow-3rd-edition-aurelien-geron\/"},"modified":"2026-07-13T19:09:59","modified_gmt":"2026-07-13T16:09:59","slug":"hands-on-machine-learning-with-scikit-learn-keras-and-tensorflow-3rd-edition-aurelien-geron","status":"publish","type":"post","link":"https:\/\/1kitap1.com\/en\/hands-on-machine-learning-with-scikit-learn-keras-and-tensorflow-3rd-edition-aurelien-geron\/","title":{"rendered":"Hands &#8211; On Machine Learning With Scikit &#8211; Learn Keras And TensorFlow 3rd Edition &#8211; Aurelien Geron"},"content":{"rendered":"<figure style=\"text-align:center;margin:0 auto 1.5em;\"><img decoding=\"async\" src=\"https:\/\/1kitap1.com\/en\/wp-content\/uploads\/2026\/07\/16f36bec2080e1f8.jpg\" alt=\" - Unknown book cover\" style=\"max-width:300px;width:100%;height:auto;box-shadow:0 4px 12px rgba(0,0,0,.25);border-radius:4px;\"\/><\/figure>\n<p>Similarly, specifying optimizer=&#8221;sgd&#8221; is equivalent to specifying optimizer=tf.keras.optimizers.SGD(), and metrics=[&#8220;accuracy&#8221;] is equivalent to metrics= [tf.keras.metrics.sparse_categorical_accuracy] (when using this loss). We will use many other losses, optimizers, and metrics in this book; for the full lists, see https:\/\/keras.io\/api\/losses\/, https:\/\/keras.io\/api\/optimizers\/, and https:\/\/keras.io\/api\/metrics\/. This code requires some explanation. First, we use the &#8220;sparse_categorical_crossentropy&#8221; loss because we have sparse labels (i.e., for each instance, there is just a target class index, from 0 to 9 in this case), and the classes are exclusive.<\/p>\n<p>If instead we had one target probability per class for each instance (such as one-hot vectors, e.g. [0., 0., 0., 1., 0., 0., 0., 0., 0., 0.] to represent class 3), then we would need to use the &#8220;categorical_crossentropy&#8221; loss instead. If we were doing binary classification or multilabel binary classification, then we would use the &#8220;sigmoid&#8221; activation function in the output layer instead of the &#8220;softmax&#8221; activation function, and we would use the &#8220;binary_crossentropy&#8221; loss. If you want to convert sparse labels (i.e., class indices) to one-hot vector labels, use the tf.keras.utils.to_categorical() function.<\/p>\n<p>To go the other way round, use the np.argmax() function with axis=1. Regarding the optimizer, &#8220;sgd&#8221; means that we will train the model using Stochastic Gradient Descent. In other words, Keras will perform the backpropagation algorithm described earlier (i.e., reverse-mode autodiff plus Gradient Descent). We will discuss more efficient optimizers in Chapter 11. They improve Gradient Descent, not autodiff. When using the SGD optimizer, it is important to tune the learning rate. So, you will generally want to use optimizer=tf.keras.optimizers.SGD(learning_rate=???) to set the learning rate, rather than optimizer=&#8221;sgd&#8221;, which defaults to a learning rate of 0.01.<\/p>\n<p>Finally, since this is a classifier, it\u2019s useful to measure its accuracy during training and evaluation, which is why we set metrics=[&#8220;accuracy&#8221;]. Training and evaluating the model Now the model is ready to be trained. For this we simply need to call its fit() method: >>> history = model.fit(X_train, y_train, epochs=30, &#8230; validation_data=(X_valid, y_valid)) &#8230;<\/p>\n<blockquote>\n<p>With Early Release ebooks, you get books in their earliest form\u2014the author\u2019s raw and unedited content as they write\u2014so you can take advantage of these technologies long before the official release of these titles. Aur\u00e9lien G\u00e9ron OceanofPDF.com Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow by Aur\u00e9lien G\u00e9ron Copyright \u00a9 2022 Aur\u00e9lien G\u00e9ron. All rights reserved. Printed in the United States of America. Published by O\u2019Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.<\/p>\n<p>O\u2019Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http:\/\/oreilly.com). For more information, contact our corporate\/institutional sales department: 800-998-9938 or corporate@oreilly.com. Acquisitions Editor: Nicole Butterfield Development Editor: Michele Cronin Production Editor: Beth Kelly Copyeditor: Kim Cofer Proofreader: Indexer: Interior Designer: David Futato Cover Designer: Karen Montgomery Illustrator: Kate Dullea October 2022: Third Edition Revision History for the Early Release 2022-02-08: First Release 2022-03-14: Second Release 2022-04-18: Third Release 2022-06-010: Fourth Release See http:\/\/oreilly.com\/catalog\/errata.csp?isbn=9781098125974 for release details.<\/p>\n<p>The O\u2019Reilly logo is a registered trademark of O\u2019Reilly Media, Inc. Hands- On Machine Learning with Scikit-Learn, Keras, and TensorFlow, the cover image, and related trade dress are trademarks of O\u2019Reilly Media, Inc. The views expressed in this work are those of the author, and do not represent the publisher\u2019s views. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work.<\/p>\n<p>Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and\/or rights. 978-1-098-12597-4 [LSI] OceanofPDF.com Preface The Machine Learning Tsunami In 2006, Geoffrey Hinton et al.<\/p>\n<p>published a paper\u2060 showing how to train a deep neural network capable of recognizing handwritten digits with state- of-the-art precision (>98%). They branded this technique \u201cDeep Learning.\u201d A deep neural network is a (very) simplified model of our cerebral cortex, composed of a stack of layers of artificial neurons. Training a deep neural net was widely considered impossible at the time,\u2060 and most researchers had abandoned the idea in the late 1990s. This paper revived the interest of the scientific community, and before long many new papers demonstrated that Deep Learning was not only possible, but capable of mind-blowing achievements that no other Machine Learning (ML) technique could hope to match (with the help of tremendous computing power and great amounts of data).<\/p>\n<\/blockquote>\n<p><em>This is a short excerpt from the opening of &ldquo;&rdquo; by Unknown, quoted for review and introduction purposes. All rights belong to the copyright holders.<\/em><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/1kitap1.com\/en\/hands-on-machine-learning-with-scikit-learn-keras-and-tensorflow-3rd-edition-aurelien-geron\/#Book_Information\" >Book Information<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/1kitap1.com\/en\/hands-on-machine-learning-with-scikit-learn-keras-and-tensorflow-3rd-edition-aurelien-geron\/#Reading_Word_Statistics\" >Reading &amp; Word Statistics<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/1kitap1.com\/en\/hands-on-machine-learning-with-scikit-learn-keras-and-tensorflow-3rd-edition-aurelien-geron\/#Most_Frequent_Words\" >Most Frequent Words<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/1kitap1.com\/en\/hands-on-machine-learning-with-scikit-learn-keras-and-tensorflow-3rd-edition-aurelien-geron\/#PDF_Download\" >PDF Download<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Book_Information\"><\/span>Book Information<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Unique ID:<\/strong> 16f36bec2080e1f8<\/li>\n<li><strong>File Extension:<\/strong> .pdf<\/li>\n<li><strong>File Size:<\/strong> 88,144,516 bytes (84.061 MB)<\/li>\n<li><strong>Title:<\/strong> &#8211;<\/li>\n<li><strong>Author:<\/strong> Unknown<\/li>\n<li><strong>ISBN:<\/strong> 9781098125974<\/li>\n<li><strong>Pages:<\/strong> 1215<\/li>\n<li><strong>Language:<\/strong> English (en)<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Reading_Word_Statistics\"><\/span>Reading &amp; Word Statistics<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Estimated Reading Time:<\/strong> 1289.68 minutes<\/li>\n<li><strong>Total Words:<\/strong> 257,936<\/li>\n<li><strong>Total Characters:<\/strong> 1,639,116<\/li>\n<li><strong>Average Words per Page:<\/strong> 212.29<\/li>\n<li><strong>Average Characters per Page:<\/strong> 1349.07<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Most_Frequent_Words\"><\/span>Most Frequent Words<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>model (2013), training (1257), layer (1048), use (979), data (973), set (932), using (896), keras (888), layers (868), function (858), learning (811), train (802), one (743), figure (719), example (697), see (615), dataset (584), time (563), also (557), output (539), first (522), input (496), let\u2019s (491), get (487), chapter (456), number (450), need (445), class (433), batch (421), called (417), want (403), now (402), like (395), size (384), two (379), make (376), images (375), random (373), much (372), algorithm (366), neural (360), inputs (360), step (358), test (356), image (355), new (353), instances (353), models (352), loss (348), activation (346), shape (344), features (340), value (336), used (335), many (333), feature (333), values (324), method (324), well (311), since (304), code (303), network (303), array (302), dense (300), tensorflow (297), state (288), equation (288), fit (287), mean (285), outputs (281), machine (279), next (278), look (276), instead (273), different (273), tensor (270), predictions (267), create (264), instance (259), large (252), gradient (252), right (252), good (251), rate (251), weights (251), true (248), possible (244), linear (241), name (240), regression (239), it\u2019s (239), deep (237), import (234), add (232), even (230), note (228), predict (218), way (216), dtype (213), better (212).<\/p>\n<h2><span class=\"ez-toc-section\" id=\"PDF_Download\"><\/span>PDF Download<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align:center;\"><a href=\"https:\/\/1kitap1.com\/en\/wp-content\/uploads\/2026\/07\/hands-on-machine-learning-with-scikit-learn-keras-and-tensorflow-3rd-edition-aurelien-geron.pdf\" download rel=\"nofollow\" style=\"display:inline-block;background:#2271b1;color:#ffffff;padding:14px 36px;border-radius:6px;text-decoration:none;font-weight:bold;font-size:1.05em;\">&#11015;&#65039; PDF Download<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Similarly, specifying optimizer=&#8221;sgd&#8221; is equivalent to specifying optimizer=tf.keras.optimizers.SGD(), and metrics=[&#8220;accuracy&#8221;] is equivalent to metrics= [tf.keras.metrics.sparse_categorical_accuracy] (when using this loss). We will use many other losses, optimizers, and metrics in this book; for the full lists, see https:\/\/keras.io\/api\/losses\/, https:\/\/keras.io\/api\/optimizers\/, and https:\/\/keras.io\/api\/metrics\/. This code requires some explanation. First, we use the &#8220;sparse_categorical_crossentropy&#8221; loss because we have sparse [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":262608,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-262610","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-english"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/posts\/262610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/comments?post=262610"}],"version-history":[{"count":0,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/posts\/262610\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/media\/262608"}],"wp:attachment":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/media?parent=262610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/categories?post=262610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/tags?post=262610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}