O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Python Data Science Essentials

Book Description

Become an efficient data science practitioner by thoroughly understanding the key concepts of Python

In Detail

The book starts by introducing you to setting up your essential data science toolbox. Then it will guide you across all the data munging and preprocessing phases. This will be done in a manner that explains all the core data science activities related to loading data, transforming and fixing it for analysis, as well as exploring and processing it. Finally, it will complete the overview by presenting you with the main machine learning algorithms, the graph analysis technicalities, and all the visualization instruments that can make your life easier in presenting your results.

In this walkthrough, structured as a data science project, you will always be accompanied by clear code and simplified examples to help you understand the underlying mechanics and real-world datasets.

What You Will Learn

  • Set up your data science toolbox using a Python scientific environment on Windows, Mac, and Linux

  • Get data ready for your data science project

  • Manipulate, fix, and explore data in order to solve data science problems

  • Set up an experimental pipeline to test your data science hypothesis

  • Choose the most effective and scalable learning algorithm for your data science tasks

  • Optimize your machine learning models to get the best performance

  • Explore and cluster graphs, taking advantage of interconnections and links in your data

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. Python Data Science Essentials
      1. Table of Contents
      2. Python Data Science Essentials
      3. Credits
      4. About the Authors
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. First Steps
        1. Introducing data science and Python
        2. Installing Python
          1. Python 2 or Python 3?
          2. Step-by-step installation
          3. A glance at the essential Python packages
            1. NumPy
            2. SciPy
            3. pandas
            4. Scikit-learn
            5. IPython
            6. Matplotlib
            7. Statsmodels
            8. Beautiful Soup
            9. NetworkX
            10. NLTK
            11. Gensim
            12. PyPy
          4. The installation of packages
          5. Package upgrades
        3. Scientific distributions
          1. Anaconda
          2. Enthought Canopy
          3. PythonXY
          4. WinPython
        4. Introducing IPython
          1. The IPython Notebook
          2. Datasets and code used in the book
            1. Scikit-learn toy datasets
            2. The MLdata.org public repository
            3. LIBSVM data examples
            4. Loading data directly from CSV or text files
            5. Scikit-learn sample generators
        5. Summary
      9. 2. Data Munging
        1. The data science process
        2. Data loading and preprocessing with pandas
          1. Fast and easy data loading
          2. Dealing with problematic data
          3. Dealing with big datasets
          4. Accessing other data formats
          5. Data preprocessing
          6. Data selection
        3. Working with categorical and textual data
          1. A special type of data – text
        4. Data processing with NumPy
          1. NumPy's n-dimensional array
          2. The basics of NumPy ndarray objects
        5. Creating NumPy arrays
          1. From lists to unidimensional arrays
          2. Controlling the memory size
          3. Heterogeneous lists
          4. From lists to multidimensional arrays
          5. Resizing arrays
          6. Arrays derived from NumPy functions
          7. Getting an array directly from a file
          8. Extracting data from pandas
        6. NumPy fast operation and computations
          1. Matrix operations
          2. Slicing and indexing with NumPy arrays
          3. Stacking NumPy arrays
        7. Summary
      10. 3. The Data Science Pipeline
        1. Introducing EDA
        2. Feature creation
        3. Dimensionality reduction
          1. The covariance matrix
          2. Principal Component Analysis (PCA)
          3. A variation of PCA for big data – RandomizedPCA
          4. Latent Factor Analysis (LFA)
          5. Linear Discriminant Analysis (LDA)
          6. Latent Semantical Analysis (LSA)
          7. Independent Component Analysis (ICA)
          8. Kernel PCA
          9. Restricted Boltzmann Machine (RBM)
        4. The detection and treatment of outliers
          1. Univariate outlier detection
          2. EllipticEnvelope
          3. OneClassSVM
        5. Scoring functions
          1. Multilabel classification
          2. Binary classification
          3. Regression
        6. Testing and validating
        7. Cross-validation
          1. Using cross-validation iterators
          2. Sampling and bootstrapping
        8. Hyper-parameters' optimization
          1. Building custom scoring functions
          2. Reducing the grid search runtime
        9. Feature selection
          1. Univariate selection
          2. Recursive elimination
          3. Stability and L1-based selection
        10. Summary
      11. 4. Machine Learning
        1. Linear and logistic regression
        2. Naive Bayes
        3. The k-Nearest Neighbors
        4. Advanced nonlinear algorithms
          1. SVM for classification
          2. SVM for regression
          3. Tuning SVM
        5. Ensemble strategies
          1. Pasting by random samples
          2. Bagging with weak ensembles
          3. Random Subspaces and Random Patches
          4. Sequences of models – AdaBoost
          5. Gradient tree boosting (GTB)
          6. Dealing with big data
            1. Creating some big datasets as examples
            2. Scalability with volume
            3. Keeping up with velocity
            4. Dealing with variety
            5. A quick overview of Stochastic Gradient Descent (SGD)
        6. A peek into Natural Language Processing (NLP)
          1. Word tokenization
          2. Stemming
          3. Word Tagging
          4. Named Entity Recognition (NER)
          5. Stopwords
          6. A complete data science example – text classification
        7. An overview of unsupervised learning
        8. Summary
      12. 5. Social Network Analysis
        1. Introduction to graph theory
        2. Graph algorithms
        3. Graph loading, dumping, and sampling
        4. Summary
      13. 6. Visualization
        1. Introducing the basics of matplotlib
          1. Curve plotting
          2. Using panels
          3. Scatterplots
          4. Histograms
          5. Bar graphs
          6. Image visualization
        2. Selected graphical examples with pandas
          1. Boxplots and histograms
          2. Scatterplots
          3. Parallel coordinates
        3. Advanced data learning representation
          1. Learning curves
          2. Validation curves
          3. Feature importance
          4. GBT partial dependence plot
        4. Summary
      14. Index