Skip to content

Instantly share code, notes, and snippets.

View markcassar's full-sized avatar

Mark Cassar markcassar

  • St. Clair College
  • Windsor, Ontario
View GitHub Profile
@markcassar
markcassar / timeseries_cnn.py
Created November 22, 2017 16:03 — forked from jkleint/timeseries_cnn.py
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
#!/usr/bin/env python
"""
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
"""
from __future__ import print_function, division
import numpy as np
from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten
from keras.models import Sequential
@markcassar
markcassar / data_prep.R
Last active March 11, 2016 19:49
Data Visualization Project
library(ggplot2)
library(dplyr)
titanic <- read.csv("data/titanic3.csv", stringsAsFactors=FALSE)
titanic <- tbl_df(titanic)
titanic <- mutate(titanic, Survived = ifelse(survived==0, "Did not survive", "Survived") )
titanic <- select(titanic, -survived)
titanic <- mutate(titanic, count=1)
titanic <- filter(titanic, embarked != "")