Skip to content

Instantly share code, notes, and snippets.

View boersmamarcel's full-sized avatar
👋

Marcel Boersma boersmamarcel

👋
View GitHub Profile
@boersmamarcel
boersmamarcel / LinearRegression.java
Last active August 24, 2021 20:26
MapReduce Linear Regression
package regression;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
@boersmamarcel
boersmamarcel / theta.csv
Created December 4, 2012 09:53
theta.csv
0.01 0.03 4 2 0.9 2 0.8 0.9 2 3 0.1
@boersmamarcel
boersmamarcel / diabetes.csv
Created December 4, 2012 09:53
diabetes.csv
151 0.038076 0.05068 0.061696 0.021872 -0.044223 -0.034821 -0.043401 -0.002592 0.019908 -0.017646
75 -0.001882 -0.044642 -0.051474 -0.026328 -0.008449 -0.019163 0.074412 -0.039493 -0.06833 -0.092204
141 0.085299 0.05068 0.044451 -0.005671 -0.045599 -0.034194 -0.032356 -0.002592 0.002864 -0.02593
206 -0.089063 -0.044642 -0.011595 -0.036656 0.012191 0.024991 -0.036038 0.034309 0.022692 -0.009362
135 0.005383 -0.044642 -0.036385 0.021872 0.003935 0.015596 0.008142 -0.002592 -0.031991 -0.046641
97 -0.092695 -0.044642 -0.040696 -0.019442 -0.068991 -0.079288 0.041277 -0.076395 -0.04118 -0.096346
138 -0.045472 0.05068 -0.047163 -0.015999 -0.040096 -0.0248 0.000779 -0.039493 -0.062913 -0.038357
63 0.063504 0.05068 -0.001895 0.06663 0.09062 0.108914 0.022869 0.017703 -0.035817 0.003064
110 0.041708 0.05068 0.061696 -0.040099 -0.013953 0.006202 -0.028674 -0.002592 -0.014956 0.011349
310 -0.0709 -0.044642 0.039062 -0.033214 -0.012577 -0.034508 -0.024993 -0.002592 0.067736 -0.013504
@boersmamarcel
boersmamarcel / gist:4202270
Created December 4, 2012 09:50
Linear Regression MapReduce
package regression;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
@boersmamarcel
boersmamarcel / gist:2838323
Created May 30, 2012 19:05
Directed Stock Correlation Graph
##Requires a data frame with column "Name" (type as.character) and "Tags"
library(tseries)
library(igraph)
# get all the quotes for the stocks and put it in a dataframe
get.quotes.df <- function(stocks.df, start){
stock.values <- NULL
@boersmamarcel
boersmamarcel / stocks-to-market-correlation.R
Created May 13, 2012 17:58
Creates a density plot of the correlation in the market (AEX)
##Requires a data frame with column "Name" (type as.character) and "Tags"
library(tseries)
library(ggplot2)
# get all the quotes for the stocks and put it in a dataframe
get.quotes.df <- function(stocks.df, start){
stock.values <- NULL
@boersmamarcel
boersmamarcel / density-stocks.r
Created May 5, 2012 17:55
R: Stock density plot with finance.yahoo.com as source
##Requires a data frame with column "Name" (type as.character) and "Tags"
library(tseries)
library(ggplot2)
# get all the quotes for the stocks and put it in a dataframe
get.quotes.df <- function(stocks.df, start){
stock.values <- NULL