Publications by Sang-Heon Lee

Understanding Gradient Descent Algorithm with Python code

28.06.2021

Gradient Descent (GD) is the basic optimization algorithm for machine learning or deep learning. This post explains the basic concept of gradient descent with python code. Gradient Descent Parameter Learning Data is the outcome of action or activity. \[\begin{align} y, x \end{align}\] Our focus is to predict the outcome of next action fro...

2899 sym 6 img 3 tbl

Installing Python and Tensorflow with Jupyter Notebook Configurations

05.03.2022

For a machine or deep learning modeling, Python is widely used with Tensorflow. This post explains the an installation of Python, Tensorflow and configuration of Jupyter notebook as a kickstart towards ML/DL modeling. Python, Tensorflow, Jupyter Notebook It is common to use Anaconda for installing Python since a variety of packages (i.e. skl...

4727 sym 26 img 7 tbl

Multiple Linear Regression using Tensorflow

15.03.2022

This post implements the standard matrix based estimation of multiple linear regression model using Tensorflow. With this example, we can learn some basic vector or matrix operations in Tensorflow and also Python. Linear Regression using Tensorflow To study some basic vector or matrix operations in Tensorflow which is not familiar to us, we ...

4431 sym 2 img 1 tbl

Multiple Linear Regression using Tensorflow Optimization

15.03.2022

This post implements the optimization based estimation of multiple linear regression model using Tensorflow. With this example, we can learn basic implementations of functions in Python and a numerical optimization in Tensorflow. Optimization based Linear Regression using Tensorflow This post deals with an optimization based linear regressio...

2466 sym 2 img 2 tbl

Python Troubleshooting Q&A

26.08.2022

This is just a small collection of common error messages and solutions that we encounter when using Python. Python Troubleshooting Q&A 1. Pyfolio – AttributeError: ‘numpy.int64’ object has no attribute ‘to_pydatetime’ # remove your installed pyfolio library pip uninstall pyfolio # Install it again from its github repo pip install...

1966 sym 2 img

Hurst Exponent using R code

16.08.2022

This post explains how to estimate the Hurst exponent which indicates characteristics of a time series : mean-reversion, random walk, and trending with long memory using S&P 500 index returns. Hurst Exponent Pairs trading literature use the Hurst exponent frequently since it gives an simple and intuitive indicator for the behavior of s...

5477 sym 4 img 2 tbl

R code snippet : Read Historical Daily Exchange Rates

14.08.2022

This post shows how to read daily historical exchange rates given symbols as a string. Read historical exchange rates I collected the symbols of exchnage rates at https://finance.yahoo.com/currencies R code The following R code retrieves historical daily exchange rates given their symbols as of 2022-08-14. 1234567...

907 sym 6 img 1 tbl

R code snippet : Read Historical Prices of Stock Index

14.08.2022

This post shows how to read prices of stock indices given symbols as a string. Read historical prices of stock indices I collected the symbols of major stock indices at https://finance.yahoo.com/world-indices R code The following R code retrieves historical daily prices of selected stock indices given their symbols as of 2...

931 sym 6 img 1 tbl

R code snippet : Read Historical Prices of Cryptocurrencies

13.08.2022

This post shows how to read prices of cryptocurrencies given symbols as a string. Read historical prices of cryptocurrencies Pairs trading also can be applied to cryptocurrencies. It is, therefore, a starting point of pairs trading backtest to collect daily prices of them. I collected the symbols of major cryptocurrencies at https:/...

1441 sym 4 img 1 tbl

Paste R plot image into MS Word

30.08.2022

This post explains how to paste R plot images into MS Word with some additional information such as title, description, and data table. This can be done by using the officer R package. Paste R plot image into MS Word with additional information The officer R package makes an access to and manipulates ‘Microsoft Word’ and ‘Micro...

2283 sym 2 img 3 tbl