Links for the Week of 2022-09-05
Here are some links I covered in the past week.
Enjoy neoplastic art from the Fronkonstin blog while you read.
Table of Contents
- Serialized Listening
- Art and Coding
- Static Site Generator “Lite”: R Markdown and Wordpress
- Data Shows History Repeats Itself (Again)
- Machine Learning in R
Serialized Listening
1001 Albums You Must Hear Before You Die
Are you obsessed with listening to music in a serialized manner? Looking for new music? 1001 Albums You Must Hear Before You Die randomly generates an album to listen to each week. You can create an account and make notes and rate each selection as you go along. Follow along with my (lack) of progress.
My first “assigned” album is David Bowie’s 6th studio album from 1973 titled Alladin Sane. This was the followup album to his breakout album from 1972 The Rise and Fall of Ziggy Stardust and the Spiders from Mars (1972). According to Wikipedia “the record features a tougher and raunchier glam rock sound than its predecessor. The lyrics reflect the pros of Bowie’s newfound stardom and the cons of touring and paint pictures of urban decay, drugs, sex, violence and death.”
TLDR: Listening to and ranking the best 1001 albums is easier with https://1001albumsgenerator.com/
Art and Coding
Why Love Generative Art? — Artnome
Stumbled across this brilliant piece that discusses generative art, which “is art programmed using a computer that intentionally introduces randomness as part of its creation process.”
One of the founders of generative art is Georg Nees who created the work shown below called Schotter (Gravel Stones).
From a tutorial on recreating the iconic graphic: “In the original Schotter, Nees creates a grid of squares 12 across by 22 down. As the drawing of the squares progresses from top to bottom, the amount of disorder increases. This disorder takes two forms. First is in the positioning of each square, second is in its rotation.“In the original Schotter, Nees creates a grid of squares 12 across by 22 down. As the drawing of the squares progresses from top to bottom, the amount of disorder increases. This disorder takes two forms. First is in the positioning of each square, second is in its rotation.”
Users have recreated Nees’ work in Python and other programs. R users are deep into making generative art, and there are several packages designed to help you create your next masterpiece, including:
- generative art
- jasmines
- aRtsy. You can also check out the aRtsy twitter feed that tweets out an automatically generated work of art on the daily.
Other articles on generative art:
- The Mondrianomies - Fronkonstin - Link - DB
- Georg Nees, Processing, and a Schotter Tutorial - Link - DB
- Recursion and Algorithmic Art by Jim Plaxco - Link - DB
TLDR: Make computer assisted art in R with packages like generative art, jasmines and aRtsy
Static Site Generator “Lite”: R Markdown and Wordpress
Publish R Markdown to WordPress site? Yes You Can! – Catbird Analytics
How to publish a blog post on Wordpress using Rmarkdown - tobias dienlin
Enabling HTTPS on your WordPress instance in Amazon Lightsail - Lightsail Documentation
I have been toying with using Wordpress as a CMS for publishing content rather than something like Jekyll (which this blog runs on). The real advantage that Wordpress offers is that non-technical authors and other people who work on your site can easily use the Wordpress dashboard by logging-in via the my-wordpress-site.com/admin
url and getting to work. They don’t necessarily have to know the finer workings of Github, HTML, YAML, Markdown or other static site generators.
The Wordpress REST API allows you to “push” content to your site remotely, including pages, posts, plugins, designs, meta information, settings - essentially anything you traditionally do in the admin dashboard. If you are working with a collaborator that is less “techie” than you, setting up and updating the blog could be completed via the API, and then the collaborator could use the traditional WYSIWYG editor and dashboard. Plus, it opens up the wide range of integrations and plugins that Wordpress provides.
TLDR: Use the Wordpress REST API and Markdown as a static site generator.
TODO: Finish R code for working with the Wordpress API.
Data Shows History Repeats Itself (Again)
Mathematicians Predict the Future With Data From the Past - WIRED
Ran across this 2013 article from Wired. It talked about “cliodynamics,” (a word I was unfamiliar with) “where scientists and mathematicians analyze history in the hopes of finding patterns they can then use to predict the future. It’s named after Clio, the Greek muse of history.” Source.
What really gave me pause was when I read this quote: “we’re due for a wave of widespread violence in about 2020, including riots and terrorism.” Source. Again, this article was published 7 years before 2020, and well, you would have to agree that the prediction is pretty spot on.
Cliodynamics doesn’t use sophisticated statistical techniques, advanced mathematics or big data. Most of the data is analyzed with off the shelf statistical software. What the author most attributes to the advancement of the study is the simple digitization of historical documents like newspapers and artifacts. This is likely less a factor nine years after the article was published, but it shows how far we have come.
It sounds like the researchers backtest a model they have created and compare it against past events: “[they] will build a mathematical model using one data set and then test that model against other historical data sets they’re unfamiliar with. That way, they can see if the model holds.”
Besides the eerily accurate prediction for 2020, what interests me most is the idea that a trading model should test for repeatability and consistency rather than just profitability. Stated otherwise, raw data should be tested for how often it predicts similar patterns in the future not just how often a single pattern makes money. For example, a series of past higher highs results in an X% probability of a higher high in a future period.
Other articles on this subject:
- An introduction to repeatability estimation with rptR - Link - DB
- Peter Turchin Home - Link - DB. Turchin is a Professor at the University of Connecticut and was quoted in the Wired article. He has written several books on cliodynamics. His “research interests lie at the intersection of social and cultural evolution, historical macrosociology, economic history, mathematical modeling of long-term social processes, and the construction and analysis of historical databases.”
TLDR: Social scientists calls 2020 chaos with simple models based on past historical patterns.
TODO: Check out the rptR package.
Machine Learning in R
Scikit-Learn vs. Machine Learning in R (mlr) - DZone AI
As I delve deeper into machine learning in R, I get the feeling that R doesn’t get the respect that it deserves when it is compared to Python and the Keras and Tensorflow juggernauts.
If Python and the machine learning glitterati are the single-purpose $1400 knife only used for cutting fish then R at best is that $20 frying pan you have had since college that you use for every meal you cook. Bottom line is that can use R for machine learning just as well as any other software plus a bunch of other stuff too (eggs anyone?)
The article linked above compares SciKit Learn and the mlr package across the following tasks:
- Creating Your Training and Test Data
- Choosing an Algorithm
- Hyperparameter Tuning
- Training
- Prediction
- Model Evaluation
- Decision Thresholding (i.e. Changing the Classification Threshold)
The reviews are slightly mixed, but the article concludes that R seems to compete well against other software.
TLDR: R package holds it’s own against SciKit Learn.
TODO: Add the mlr package to the machine learning resource page.
Have a boss week.