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 […]

Continue reading


CNN KeRas (TensorFlow) Example with Cifar10 & Quick CNN in Theano

We will use cifar10 dataset from Toronto Uni for another Keras example. We used this dataset for another CNN model with more detailed process here. You can find more details on Valentino Zocca, Gianmario Spacagna, Daniel Slater’s book Python Deep Learning. ###the cifar10 dataset is comprised of 10 classes of objects: airplanes, automobiles, ###birds, cats, […]

Continue reading


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 […]

Continue reading


Spark with H2O using rsparkling and sparklyr in R

You must have installed: sparklyr rsparkling   Here is the working script: library(sparklyr) > options(rsparkling.sparklingwater.version = “2.1.6”) > Sys.setenv(SPARK_HOME=’/Users/avkashchauhan/tools/spark-2.1.0-bin-hadoop2.6′) > library(rsparkling) > spark_disconnect(sc) > sc <- spark_connect(master = “local”, version = “2.1.0”) Testing the spark context: sc $master [1] “local[8]” $method [1] “shell” $app_name [1] “sparklyr” $config $config$sparklyr.cores.local [1] 8 $config$spark.sql.shuffle.partitions.local [1] 8 $config$spark.env.SPARK_LOCAL_IP.local [1] […]

Continue reading


Building GBM model in R and exporting POJO and MOJO model

Get the dataset: Training: http://h2o-training.s3.amazonaws.com/pums2013/adult_2013_train.csv.gz Test: http://h2o-training.s3.amazonaws.com/pums2013/adult_2013_test.csv.gz Here is the script to build GBM grid model and export MOJO model: library(h2o) h2o.init() # Importing Dataset trainfile <- file.path(“/Users/avkashchauhan/learn/adult_2013_train.csv.gz”) adult_2013_train <- h2o.importFile(trainfile, destination_frame = “adult_2013_train”) testfile <- file.path(“/Users/avkashchauhan/learn/adult_2013_test.csv.gz”) adult_2013_test <- h2o.importFile(testfile, destination_frame = “adult_2013_test”) # Display Dataset adult_2013_train adult_2013_test # Feature Engineering actual_log_wagp <- h2o.assign(adult_2013_test[, “LOG_WAGP”], […]

Continue reading


Experimental Plotting in H2O FLOW (limited support)

H2O FLOW comes with experimental plot option which can be used as below: What you need is : X – Column name Y – Column name Data: Data Frame name Here is what experimental script look like: plot (g) -> g(    g.point(    g.position “X_Column”, “Y_Column” ) g.from inspect “data”, getFrameData “DATA_SET_KEY” ) You […]

Continue reading


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 […]

Continue reading