We talked about auto-encoder here and here with R (https://charleshsliao.wordpress.com/2017/04/14/identify-arguments-of-h2o-deep-learning-model-with-tuned-auto-encoder-in-r-with-mnist/). We also talked about the three functions of auto encoder above. This is a pretty standard example used for benchmarking anomaly detection models. We use Python3 and H2O framework to build auto-encoder. More details can be found in Sebastian Raschka’s book: https://www.goodreads.com/book/show/25545994-python-machine-learning?ac=1&from_search=true import pandas as […]

# RNN, LSTM in TensorFlow for NLP in Python

We covered RNN for MNIST data, and it is actually even more suitable for NLP projects. You can find more details on Valentino Zocca, Gianmario Spacagna, Daniel Slater’s book Python Deep Learning. from __future__ import print_function, division # -*- coding: utf-8 -*- ###”War and peace” contains more than 500,000 words, making it the perfect ###candidate […]

# DNN and CNN of Keras with MNIST Data in Python

We talked about some examples of CNN application with KeRas for Image Recognition and Quick Example of CNN with KeRas with Iris Data. Actually, TensorFlow itself in Python is mature enough to conduct deep learning activities and KeRas is even faster and more simple to train with than TensorFlow only in deep learning activities. You […]

# RANSAC and Nonlinear Regression in Python

We use Python3. More details can be found in Sebastian Raschka’s book: https://www.goodreads.com/book/show/25545994-python-machine-learning?ac=1&from_search=true Find the data here: https://archive.ics.uci.edu/ml/datasets/Housing. Linear regression models can be heavily impacted by the presence of outliers. As an alternative to throwing out outliers, we will look at a robust method of regression using the RANdom SAmple Consensus (RANSAC) algorithm, which is […]

# Preprocess: LDA and Kernel PCA in Python

Principal component analysis (PCA) is an unsupervised linear transformation technique that is widely used across different fields, most prominently for dimensionality reduction. We talked about it here: https://charleshsliao.wordpress.com/2017/05/28/preprocess-pca-application-in-python/ We use the data from sklearn library, and the IDE is Python3. Most of the code comes from Sebastian Raschka’s book: https://www.goodreads.com/book/show/25545994-python-machine-learning?ac=1&from_search=true ###1. import the data ###pls […]

# CNN Model of Image Detection in Keras (TensorFlow) in Python3

This article covers the basic application of Keras and CNN in Python3, with Sublime text3 and Ipython Notebook as IDE. More details of the following code can be found in Robert Layton’s book here: https://www.goodreads.com/book/show/26019855-learning-data-mining-with-python?from_search=true ###The book above said that we will build a system that will take an image as an input ###and give […]

# Keras in Python, Backend TensorFlow, with Iris data to Build Deep Learning Model

We talked about Deep Learning Modeling in TensorFlow in Python&R: https://charleshsliao.wordpress.com/2017/06/06/rnn-in-tensorflow-in-pythonr-with-mnist/ We also mentioned Keras application in R: https://charleshsliao.wordpress.com/2017/04/24/cnndnn-of-keras-in-r-backend-tensorflow-for-mnist/ This article covers the basic application of Keras and TensorFlow in Python3, with Sublime text3 and Ipython Notebook as IDE. More details of the following code can be found in Robert Layton’s book here: https://www.goodreads.com/book/show/26019855-learning-data-mining-with-python?from_search=true ###This […]

# Movie Recommender -Affinity Analysis of Apriori in Python

“Affinity analysis can be applied to many processes that do not use transactions in this sense: Fraud detection Customer segmentation Software optimization Product recommendations. The classic algorithm for affinity analysis is called the Apriori algorithm. ” More details can be found in Robert Layton’s book here: https://www.goodreads.com/book/show/26019855-learning-data-mining-with-python?from_search=true We explored similar method of “Market Basket” here:https://charleshsliao.wordpress.com/2017/03/06/an-quick-association-rules-example-within-r/ […]

# NBA Winning Estimator with Decision Tree in Python

It would be interesting to conduct prediction to understand the trend of NBA winning teams. We will use data from http://www.basketball-reference.com/leagues/NBA_2017_games-june.html and follow workflow. More details can be found in Robert Layton’s book here: https://www.goodreads.com/book/show/26019855-learning-data-mining-with-python?from_search=true ###1. Load data from http://www.basketball-reference.com/leagues/NBA_2017_games-june.html import pandas as pd file=”NBA2017.csv” NBA2017=pd.read_csv(file,sep=”,”,parse_dates=[“Date”]) #change string of “Date” to date value NBA2017.columns=[“Date”, “Start […]

# Quick Machine Learning Workflow in Python, with KNN as Example of Ionosphere Data

Multiple approaches to build models of machine learning in Python are possible, and the article would serve as a simply summary of the essential steps to conduct machine learning from data loading to final visualization. You can find the data here: http://archive.ics.uci.edu/ml/datasets/Ionosphere More details can be found in Robert Layton’s book here:https://www.goodreads.com/book/show/26019855-learning-data-mining-with-python?from_search=true ###1. Load data […]