NumPy, short for Numerical Python is a library for scientific computing in Python. As the name suggests, it provides a host of tools to conduct mathematical and numerical routines.
One amongst these high-performing tools is the NumPy array. This multidimensional array object is a powerful data structure for efficient computation on vectors and matrices. In this article, we will explore these arrays and their power-packed functionalities.
You are encouraged to follow along with the tutorial and play around with NumPy, trying various things and making sure you're getting the hang of it. Let's get started!
As with any other package we start off by importing the library, NumPy in this case, by its most commonly used alias, np.
Linear Algebra: Vectors, Matrices and their properties
Large datasets are often comprised of hundreds to millions of individual data items. It is easier to work with this data and operate on it when it is represented in the form of vectors and matrices. Linear algebra is a branch of mathematics that deals with vectors and operations on vectors. Linear algebra is thus an important prerequisite for machine learning and data processing algorithms.
This tutorial covers the basics of vectors and matrices, as well as the concepts that are required for data science and machine learning. It also introduces you terminology, such as "dot product", "trace of a matrix", etc.
Vectors and their properties
What is a Vector?
Vectors can be thought of as an array of numbers whe...
Introduction to Data Visualization with Matplotlib
Matplotlib is the most popular Python package for data visualization. It provides a quick way to visualize data from Python and create publication-quality figures in various different formats. Matplotlib is a multi-platform data visualization library built on NumPy arrays. This allows it to work with the broader SciPy stack.
In this article, we are going to explore matplotlib in interactive mode covering 7 basic cases. You are encouraged to follow along with the tutorial and play around with Matplotlib, trying various things and making sure you're getting the hang of it. Let's get started!
Matplotlib and Pyplot
Just as we use the np shorthand for NumPy and the pd...
Logistic Regression is a variant of linear regression where the target variable is categorical, i.e. it takes one out of a few possible discrete values. Each of these values is called a label. Don't be confused by the name logistic regression, it's a classification algorithm.
In particular, we can use logistic regression for binary classification (two labels). For example, we might want to predict whether or not a person has diabetes, or whether or not an email is spam.
The logistic (or sigmoid) function
The term logistic in logistic regression comes from the logistic function (also known as sigmoid function), which can be written as: