Skip to content

Instantly share code, notes, and snippets.

Avatar

vincent d warmerdam koaning

View GitHub Profile
@koaning
koaning / linearparams.r
Created Mar 11, 2014
this gist contains a small script that generates data and looks for suitable linear regression parameters
View linearparams.r
# define model
y = function(x){
return (2*x + 5 + rnorm(length(x)))
}
# generate data
X = rnorm(40)
df = data.frame(X, y(X))
ggplot(df, aes(X,y.X.))+geom_point()
@koaning
koaning / scrape_api.py
Created Mar 23, 2014
script for meetup api
View scrape_api.py
import requests as rq
import json
import collections
import time
API_KEY = 'APIKEY'
GROUP_ID = 'GROUPID'
def handle_event(event, event_dict):
event_dict[ event ] = {}
@koaning
koaning / index.html
Created Aug 23, 2014
d3 leaflet without geojson
View index.html
<!DOCTYPE html>
<html>
<head>
<title>d3.js with leaflet.js</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css"/>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js"></script>
<style>
@koaning
koaning / index.html
Created Sep 7, 2014
defs usage d3/leaflet
View index.html
<!DOCTYPE html>
<html>
<head>
<title>d3.js with leaflet.js</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css"/>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js"></script>
<style>
@koaning
koaning / server.R
Last active Aug 29, 2015
ShinieR Interaction with <<-
View server.R
library(shiny)
library(ggplot2)
library(reshape2)
library(randomForest)
df = ChickWeight
n = nrow(df)
perfdf = data.frame(ntree=as.numeric(), mse_train=as.numeric(), mse_test=as.numeric())
count = 0
@koaning
koaning / gist:28a91f5ac8be1571059a
Last active Aug 29, 2015
Amsterdam Python Meetup: Pandas 101
View gist:28a91f5ac8be1571059a
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
View gist:331610c504fac3be01c8
# Neural PCA/Compression in R
In this document I will show a small experiment that shows how a neural network can be used as a pca-algorithm. It should also help explain how neural networks work and why neural networks can be such a powerful machine learning algorithm.
The code will be written in R and needs the following dependencies.
### Packages Used
```{r packages}
library(RSNNS)
View solving_non_linear_problems
{
"metadata": {
"name": "",
"signature": "sha256:f2df6bbd409a5263ed5975f62791ba9a5f6c84469fdd4212a03e04b0f3bf051d"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@koaning
koaning / python_meetup
Last active Aug 29, 2015
python_meetup_v2
View python_meetup
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
View tsp.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.