Skip to content

Instantly share code, notes, and snippets.

library("Rcpp")
library("devtools")
install_github("mjoc/antfarm")
library("antfarm")
library("dplyr")
library("caret")
doLoadFromBinary <- TRUE
if (doLoadFromBinary) {
# Load the MNIST digit recognition dataset into R
g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/opt/local/include -I/usr/local/include -I"/home/moconnor01/R/x86_64-redhat-linux-gnu-library/3.2/Rcpp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c RcppExports.cpp -o RcppExports.o
g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/opt/local/include -I/usr/local/include -I"/home/moconnor01/R/x86_64-redhat-linux-gnu-library/3.2/Rcpp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c backprop.cpp -o backprop.o
backprop.cpp: In constructor ‘Backpropper::Backpropper(Nnet&)’:
backprop.cpp:40: warning: comparison between signed and unsigned integer expressions
backprop.cpp: In constructor ‘Backpropper::Backpropper(Nnet&, std::string)’:
backprop.cpp:71: warning: comparison between signed and unsigned integer expressions
backprop.cpp: In member function ‘void Backpropper::initial
@mjoc
mjoc / antfarm_test1.R
Last active June 2, 2017 09:29
Test script for antfarm code
library("Rcpp")
library("devtools")
install_github("mjoc/antfarm")
library("antfarm")
library("dplyr")
library("reshape2")
library("hexbin")
af_net_module <- Module("af_nnet",PACKAGE = 'antfarm')
af_dataset_image <- af_net_module$Dataset
@mjoc
mjoc / ggbrush.R
Created November 26, 2015 15:31 — forked from jcheng5/ggbrush.R
ggbrush
library(ggplot2)
library(shiny)
# Call ggbrush with a ggplot2 object, and the dimensions which
# should be brushed (try "xy" for scatter, "x" for histogram).
# The plot will show in RStudio Viewer or your web browser, and
# any observations selected by the user will be returned.
ggbrush <- function(plotExpr, direction = c("xy", "x", "y")) {
# See below for definition of dialogPage function
@mjoc
mjoc / useful_pandas_snippets.py
Created November 25, 2015 15:54 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
#List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
#Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
#Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(value_list)]