My code example focusing on Python programming and data science.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.ipynb_checkpoints
Data Collection through Web API
Gradient Descent
Linear Regression
Mini-batch Gradient Descent
N-gram
Naive-bayes
Neural-network Classification
Relational Database and Time Series Analysis
Seg-text
Tweets Classification
README.md
gcdRecur.py
genPrimes.py
hanoiTowerSolver.py
sml.sml

README.md

Code Examples

My code example focusing on Python programming and data science.

Python Basics

Greatest Common Divisor
Find the greatest common divisor of a and b recursively.

Prime Number
Generate a list of prime numbers recursively.

Hanoi Tower
Solve Hanoi tower problem recursively.

Separate Text
Separate text into list and calculate word frequency.

Other Languages

SML
Standard ML is a general-purpose, modular, functional programming language with compile-time type checking and type inference. In the code I made several functions to deal with date calculation.

Julia
Julia is a high-level, high-performance dynamic programming language for numerical computing. In this example, I build a function to calculate multi-loss of parameter estimation.

Data Science

Relational Database
Read, save and filter relational data using sqlite3. It is based on homework from Practical Data Science.

Time Series Data
Using pandas and matplotlib to explore time series data form Pittsburgh buses. It is based on homework from Practical Data Science.

Linear Regression
Using analytical method of least square to predict the ETA of buses in Pittsburgh. It is based on homework from Practical Data Science.

Tweets Classification
Predict the political background (GOP or Democratic) from a tweet using SVM from scikit-learn. It is based on homework from Practical Data Science.

Data Collection and EDA
Collect data through Twitter API and detect whether the top two US president candidates' tweets were written by their aides through visualization. It is based on homework from DS100.

N-gram
Generate sentences using N-gram model. The corpus is my blog in Chinese.

Naive-bayes
Determine whether input sentence is positive or negative based on naive bayes algorithm.

Gradient Descent
Linear regression based on gradient descent algorithm.

Mini-batch gradient descent
Calculate the same linear regression as gradient descent but using smaller sample to train the model.

Neural-network classification
Classify whether the data is 1 or 0 (shown in the decision boundary graph) using TensorFlow.