Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Practical Data Science with Python

You're reading from   Practical Data Science with Python Learn tools and techniques from hands-on examples to extract insights from data

Arrow left icon
Product type Paperback
Published in Sep 2021
Publisher Packt
ISBN-13 9781801071970
Length 620 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Nathan George Nathan George
Author Profile Icon Nathan George
Nathan George
Arrow right icon
View More author details
Toc

Table of Contents (30) Chapters Close

Preface 1. Part I - An Introduction and the Basics
2. Introduction to Data Science FREE CHAPTER 3. Getting Started with Python 4. Part II - Dealing with Data
5. SQL and Built-in File Handling Modules in Python 6. Loading and Wrangling Data with Pandas and NumPy 7. Exploratory Data Analysis and Visualization 8. Data Wrangling Documents and Spreadsheets 9. Web Scraping 10. Part III - Statistics for Data Science
11. Probability, Distributions, and Sampling 12. Statistical Testing for Data Science 13. Part IV - Machine Learning
14. Preparing Data for Machine Learning: Feature Selection, Feature Engineering, and Dimensionality Reduction 15. Machine Learning for Classification 16. Evaluating Machine Learning Classification Models and Sampling for Classification 17. Machine Learning with Regression 18. Optimizing Models and Using AutoML 19. Tree-Based Machine Learning Models 20. Support Vector Machine (SVM) Machine Learning Models 21. Part V - Text Analysis and Reporting
22. Clustering with Machine Learning 23. Working with Text 24. Part VI - Wrapping Up
25. Data Storytelling and Automated Reporting/Dashboarding 26. Ethics and Privacy 27. Staying Up to Date and the Future of Data Science 28. Other Books You May Enjoy
29. Index

What this book covers

Part I, An Introduction and the Basics

Chapter 1, Introduction to Data Science, gives an overview of data science, including the history, top skills and tools used in the field, specializations and related fields, and best practices for data science projects.

Chapter 2, Getting Started with Python, explains installing Python and Python distributions (specifically, Anaconda), editing and running code with code editors, IPython, Jupyter Notebooks, basic use of the command line, installing Python packages and using virtual environments, Python programming basics, how to deal with errors and use documentation, and software engineering best practices (including Git and GitHub).

Part II, Dealing with Data

Chapter 3, SQL and Built-In File Handling Modules in Python, covers loading data from ordinary text files using built-in Python capabilities, using Python's built-in sqlite3 module for databases, basic SQL commands, and the SQLAlchemy package in Python.

Chapter 4, Loading and Wrangling Data with Pandas and NumPy, explains how to use the pandas and NumPy packages in Python. Using pandas, we learn how to load and save data with several different data source types (CSV, Excel files, and so on), how to carry out some basic exploratory data analysis (EDA), how to prepare and clean data for later use, and some essential data wrangling tools with pandas and NumPy. We also learn how pandas uses NumPy and a few NumPy basics.

Chapter 5, Exploratory Data Analysis and Visualization, covers EDA and visualization packages in Python, such as pandas-profiling, seaborn, plotly, and more. We also cover visualization best practices.

Chapter 6, Data Wrangling Documents and Spreadsheets, shows how to use Python packages to load data from Microsoft Word and PDF documents, along with some basic preparation, cleaning, and analysis of text data. We also cover reading, writing, and extracting data from Microsoft Excel files.

Chapter 7, Web Scraping, demonstrates the basics of web scraping with base Python and Python packages. We learn about the basic structure of the internet and web pages, and how to parse web pages. Use of web application programming interfaces (APIs) is also covered. Finally, we wrap up with the ethics and legality of web scraping.

Part III, Statistics for Data Science

Chapter 8, Probability, Distributions, and Sampling, explains foundational probability concepts, common probability distributions in data science, and useful sampling techniques for data science.

Chapter 9, Statistical Testing for Data Science, covers some useful statistical tests, such as t- and z-tests, ANOVA and post-hoc tests, distribution testing, outlier testing, and testing for relationships between variables.

Part IV, Machine Learning

Chapter 10, Preparing Data for Machine Learning: Feature Selection, Feature Engineering, and Dimensionality Reduction, explains feature selection methods, including univariate statistical methods, such as correlation, mutual information score, chi-squared, and other feature selection methods. We also cover feature engineering methods for categorical, datetime, and outlier data. Mathematical transformations for feature transformation such as Yeo-Johnson are covered as well. Finally, dimensionality reduction using principal component analysis (PCA) is covered, and other options for dimensionality reduction are presented.

Chapter 11, Machine Learning for Classification, covers using Python for machine learning classification algorithms, including binary, multi-class, and multi-label classification. The algorithms covered include logistic regression, Naïve Bayes, and k-nearest neighbors (KNN).

Chapter 12, Evaluating Machine Learning Classification Models and Sampling for Classification, is about performance metrics for classification, such as accuracy, Cohen's Kappa, confusion matrices, and more. We also cover sampling imbalanced data to improve machine learning classification performance.

Chapter 13, Machine Learning with Regression, covers implementing and interpreting linear regression with the scikit-learn and statsmodels Python packages, as well as regularization of linear regression models. KNN and other models are also covered. Evaluation of regression models with metrics such as the coefficient of determination (R2) and information criteria (such as the Akaike information criterion, AIC) is covered as well.

Chapter 14, Optimizing Models and Using AutoML, demonstrates hyperparameter optimization for ML models using random, grid, and Bayesian searches. The various packages in Python for optimizing models are discussed. We learn how to use learning curves to optimize the amount of data for an ML model. Optimizing the number of features using recursive feature selection is covered. Finally, we cover some different options for AutoML in Python and learn how to use the pycaret AutoML package.

Chapter 15, Tree-Based Machine Learning Models, explains how trees work in ML algorithms, and we learn how to use some of the most advanced tree-based ML models, including random forests, XGBoost, LightGBM, and CatBoost. We also cover feature importances from tree-based methods.

Chapter 16, Support Vector Machine (SVM) Machine Learning Models, covers the basic theory behind SVMs and how to use them for classification and regression in Python as well as tuning SVM hyperparameters.

Part V, Text Analysis and Reporting

Chapter 17, Clustering with Machine Learning, explains the theory and use of some common clustering algorithms for unsupervised learning: k-means clustering, DBSCAN, and hierarchical clustering. We also look at what other options exist for clustering.

Chapter 18, Working with Text, covers the basics of text analysis and natural language processing (NLP). We start with pre-processing and cleaning of text, then cover basic analysis and statistical methods for text. Then we cover unsupervised learning for text, including topic modeling. We also cover supervised learning for classification with text, and finally, sentiment analysis.

Part VI, Wrapping Up

Chapter 19, Data Storytelling and Automated Reporting/Dashboarding, explains how to string together our analysis and data into a captivating story, and best practices for communicating data and results of data science work. We also learn about dashboarding to display our analysis for monitoring results and how to use the streamlit package in Python to create a dashboard.

Chapter 20, Ethics and Privacy, covers the ethical and privacy concerns in data science, including bias in machine learning algorithms, data privacy concerns in data preparation and analysis, data privacy laws and regulations, and using data science for the common good. We cover k-anonymity, l-diversity, and t-closeness to measure the level of privacy in datasets along with an example.

Chapter 21, Staying Up to Date and the Future of Data Science, discusses ways to keep on top of the ever-changing field of data science, and suggests some resources for staying up to date. We also briefly discuss some of the topics we didn't cover in the book and talk about where the future of data science might be going.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image