Skip to content

Instantly share code, notes, and snippets.

View woobe's full-sized avatar

Jo-fai Chow woobe

View GitHub Profile
woobe /
Created March 17, 2022 09:23
Tutorial - Setup for HAIC App Developers
from h2o_wave import main, app, Q, ui
async def serve(q: Q):["my_form_card"] = ui.form_card(
box='1 1 -1 -1',
ui.text("My first app!")
woobe / airline_sentiment_python_api.ipynb
Created September 11, 2018 19:27
Example notebook for Airline Sentiment using Driverless AI's Python API
View airline_sentiment_python_api.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
woobe /
Created September 11, 2018 18:25
A simple script to split airline sentiment dataset into train and test set
import numpy as np
import pandas as pd
from sklearn import model_selection
al = pd.read_csv("Airline-Sentiment-2-w-AA.csv", encoding='ISO-8859-1')
train_al, test_al = model_selection.train_test_split(al, test_size=0.2, random_state=2018)
train_al.to_csv("train_airline_sentiment.csv", index=False)
test_al.to_csv("test_airline_sentiment.csv", index=False)
woobe / h2o_save_load_model.R
Last active June 14, 2017 15:39
An example of saving and loading H2O model in R
View h2o_save_load_model.R
# Example: Saving and loading H2O models
# Using Iris for this example
d_train <- iris
# Initialize H2O
h2o.init(nthreads = -1)
# Train a DRF model
woobe /
Last active August 29, 2015 14:06 — forked from timelyportfolio/


This d3.js parallel coordinates plot is another experiment in how we might use interactive plots in Javascript to represent a partykit / rpart object from R. The example builds on this d3.js collapsible tree plot. Eventually, it would be nice to combine the tree and parallel coordinates into a layout with synced interactivity.

### Almost No [`rCharts`]( Also, this is fairly different from most of my interactive plots from R in that it almost completely avoids [`rCharts`]( (almost because I did use its `publish` to make this gist). I chose to exclude `rCharts` for two reasons:
  1. demo how we can use htmltools to build html/js in R
  2. help users understand some of the things rCharts does f
woobe / link_data.R
Last active January 7, 2016 15:42
[Blog]: Things to try after useR! Part 1: Regularized Deep Learning with H2O
View link_data.R
woobe / code.R
Last active October 30, 2015 14:11
[recharts]: ECharts Style Area Charts
View code.R
## Load package
library(recharts) ## see
## Convert UKgas time series into a matrix
mat_UKgas <- matrix(UKgas, ncol = 4, byrow = TRUE)
rownames(mat_UKgas) <- rep(1960:1986, each = 1)
colnames(mat_UKgas) <- c("Q1", "Q2", "Q3", "Q4")
## Create the echarts plot object
e1 <- eArea(mat_UKgas,
woobe / code.R
Last active August 29, 2015 14:02
[rCrimemap]: All Crimes in January 2014 on Open Street Map
View code.R
## Load Library
library(rCrimemap) # devtools::install_github("woobe/rCrimemap")
## Create Crime Heatmap with Nokia map base
r1 <- rcmap_quick(period = "2014-01",
map_size = c(960, 500),
provider = "OpenStreetMap.BlackAndWhite",
zoom = 6)
## Save the Heatmap as a self-contained HTML
woobe / code.R
Last active August 29, 2015 14:02
[rCharts]: Parallel Coordinates Plot x Bart Simpson Colour Palette
View code.R
library(rCharts) ## devtools::install_github("ramnathv/rCharts@dev")
library(rPlotter) ## devtools::install_github("woobe/rPlotter")
## Using Theoph as the demo data.
dat <- Theoph
## Initialise rCharts-parcoords
p1 <- rCharts$new()
p1$setLib(system.file('parcoords', package = 'rCharts'))
woobe / index.html
Last active August 29, 2015 14:02
[rChartsCalendar]: Points Scored by Paul George
View index.html
<!doctype HTML>
<meta charset = 'utf-8'>
<link rel='stylesheet' href=''>
<script src='' type='text/javascript'></script>
<script src='' type='text/javascript'></script>