# AI Content Creators

Artificial intelligence (AI) is changing our world rapidly. It does not only help estimate property prices [1] more accurately, but it can now drive our cars [2] , buy and sell stocks [3], and diagnose cancers [4], etc. AI relies on a learning process from the data and contents obtained to make it smart, but now AI can create contents by itself. Would AI becomes dumb when it is learning its own created contents?

This article shows an example of writing a blog article by an AI auto-writer. It is a content creator that I just have to provide the…

# Measure Area and Distance of GIS Data by Geopandas in Colab

We have discussed how to use geopandas in Colab to use GIS data to plot maps (Yiu, 2021). This article is to use geopandas functions to measure areas of polygons with boundaries and to measure distances between coordinate points.

So we start downloading GIS data with polygon boundaries first. I am going to use the Wellington City Council’s GIS open data of defining suburbs at https://data-wcc.opendata.arcgis.com/datasets/WCC::wcc-suburb-boundaries/about.

1. The first step is always installing software, here we install geopandas and contextily.
`!pip install geopandas #mapping!pip install contextily #basemapimport geopandas as gpdimport contextily as ctx`

2. Then we collect a…

# Build a Home Buying Investment e-Analyser by Numpy in Colab

Home buying investment is usually analysed by Net Present Value (NPV) and Internal Rate of Return (IRR). NPV and IRR are common metrics for investment assessment and these functions are also available in Excel or ARGUS (Figure 1).

This article shows an example of building a NPV and IRR e-Analyser by using numpy in Colab. It compares three investment scenarios of buying a house to earn rental incomes for 10 years:

1. pay by 100% loan;
2. pay by 100% saving; and
3. pay by 20% downpayment and 80% mortgage loan.

First, we install numpy-financial and import npv, irr functions as follows:

`!pip…`

# Build My First Mortgage Calculator by Numpy in Colab

Mortgage repayment amount is hard to calculate by simple arithmetic as it is not based on a simple interest formula. Nowadays, almost all banks provide free Mortgage Calculators for people to know in advance how much they have to pay every month if they borrow mortgage loans to buy a property. The Mortgage Calculator can also act as a tool for stress tests (i.e. sensitivity analysis) as you can adjust the mortgage rate and the total number of repayment period, and the loan amount. Figure 1 shows a typical example which provides a slider for choosing the three parameters. When…

# Data Analytics — Coding in Colab

Having written many articles on analytics, I want to make an index article summarising the whole picture and their relationships. First, data analytics is defined as follows:

“Data analytics is the pursuit of extracting meaning from raw data using specialized computer systems. These systems transform, organize, and model the data to draw conclusions and identify patterns.” (Informatica, 2021)

It therefore involves many processes, including data acquisition, data processing, data visualisation, data storage, data analysis, data forecasting, data simulations, predictive analytics by machine learning and artificial intelligence, decision making, etc. (Figure 1)

Each process can involve different software and different skills…

# Write a Selfie and Face Detection App

Face recognition is one of the earliest practical applications of artificial intelligence (AI) and machine learning (ML). As fb has started to use face recognition technology a few years ago, it can automatically recognize people (and their names) in photos through machine learning, facial recognition technology has become well known. In recent years, it has also been applied to surveillance systems which draws a lot of people’s attention.

I think many of us may want to learn more about the technology by developing our own app rather than just being recognised by other people’s facial recognition apps. For a starter…

# Mapping GIS Data on a Basemap by Contextily in Colab

Nowadays many online apps are map-based applications, such as Uber, how to map GIS data on a basemap is an important knowledge in developing apps. Very often, data providers would only provide GIS data with coordinates or polygons’ coordinates, and a basemap is required to be layered (matched) to show a map. Depending on different purposes, various types of basemap are used. For example, Open Street Maps are more commonly used to show spatial relationships by roads and streets, Stamen Terrain Maps are better for showing contours and land use patterns. …

# Data Visualisation — How to Plot a Scatter Bubble Chart by Plotly

Unlike a scatterplot that can only show the relationship between 2 variables, a Scatter Bubble Chart (SBC) can depict the relationships of three or even four variables. For example, the SBC below shows the relationship between Life Expectancy and GDP per capita in y and x axis, but also using different colors to differentiate between continents and using different sizes of bubble to differentiate between population sizes. Thus, it does not only show a linear relationship between life expectancy and GDP per capita (in log scale), but it can also show a lower (higher) GDP per capita in Africa (North…

# A Simple Rent-to-Price ML Estimator by Keras in Colab

Housing rents and prices are well known to be highly correlated and the rent-to-price ratio is commonly coined as the rental yield rate. In schools, students are learned how to apply the knowledge to estimate housing price from rent. However, a machine can learn by itself to identify the rule (relationship) without being told — that is machine learning (ML).

For example, Figure 1 shows a strongly positive association between the year-on-year changes of housing prices and rents in the past decades. Even though their magnitudes are not exactly the same, the ups and downs are almost always in tandem…

# Getting Data from API in Colab

We have tried learning various methods to read data in Colab, including

1. read a csv data file from an url by pandas (Yiu, 2021a);
2. read time series data from Yahoo Finance by web.DataReader (Yiu, 2021a);
3. read a csv data file from google drive by drive.mount (Yiu, 2021b); and
4. read GIS data from geopandas’ datasets (Yiu, 2021c).

However, all these methods rely on the data structure prepared by the data sources. The best way is of course to download from the raw data with the data structure defined by yourself, such as getting data from an API (Application Programming Interface).

But…

## ecyY

ecyY — easy to understand why, easy to study why. Finding the truths scientifically is the theme.

Get the Medium app