Mastering Numerical Computing with NumPy

Book description

Enhance the power of NumPy and start boosting your scientific computing capabilities

About This Book
  • Grasp all aspects of numerical computing and understand NumPy
  • Explore examples to learn exploratory data analysis (EDA), regression, and clustering
  • Access NumPy libraries and use performance benchmarking to select the right tool
Who This Book Is For

Mastering Numerical Computing with NumPy is for you if you are a Python programmer, data analyst, data engineer, or a data science enthusiast, who wants to master the intricacies of NumPy and build solutions for your numeric and scientific computational problems. You are expected to have familiarity with mathematics to get the most out of this book.

What You Will Learn
  • Perform vector and matrix operations using NumPy
  • Perform exploratory data analysis (EDA) on US housing data
  • Develop a predictive model using simple and multiple linear regression
  • Understand unsupervised learning and clustering algorithms with practical use cases
  • Write better NumPy code and implement the algorithms from scratch
  • Perform benchmark tests to choose the best configuration for your system
In Detail

NumPy is one of the most important scientific computing libraries available for Python. Mastering Numerical Computing with NumPy teaches you how to achieve expert level competency to perform complex operations, with in-depth coverage of advanced concepts.

Beginning with NumPy's arrays and functions, you will familiarize yourself with linear algebra concepts to perform vector and matrix math operations. You will thoroughly understand and practice data processing, exploratory data analysis (EDA), and predictive modeling. You will then move on to working on practical examples which will teach you how to use NumPy statistics in order to explore US housing data and develop a predictive model using simple and multiple linear regression techniques. Once you have got to grips with the basics, you will explore unsupervised learning and clustering algorithms, followed by understanding how to write better NumPy code while keeping advanced considerations in mind. The book also demonstrates the use of different high-performance numerical computing libraries and their relationship with NumPy. You will study how to benchmark the performance of different configurations and choose the best for your system.

By the end of this book, you will have become an expert in handling and performing complex data manipulations.

Style and approach

This mastering guide will help you master your skills required to perform a complex numerical computation. The book contains the right mixture of theory and practical examples that will help you in dealing with the advanced NumPy and build solutions for your numeric and scientific computational problems

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Mastering Numerical Computing with NumPy
  3. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  4. Contributors
    1. About the authors
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Working with NumPy Arrays
    1. Technical requirements
    2. Why do we need NumPy?
    3. Who uses NumPy?
    4. Introduction to vectors and matrices
    5. Basics of NumPy array objects
    6. NumPy array operations
    7. Working with multidimensional arrays
    8. Indexing, slicing, reshaping, resizing, and broadcasting
    9. Summary
  7. Linear Algebra with NumPy
    1. Vector and matrix mathematics 
    2. What's an eigenvalue and how do we compute it?
    3. Computing the norm and determinant
    4. Solving linear equations
    5. Computing gradient
    6. Summary
  8. Exploratory Data Analysis of Boston Housing Data with NumPy Statistics
    1. Loading and saving files
    2. Exploring our dataset
    3. Looking at basic statistics
    4. Computing histograms
    5. Explaining skewness and kurtosis
    6. Trimmed statistics
    7. Box plots
    8. Computing correlations 
    9. Summary
  9. Predicting Housing Prices Using Linear Regression
    1. Supervised learning and linear regression 
    2. Independent and dependent variables
    3. Hyperparameters
    4. Loss and error functions
    5. Univariate linear regression with gradient descent
    6. Using linear regression to model housing prices
    7. Summary
  10. Clustering Clients of a Wholesale Distributor Using NumPy
    1. Unsupervised learning and clustering
    2. Hyperparameters
    3. The loss function
    4. Implementing our algorithm for a single variable
    5. Modifying our algorithm
    6. Summary
  11. NumPy, SciPy, Pandas, and Scikit-Learn
    1. NumPy and SciPy
      1. Linear regression with SciPy and NumPy
    2. NumPy and pandas
      1. Quantitative modeling with stock prices using pandas
    3. SciPy and scikit-learn
      1. K-means clustering in housing data with scikit-learn
    4. Summary
  12. Advanced Numpy
    1. NumPy internals
      1. How does NumPy manage memory?
      2. Profiling NumPy code to understand the performance
    2. Summary
  13. Overview of High-Performance Numerical Computing Libraries
    1. BLAS and LAPACK
    2. ATLAS
    3. Intel Math Kernel Library
    4. OpenBLAS
    5. Configuring NumPy with low-level libraries using AWS EC2
      1. Installing BLAS and LAPACK
      2. Installing OpenBLAS
      3. Installing Intel MKL
      4. Installing ATLAS
    6. Compute-intensive tasks for benchmarking
      1. Matrix decomposition
      2. Singular-value decomposition
      3. Cholesky decomposition
      4. Lower-upper decomposition
      5. Eigenvalue decomposition
      6. QR decomposition
      7. Working with sparse linear systems
    7. Summary
  14. Performance Benchmarks
    1. Why do we need a benchmark?
    2. Preparing for a performance benchmark
      1. Performance with BLAS and LAPACK
      2. Performance with OpenBLAS
      3. Performance with ATLAS
      4. Performance with Intel MKL
    3. Results
    4. Summary
  15. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Mastering Numerical Computing with NumPy
  • Author(s): Umit Mert Cakmak, Mert Cuhadaroglu
  • Release date: June 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781788993357