ebook img

JavaScript for data science PDF

245 Pages·2020·13.142 MB·English
by  GansMayaHodgesTobyWilsonGreg
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview JavaScript for data science

JavaScript for Data Science Chapman & Hall/CRC Data Science Series About the Series Reflecting the interdisciplinary nature of the field, this new book series brings together researchers, practitioners, and instructors from statistics, computer science, machine learn- ing, and analytics. The series will publish cutting-edge research, industry applications, and textbooks in data science. Features: • Presents the latest research and applications in the field, including new statistical and com- putational techniques • Covers a broad range of interdisciplinary topics • Provides guidance on the use of software for data science, including R, Python, and Julia • Includes both introductory and advanced material for students and professionals • Presents concepts while assuming minimal theoretical background The scope of the series is broad, including titles in machine learning, pattern recognition, predictive analytics, business analytics, visualization, programming, software, learning analyt- ics, data collection and wrangling, interactive graphics, reproducible research, and more. The inclusion of examples, applications, and code implementation is essential. JavaScript for Data Science Maya Gans, Toby Hodges, Greg Wilson Basketball Data Science: With Applications in R Paola Zuccolotto, Marica Manisera Cybersecurity Analytics Rakesh M. Verma, David J. Marchette Introduction to Data Science: Data Analysis and Prediction Algorithms with R Rafael A. Irizarry Feature Engineering and Selection: A Practical Approach for Predictive Models Max Kuhn, Kjell Johnson Probability and Statistics for Data Science: Math + R + Data Norman Matloff JavaScript for Data Science Maya Gans Toby Hodges Greg Wilson CRC Press Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 © 2020 by Taylor & Francis Group, LLC CRC Press is an imprint of Taylor & Francis Group, an Informa business No claim to original U.S. Government works Printed on acid-free paper International Standard Book Number-13: 978-0-367-42248-6 (Paperback) International Standard Book Number-13: 978-0-367-42652-1 (Hardback) This book contains information obtained from authentic and highly regarded sources. Reason- able efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www. copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organiza- tion that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com Dedication For Jordan who taught me failures pave the way to success. — Maya For Oskar. — Toby For Kara, Claudia, Erin, Gabriela, Hannah, Laura, and Julia. — Greg All royalties from the sale of this book are being donated to R-Ladies, a worldwide organization whose mission is to promote gender diversity in the R community. Contents Chapter 1 Introduction .....................................................................................1 1.1 WhoYouAre..........................................................................1 1.2 Who We Are ...........................................................................2 1.3 Setting Up...............................................................................3 1.4 Contributing............................................................................3 1.4.1 Acknowledgments......................................................4 1.5 Exercises.................................................................................4 Chapter 2 Basic Features..................................................................................5 2.1 Hello, World............................................................................5 2.2 Basic Data Types ....................................................................5 2.3 Control Flow...........................................................................7 2.4 Formatting Strings ..................................................................8 2.5 Objects....................................................................................8 2.6 Functions...............................................................................10 2.7 Modules ................................................................................12 2.8 Exercises...............................................................................13 Chapter 3 Callbacks .......................................................................................19 3.1 The Call Stack.......................................................................19 3.2 Functions of Functions .........................................................20 3.3 Anonymous Functions..........................................................24 3.4 Functional Programming......................................................25 3.5 Closures ................................................................................27 3.6 Exercises...............................................................................30 Chapter 4 Objectsand Classes.......................................................................33 4.1 Doing It By Hand..................................................................33 4.2 Classes ..................................................................................34 4.3 Inheritance ............................................................................36 4.4 Exercises...............................................................................38 Chapter 5 HTML and CSS.............................................................................43 5.1 Formatting.............................................................................43 5.2 Text .......................................................................................43 5.3 Pages.....................................................................................44 5.4 Attributes ..............................................................................45 vii viii Contents 5.5 Lists.......................................................................................46 5.6 Tables....................................................................................47 5.7 Links.....................................................................................47 5.8 Images...................................................................................48 5.9 Cascading Style Sheets.........................................................49 5.10 Bootstrap...............................................................................51 5.11 Exercises...............................................................................53 Chapter 6 Manipulating Pages .......................................................................55 6.1 Counting Paragraphs.............................................................55 6.2 Creating a Table of Contents ................................................57 6.3 Sortable Lists........................................................................59 6.4 Bibliographic Citations.........................................................62 6.5 A Real-time Clock................................................................66 6.6 Exercises...............................................................................67 Chapter 7 Dynamic Pages..............................................................................69 7.1 Hello, World..........................................................................69 7.2 JSX........................................................................................71 7.3 Creating Components ...........................................................72 7.4 Developing with Parcel.........................................................73 7.5 Multiple Files........................................................................75 7.6 Exercises...............................................................................77 Chapter 8 Visualizing Data ............................................................................79 8.1 Vega-Lite...............................................................................79 8.2 Local Installation..................................................................83 8.3 Exercises...............................................................................84 Chapter 9 Promises ........................................................................................87 9.1 The Execution Queue ...........................................................87 9.2 Promises................................................................................90 9.3 Using Promises.....................................................................94 9.4 async and await..................................................................97 9.5 Exercises...............................................................................98 Chapter 10 Interactive Sites ...........................................................................103 10.1 But It Doesn’t Work............................................................104 10.2 Models and Views...............................................................107 10.3 Fetching Data......................................................................110 10.4 Exercises.............................................................................115 Contents ix Chapter 11 Managing Data ............................................................................117 11.1 Data Formats.......................................................................117 11.2 Slicing Data ........................................................................118 11.3 Data Manager......................................................................119 11.4 Exercises.............................................................................122 Chapter 12 Creating aServer.........................................................................125 12.1 HTTP ..................................................................................125 12.2 Hello, Express.....................................................................127 12.3 HandlingMultiplePaths.....................................................128 12.4 Serving Files from Disk......................................................129 12.5 ContentTypes.....................................................................131 12.6 Exercises.............................................................................132 Chapter 13 Testing .........................................................................................133 13.1 Introducing Mocha..............................................................133 13.2 Refactoring .........................................................................134 13.3 Testing the Server ...............................................................135 13.4 Checking the HTML...........................................................138 13.5 Exercises.............................................................................139 Chapter 14 Using Data-Forge ........................................................................141 14.1 Basic Operations.................................................................142 14.2 Doing Calculations .............................................................144 14.3 Subsets................................................................................148 14.4 Aggregation ........................................................................150 14.5 In Real Life.........................................................................152 14.6 Exercises.............................................................................155 Chapter 15 Capstone Project..........................................................................157 15.1 Data Manager......................................................................157 15.2 Server..................................................................................160 15.3 API......................................................................................161 15.4 The Display.........................................................................162 15.5 The Tables...........................................................................165 15.6 TheChart............................................................................167 15.7 RunningIt...........................................................................168 15.8 Exercises.............................................................................171 Chapter 16 Finale...........................................................................................173 Bibliography .........................................................................................................175

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.