Skip to content

Instantly share code, notes, and snippets.

sql_query(cnxn, "
SELECT MIN(media_week_id) 'min_media_week',
MAX(media_week_id) 'max_media_week'
FROM availability_estimation_inputs
")
@mplourde
mplourde / diag_behavior.scala
Last active May 23, 2016 19:19
SystemML diag behavior issue
/*
In this example I create two matrices in the same manner, extract the diagonal, and then turn the nx1
matrix of the diagonal values into a diagonal matrix by calling `diag` again. When the initial matrix contains all 1s,
it works as expected. However, when the initial matrix contains all zeros, the second `diag` does not convert the nx1
matrix of diagonal values to a diagonal matrix. I can work around this behavior, but I thought I should bring it to your attention.
*/
val systemml_alg =
"""
fileOut1 = ""
library(dplyr)
library(ggplot2)
iris %>%
group_by(Species) %>%
summarize(
lower=quantile(Sepal.Length, .25),
upper=quantile(Sepal.Length, .75),
med=median(Sepal.Length),
avg=mean(Sepal.Length),