Summarise the 2020 with R and rgl

[This article was first published on R in ResponsibleML on Medium, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

The end of the year is a great time to summarize accomplishments of the team. This year in MI2DataLab we summarized good things that happend in the form of baubles on the christmas tree (yes, this is the only known exception for using 3D plots). Each color of a bauble represents a different kind of result (yellow for articles, red for the package’s releases, blue for conferences, orange for blogs, and light blue for workshops and trainings).

Here is the decorated christmas tree and below I will describe how to make it from the scratch using rgl package for R.

Christmas Tree with our articles, workshops, software releases

Let’s start with the 366 small green baubles. We want the baubles to be spread out in a uniform way on the Christmas tree. It’s easy with the help of an Archimedean spiral (https://en.wikipedia.org/wiki/Archimedean_spiral). It has an interesting property that the subsequent circuits are equally distant from each other. The spiral is easily described in polar coordinates. Because the size of the spiral grows with a square of the distance from the center, this should be taken into account when calculating the positions of the baubles. The third coordinate, that is the height on the tree will be calculated so that the baubles are uniformly distributed vertically.

library(rgl)
rgl.open()
rgl.bg(color = "white")
a <- 1.5
b <- -2.4
t <- sqrt(seq(0, 1, length.out=365))*25*pi
x <- (a + b*t) * cos(t)
y <- (a + b*t) * sin(t)
z <- t*5
rgl.spheres(x, -z, y, r = 10, 
            color="green", alpha = 0.75, shininess =10)

Okay, time to hang the baubles.
Let’s assume that the dates on which we published the articles are written in the dates_papers vector.
The following instructions add the article baubles to the Christmas tree.

ind_papers <- as.numeric(dates_papers - as.Date("2020/01/01"))
    rgl.spheres(x[ind_papers], -z[ind_papers]-4, y[ind_papers], 
                r = 20, color="yellow", alpha = 0.9, shininess =100)

Now it is time for the remaining baubles. Again, let’s assume that the dates_software, dates_conferences, dates_blogs vectors contain dates of workshops, trainings, blog articles, etc.

ind_software <- as.numeric(dates_software - as.Date("2020/01/01"))
rgl.spheres(x[ind_software], -z[ind_software]-4, y[ind_software], 
                r = 20, color="red", alpha = 0.9, shininess =1)
ind_confs <- as.numeric(dates_confs - as.Date("2020/01/01"))
rgl.spheres(x[ind_confs], -z[ind_confs]-4, y[ind_confs], 
                r = 20, color="blue", alpha = 0.9, shininess =1)
ind_blogs <- as.numeric(dates_blogs - as.Date("2020/01/01"))
rgl.spheres(x[ind_blogs], -z[ind_blogs]-4, y[ind_blogs], 
                r = 20, color="orange", alpha = 0.9, shininess =25)
ind_trainings <- as.numeric(dates_trainings - as.Date("2020/01/01"))
rgl.spheres(x[ind_trainings], -z[ind_trainings]-4, y[ind_trainings], 
                r = 20, color="blue", alpha = 0.9, shininess =100)

And you can rotate the tree with

start <- proc.time()[3]
while ((i <- 36*(proc.time()[3] - start)) < 360) {
    rgl.viewpoint(i, 0); 
}

It was an intensive year. Big thanks for UseR 2020, eRum 2020, Data Science Summit 2020, MLinPL 2020, ICML 2020, ECML PKDD, WhyR? 2020, SIGiR 2020 and Eastern European Machine Learning Summer School for hosting us. Have fun with our new software DALEX 2.0.1 for R, arenar, 0.2.0, triplot 1.3.0, modelStudio 2.1.0, fairmodels, 0.1.1, dalex 1.0 for Python, DALEXtra 1.3.2, treeshap 1.0.

Best wishes for 2021!

If you are interested in other posts about explainable, fair, and responsible ML, follow #ResponsibleML on Medium.

In order to see more R related content visit https://www.r-bloggers.com


Summarise the 2020 with R and rgl was originally published in ResponsibleML on Medium, where people are continuing the conversation by highlighting and responding to this story.

To leave a comment for the author, please follow the link and comment on their blog: R in ResponsibleML on Medium.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)