Skip to content

Instantly share code, notes, and snippets.

David Smith revodavid

Block or report user

Report or block revodavid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
revodavid /
Last active Mar 23, 2020 — forked from ChloeCodesThings/
Markdown for 5 Combos Blog- AI April
title published description tags cover_image
Making Sense of the Senses- Our Top 5 Azure Cognitive Service Combos!
In the post, Cloud Advocates Chloe Condon & David Smith will share their favorite combos of cognitive services to spice up your remote presentations and streams.
tutorial, productivity, webdev, beginners

As folks around the world make the switch to remote meetings and presentations, we’ve seen a lot of unique, creative, and hilarious ways people have tried to make this format work well for them. From hilarious Teams backgrounds, unique uses of “Python”, and even informal mental health checkins- we’ve loved seeing the ways folks have made this new method of social interaction work well for them.

revodavid / slide-code.R
Created Feb 3, 2020
R code for slides in "Machine Learning Operations for R"
View slide-code.R
#### Code from slides
## This code is excerpted from experiments-with-R.Rmd,
## edited and reformatted for use on slides
## SLIDE: Prepare Data
ws <- load_workspace_from_config()
View azureRexample.R
# set your Azure organization and subscription details here
tenant <- "mytenant"
sub_id <- "12345678-aaaa-bbbb-cccc-0123456789ab"
# create a Graph client
gr <- AzureGraph::create_graph_login(tenant)
View noops-multi.R
## get n colors at once
random.colors <- function(n) {
hexbot <- GET(endpoint, query=list(count=n))
ncol <- 5
barplot(rep(1,ncol),col=random.colors(ncol), axes=FALSE)
View noop-scatter.R
## get n colors with locations
random.points <- function(n,width=100,height=100) {
hexbot <- GET(endpoint, query=list(count=n, width=width, height=height))
data <- matrix(unlist(content(hexbot)$colors),ncol=3,byrow=TRUE)
cols <- data[,1]
x <- as.numeric(data[,2])
y <- as.numeric(data[,3])
data.frame(cols, x, y)
View noops-single.R
## get a single color, and display on screen
random.color <- function() {
hexbot <- GET(endpoint)
rcol <- random.color()
barplot(1, col=rcol, main=rcol, axes=FALSE)
View noops-pkg.R
endpoint <- ""
View spm4.R
# Separate LHS and RHS rules
r1$rulecount <- as.character(r1$rule)
max_col <- max(sapply(strsplit(r1$rulecount,' => '),length))
r_sep <- separate(data = r1, col = rule, into = paste0("Time",1:max_col), sep = " => ")
r_sep$Time2 <- substring(r_sep$Time2,3,nchar(r_sep$Time2)-2)
# Strip LHS baskets
max_time1 <- max(sapply(strsplit(r_sep$Time1,'},'),length))
r_sep$TimeClean <- substring(r_sep$Time1,3,nchar(r_sep$Time1)-2)
r_sep$TimeClean <- gsub("\\},\\{", "zzz", r_sep$TimeClean)
View spm3.R
# Get induced temporal rules from frequent itemsets
r1 <- as(ruleInduction(s1, confidence = 0.5, control = list(verbose = TRUE)), "data.frame")
View spm2.R
# Get frequent sequences and corresponding support values
s1 <- cspade(trans_matrix, parameter = list(support = 0.3), control = list(verbose = TRUE))
s1.df <- as(s1, "data.frame")
You can’t perform that action at this time.