What is Gradient Descent in Machine Learning? Definition and Python Example

What is Gradient Descent? Gradient Descent (GD) is an optimization algorithm using gradient to help find a local minimum of a function. (For more details on gradients, please refer to my other tutorial.) When the function is convex, a local minimum is also the global minimum. Steps of Gradient Descent Algorithm Step 1: Calculate the gradient function. In … Read more

What is Gradient in Machine Learning? Definition and Examples

Gradient for 2-dimension (x-y) In simpler terms, a gradient is a slope. You can calculate a function’s first-order derivative to get its gradient. This tutorial explains gradients with an example and plots. For instance, the following is a function of x, and the function can be plotted on a two-dimension x-y space. If you calculate its first-order … Read more

Two sample t-test: Definition, formula, and Examples

Two sample t-test is also called independent sample t-test or unpaired sample t-test. This tutorial explains what two sample t-test is, its formula, and examples of two sample t-test. Definition and Example Two sample t-test is used to test whether means from two different groups of people or objects are significantly different. The name of … Read more

A List of Books and Blogs on Data Analytics and Data Science

This page provides a collection of ebook and paper books on the topics of data analytics and data science. Most of these books are ones that I like, I read before, or I am reading. I also include some blogs that I visited and found useful. An Introduction to Statistical Learning This book is easy … Read more

Pandas: Read CSV from Github

Step 1: Hit “Raw” button You go to the Github page and find the csv file page. For instance, you can click this link for one. Then, you click Raw. Step 2: Copy the raw link and paste into the read_csv() Next, you copy the link and paste it within the function of read_csv() from … Read more

How to Read CSV or Excel Files in Pandas

This tutorial shows how you can read CSV or Excel files into Pandas in Python. To do that, you can import Pandas and then use its function of read_csv() to read csv files in Python. The following is the Python code to read the CSV file into Python using Pandas. The following shows the print … Read more

How to Read Excel with Multiple Sheets with Pandas (Python)

This tutorial shows how you can use read_excel() read Excel files with multiple sheets. The following is the illustration for sheet1 and sheet2. They have the same data structure, but in 2 different sheets. You can download the Excel file from Github by clicking this link. Method 1: Just read the first sheet Use read_excel() … Read more

What is the difference between `sep` and `delimiter` attributes in read_csv() and read_table() in Pandas

This tutorial explains the difference between sep and delimiter in read_csv() and read_table() in Pandas. In short, `sep` and `delimiter` are the same in both read_csv() and read_table() functions in Pandas. You can use either one of them. In both function description, you can see the following statement. delimiterstr, default None Alias for sep. Brand … Read more

How to Read Text (txt) Files in Pandas

This tutorial uses example Python codes to show 2 methods to read a text (txt) file into the Python programming environment. The following is the screenshot of the txt file. Method 1: Use read_csv() function to read txt You can use read_csv() function to read txt files as well. The basic syntax structure is as … Read more