<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Programming on Harlan D. Harris</title><link>https://harlanh.tech/tags/programming/</link><description>Recent content in Programming on Harlan D. Harris</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>harlan@harris.name (Harlan Harris)</managingEditor><webMaster>harlan@harris.name (Harlan Harris)</webMaster><lastBuildDate>Thu, 05 Oct 2017 00:00:00 +0000</lastBuildDate><atom:link href="https://harlanh.tech/tags/programming/index.xml" rel="self" type="application/rss+xml"/><item><title>On How and When to Teach Layers of Abstraction in Programming</title><link>https://harlanh.tech/2017/10/on-how-and-when-to-teach-layers-of-abstraction-in-programming/</link><pubDate>Thu, 05 Oct 2017 00:00:00 +0000</pubDate><author>harlan@harris.name (Harlan Harris)</author><guid>https://harlanh.tech/2017/10/on-how-and-when-to-teach-layers-of-abstraction-in-programming/</guid><description>
&lt;p&gt;&lt;em&gt;&lt;a href="https://medium.com/@HarlanH/on-how-and-when-to-teach-layers-of-abstraction-in-programming-d220c4b5e5b9"&gt;This post was originally published on Medium&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;There’s recently been some interesting opinionated writing in the R statistical programming community about how and when to teach the abstracted, easy-to-use approaches to solving problems, versus the underlying nitty-gritty. David Robinson, Data Scientist at Stack Overflow, wrote a blog post recently called Don’t teach students the hard way first. The primary example was on the data-manipulation tools in the tidyverse, versus the underlying methods in base R, but the discussion was mostly about principles in pedagogy. Some highlight quotes from the original article (which I recommend reading!):&lt;/p&gt;</description></item><item><title>Insights from a Predictive Model Pipeline Abstraction</title><link>https://harlanh.tech/2016/11/insights-from-a-predictive-model-pipeline-abstraction/</link><pubDate>Mon, 07 Nov 2016 00:00:00 +0000</pubDate><author>harlan@harris.name (Harlan Harris)</author><guid>https://harlanh.tech/2016/11/insights-from-a-predictive-model-pipeline-abstraction/</guid><description>
&lt;p&gt;&lt;em&gt;&lt;a href="https://medium.com/@HarlanH/insights-from-a-predictive-model-pipeline-abstraction-c8b47fd406da"&gt;This post was originally published on Medium&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;When building a complex system, it’s often helpful to think about the design of that system using patterns and abstractions. Architects and software engineers do so frequently, and the experience of implementing predictive modeling pipelines has recently led to a variety of patterns and best practices. For instance, when dealing with large amounts of streaming data, some organizations use the Lambda Architecture to handle both real-time and computationally-intensive use-cases.&lt;/p&gt;</description></item><item><title>Parameterizable Reproducible Research</title><link>https://harlanh.tech/2014/11/parameterizable-reproducible-research/</link><pubDate>Thu, 20 Nov 2014 00:00:00 +0000</pubDate><author>harlan@harris.name (Harlan Harris)</author><guid>https://harlanh.tech/2014/11/parameterizable-reproducible-research/</guid><description>
&lt;p&gt;&lt;em&gt;The below is a public version of a post originally posted on an internal blog at the &lt;a href="http://eab.com" target="_blank"&gt;Education Advisory Board&lt;/a&gt; (EAB), my current employer. We don’t yet have a public tech blog, but I got permission to edit and post it here, along with the referenced code. &lt;/em&gt;&lt;/p&gt;
Data Science teams get asked to do a lot of different sorts of things. Some of what the team that I’m part of builds is enterprise-scale predictive analytics, such as the Student Risk Model that’s part of the &lt;a href="http://www.eab.com/technology/student-success-collaborative" target="_blank"&gt;Student Success Collaborative&lt;/a&gt;. That’s basically software development with a statistical twist and machine-learning core. Sometimes we get asked to do quick-and-dirty, one-off sorts of things, to answer a research question. We have a variety of tools and processes for that task. But there’s a third category that I want to focus on – frequently requested but slightly-different reports.
&lt;h2 id="ParameterizableReproducibleResearch-whatisit"&gt;
what is it
&lt;/h2&gt;
&lt;p&gt;There’s a relatively new theme in the scientific research community called &lt;em&gt;&lt;a class="external-link" style="color: #3b73af;" href="http://reproducibleresearch.net/" rel="nofollow"&gt;reproducible research&lt;/a&gt;&lt;/em&gt;. Briefly, the idea is that it should be possible to re-do all steps after data collection automatically, including data cleaning and reformatting, statistical analyses, and even the actual generation of a camera-ready report with charts, graphs, and tables. This means that if you realized that, say, one data point in your analysis was bogus and needed to be removed, you could remove that data point, press a button, and in a minute or two have a shiny new PDF with all of the results automatically updated.&lt;/p&gt;
&lt;p&gt;This type of reproducible research has been around for a while, although it’s having a recent resurgence in part due to the so-called “&lt;a href="http://www.americanscientist.org/issues/feature/the-statistical-crisis-in-science/1" target="_blank"&gt;statistical crisis&lt;/a&gt;”. The &lt;a href="http://www.r-project.org/" target="_blank"&gt;R&lt;/a&gt; (and S) statistical programming languages have supported &lt;a class="external-link" style="color: #3b73af;" href="http://www.latex-project.org/" rel="nofollow"&gt;LaTeX&lt;/a&gt;, the scientific document creation/typesetting tool, for many years. Using a tool called &lt;a class="external-link" style="color: #3b73af;" href="https://www.stat.uni-muenchen.de/~leisch/Sweave/" rel="nofollow"&gt;Sweave&lt;/a&gt;, a researcher “weaves” chunks of text and chunks of R code together. The document is then “executed”, where the R code chunks are executed and the results are converted into a single LaTeX document, which is then compiled into a PDF or similar. The code can generate charts and tables, so no manual effort is needed to rebuild a camera-ready document.&lt;/p&gt;
&lt;p&gt;This is great, a huge step forward towards validation of often tricky and complex statistical analyses. If you’re writing a conference paper on, say, a biomedical experiment, a reproducible process can drastically improve your ability to be confident in your work. But data scientists often have to generate this sort of thing repeatedly, from different sources of data or with different parameters. And they have to do so efficiently.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Parameterizable reproducible research&lt;/em&gt;, then, is a variant of reproducible research tools and workflows where it is easy to specify data sources, options, and parameters to a standardized analytical report, even one that includes statistical or predictive analyses, data manipulation, and graph generation. The report can be emailed or otherwise sent to people, and doesn’t seem as public as, say, a web-based app developed in &lt;a href="http://shiny.rstudio.com/" target="_blank"&gt;Shiny&lt;/a&gt; or another technology. This isn’t a huge breakthrough or anything, but it’s a useful pattern that seems worth sharing.&lt;/p&gt;</description></item><item><title>integrating R with other systems</title><link>https://harlanh.tech/2012/06/integrating-r-with-other-systems/</link><pubDate>Sat, 16 Jun 2012 00:00:00 +0000</pubDate><author>harlan@harris.name (Harlan Harris)</author><guid>https://harlanh.tech/2012/06/integrating-r-with-other-systems/</guid><description>
&lt;p&gt;I just returned from the &lt;a href="http://biostat.mc.vanderbilt.edu/wiki/Main/UseR-2012" target="_blank" rel="noopener"&gt;useR! 2012 &lt;/a&gt;conference for developers and users of R. One of the common themes to many of the presentations was integration of R-based statistical systems with other systems, be they other programming languages, web systems, or enterprise data systems. Some highlights for me were an &lt;a href="http://www.rforge.net/Rserve/news.html" target="_blank" rel="noopener"&gt;update to Rserve &lt;/a&gt;that includes 1-stop web services, and a presentation on &lt;a href="http://cran.r-project.org/web/packages/Rjms/index.html" target="_blank" rel="noopener"&gt;ESB integration&lt;/a&gt;. Although I didn’t see it discussed, the new &lt;a href="http://cran.r-project.org/web/packages/httr/" target="_blank" rel="noopener"&gt;httr &lt;/a&gt;package for easier access to web services is also another outstanding development in integrating R into large-scale systems.&lt;/p&gt;</description></item><item><title>making meat shares more efficient with R and Symphony</title><link>https://harlanh.tech/2011/05/making-meat-shares-more-efficient-with-r-and-symphony/</link><pubDate>Mon, 09 May 2011 01:01:01 +0000</pubDate><author>harlan@harris.name (Harlan Harris)</author><guid>https://harlanh.tech/2011/05/making-meat-shares-more-efficient-with-r-and-symphony/</guid><description>
&lt;p&gt;In my &lt;a href="https://harlanh.tech/2011/05/optimizing-meat-shares" target="_blank" rel="noopener"&gt;previous post&lt;/a&gt;, I motivated a web application that would allow small-scale sustainable meat producers to sell directly to consumers using a meat share approach, using constrained optimization techniques to maximize utility for everyone involved. In this post, I’ll walk through some R code that I wrote to demonstrate the technique on a small scale.&lt;/p&gt;
&lt;p&gt;Although the problem is set up in R, the actual mathematical optimization is done by &lt;a href="http://www.coin-or.org/SYMPHONY/" target="_blank" rel="noopener"&gt;Symphony&lt;/a&gt;, an open-source mixed-integer solver that’s part of the &lt;a href="http://www.coin-or.org/" target="_blank" rel="noopener"&gt;COIN-OR project&lt;/a&gt;. (The problem of optimizing assignments, in this case of cuts of meat to people, is an integer planning problem, because the solution involves assigning either 0 or 1 of each cut to each person. More generally, linear programming and related optimization frameworks allow solving for real-numbered variables.) The RSymphony package allows problems set up in R to be solved by the C/C++ Symphony code with little hassle.&lt;/p&gt;</description></item><item><title>ggplot and concepts -- what's right, and what's wrong</title><link>https://harlanh.tech/2010/03/ggplot-and-concepts-whats-right-and-whats-wrong/</link><pubDate>Sun, 07 Mar 2010 00:00:00 +0000</pubDate><author>harlan@harris.name (Harlan Harris)</author><guid>https://harlanh.tech/2010/03/ggplot-and-concepts-whats-right-and-whats-wrong/</guid><description>
&lt;p&gt;A few months back I gave a presentation to the &lt;a href="http://www.meetup.com/nyhackr/"&gt;NYC R Meetup&lt;/a&gt;. (&lt;a href="http://www.r-project.org/"&gt;R&lt;/a&gt; is a statistical programming language. If this means nothing to you, feel free to stop reading now.) The presentation was on &lt;a href="http://had.co.nz/ggplot2/"&gt;ggplot2&lt;/a&gt;, a popular package for generating graphs of data and statistics. In the talk (&lt;a href="http://www.vcasmo.com/video/drewconway/7017"&gt;which you can see here&lt;/a&gt;, including both my slides and my patter!) I presented both the really great things about ggplot2 and some of its downsides. In this blog post, I wanted to expand a bit on my thinking on ggplot, the Grammar of Graphics, and how peoples’ conceptual representations of graphs, data, ggplot, and R all interact. ggplot is both incredibly elegant and unfortunately difficult to learn to use well, I think as a consequence of the variety of representations.</description></item></channel></rss>