March 5, 2017

Python is the language of choice for APIs

“Software is eating the world” is a common refrain in Silicon Valley. When you dig a little deeper, you find that that APIs make that happen. API stands for application programming interface. APIs are how software talks to other software. APIs are the special sauce that enables you to push button on your phone to quickly summon a ridesharing service to your precise location.


Why is Python language of choice for APIs? Readable. Python is designed to be easily read. Not only the built-in parts of the language are human readable, there are also strong cultural norms to have Python code be understood by everyone at first glance. Thus, there is more time spent on "what" the code is trying to than on "how" the code is written.

Another of reason is “Low bar & high ceiling.” It is easy to be productive quickly, but the language is not inherently limiting. You can write your first Python program after a couple of hours. People can be proficient in Python within a week or two. Yet, it would take a lifetime to fully understand The Zen of Python. Python is often used to write code quickly to test new ideas but that same code can be scaled to run large systems.

In particular, Python is the dominant language for data-centric APIs. The two packages that have swept through the Data Science community are Apache Spark and Tensorflow. Spark is a Big Data processing package and TensorFlow is a Deep Learning package. Both packages have APIs in several languages but Python is common to both. However, neither package is natively implemented in Python! Apache Spark is implemented in Scala; Tensorflow is implemented in C++. Python is just a friendly user interface that manages the underlying complexity.

Python allows Data Scientist to focus on their work, not on the implement details.

December 23, 2016

Digital sandwich for 21st Century education

Digital is a core aspect of students' lives and can no longer be an add-on to modern education. A digital course does not mean taking an existing course and converting everything to pdfs and putting them on a static website. Courses should be digital-first with digital elements enmeshed into the educational experience.

Here is what a "digital sandwich" looks like in my classroom:

1. Before class (digital)

I am, on my best day, a modestly good lecturer (I have other strengths that I leverage to create a learning environment for my students). The Internet has the world's best lectures. It would be a disservice to my students not use the best available resources for them. My role as an instructor is to create a curated list of the best lectures.

I extend pre-classroom preparation materials to include book chapters, technical papers, and blog posts.

My secret sauce are digital workbooks. They are interactive companions that accompany the preparation materials. They a typically Jupyter Notebooks. There are embedded videos or links followed by questions and coding activities that check for understanding. This transforms the student from a passive observer to an activate participate in the educational process. Since the workbooks are digital, they can be automatically scored (often with immediate feedback to the students).

2. In class (in-person)

I spend the limited and precious classroom time working through complex concepts examples, answering student questions, completing worked examples, and sharing personal anecdotes that connect the abstract concepts to the student experience. The goal is to provide the unique experience and social learning environment that can not be had digitally.

3. After class (digital)

Much of the learning takes place outside the classroom. It takes time for a student to integrate new material into their previous understanding of the world. My goal is to continue to offer support and guidance after a student leaves the physical classroom.

The primary medium for digital support is group chat. Like everyone in Silicon Valley, the flavor of the month is Slack. I have experienced that group chat is more effective and efficient than email or forums. Group chat is an informal conversation with lower stakes than email and real-time engagement missing from forums. Group chat is also a platform for peer-to-peer learning. The many-to-many connections removes me as a bottleneck for question answering. Group chat is also a frictionless medium to share interesting links that show the real world application of classroom concepts.

Another aspect of post-class digital support are updates to lecture materials and exercises. I demonstrate the course is a joint production of both the students and the instructional team. I update lecture materials and personalize exercises on the fly. I fix my (many) typos, add additional materials, and clarity exercises.

The digital sandwich is my interpretation of Blended Learning, a refinement of the Flipped Classroom idea.

December 9, 2016

Monte Carlo for the win

Faster Space-Efficient Algorithms for Subset Sum, k-Sum and Related Problems shows the power of probabilistic thinking.

Computer Science has decades of deterministic baggage to overcome to move forward, especially to handle the speed and size of modern data.

Data Science's superpower is uniting Computer Science fundamentals with Statistics to create novel solutions to theoretical and applied problems.

Academic disciplines change "one tombstone at a time". Data Science doesn't have an Old Guard telling the field what the rules are. There is freedom to play everywhere.

November 21, 2016

Word2vec algorithm: Made as simple as possible, but no simpler

Recently, I have given a 3 hour workshop and 30 minute talk on word2vec. I would be delighted to talk about it again. LMK...

November 19, 2016

My life's mission



I'm on a mission to democratize technical data skills (i.e., math, statistics, programming, and data analysis). What today is bundled together as "Data Science".

Science and technology (in the broadest sense possible) are very effective in improving the quality of life for people. When smart people solve hard problems then share their solutions with the world, the world is a better and more interesting place. I hope to help that process by creating more highly skilled people who can both ask and answer the right questions.

I have been on this path for the last 13 years. I have done this as a Lecturer, Researcher, Tutor, Data Scientist, Mentor, Professor, etc. However, my mission transcends those labels of convenience.

Previously, I saw the traditional academic system as the greatest force multiple for myself. I could reach and help change people in a deep way through specific and personal connections. However, the incentives of that system are badly bent (possibly broken). I have turned to a nontraditional academic system, including community organizing and Open Source software. For now, that ecosystem works better to help people learn and grow in "Data Science". In future, there will be even better systems and I'll be there.

May 12, 2014

A couple of old model fitting tricks

I picked up many modeling tricks in graduate school working in a computational neuroscience laboratory. We doing machine learning, but we don't know at the time. We called it "automated model fitting." We used custom (and very finicky) algorithms in MATLAB. Now people are blessed with scikit-learn. These ideas might help out for edge cases:
  • Have good "fake" data. "Fake" data allows for testing of the algorithms. There is an art to dummy data, it should be noisy but allow the models to converge.
  • Linearly transform the data so all dimensions are within the same order of magnitude. Some models have trouble with weighting noise parameters on different scales.

May 5, 2014

My recent failures

I fail all the time. I recently failed at completing several MOOCs. I'm one of the unwashed masses that started but didn't finish.

Even through attempting, I learned something from each course. Given my personal value in life-long learning, improvement is my measure of success. Completion is easier to quantify and a more commonly accepted measure of success. A "factory" model of education values completion. A half completed commodity has little value. A factory stops work on a product and ships it. My professional life is continuous delivery. Any incremental improvement adds value to a continuous delivery system. I picked up new viewpoints on existing concepts that improved my understanding of the world through "failing" at MOOCs. I didn't get credit but I got value.

April 28, 2014

The neurobiological limits of free will

Animals have limited, possibly no, choices. Biology and circumstances are their destiny.

I, being a human, have choices. They are limited but present. Like all humans, I have deep neural ruts (i.e., habits) that guide most of my thoughts and behaviors. They are not a permanently fixed boundaries; I can change them (slowly). I have the free will to choose to change those habits. It ain't easy (or quick) but possible.

Understanding the neurobiology can help. Knowing that simple repetition is more important than willpower. Knowing that old habits are easily cued, even after long periods of being dormant. Knowing that all brains have strong default systems, mostly around fear, that don't serve higher callings in the modern world. Knowing that there is never conscious access to unconscious processes, thus just trusting that providing "open space" will allow unconscious processes to manifest.

I'm humbled because I don't change even what is within my very limited ability. I "know" the rules but still don't play the game of change well.

April 21, 2014

Web 3.0 (possibly)

Web 1.0 connected ideas with webpages and hyperlinks.

Web 2.0 connects people with social media and mobile.

Web 3.0 could connect physical things with automation.

The Internet of Things (IoT), both the concept and the necessary features (e.g., infrastructure, tools, and protocols), are gaining momentum.

Each successive stage of the web relies on previous stages. The previous stage becomes the assembly language of the next stage. If static web content can be generated automatically, there is then engineering bandwidth to tackle dynamic web content.

The number of processes that can be automated continue to increase. We are now the cusp of the next generation of web automation - the cost of aggregating the information from the physical items, from consumer products to industrial processes, is dropping below the return-on-investment threshold.

The potential amount of data from this transition is staggering. The previous two versions of the web each redefined "big data." We are on the cusp of another inflection point. There isn't enough engineering bandwidth to make sense of this data with static / human-based systems.


The most promising direction is automated learning, aka things that get smarter the more you use them. Previous generations of technology were static. Excel or your browser doesn't get any better the more they are used. However, there is now software that learns as you use it and search algorithms can get smarter the more they are used.

Machine learning is the tool to leverage the promise of Web 3.0.

April 15, 2014

April 14, 2014

The connection between broadsiding and blogging

On a recent visit to the National Archives, I was engrossed with a broadside display.

Broadsides are the blogs of their day, a blend of art and news.

Both have a lower barrier to entry compared to other respective contemporary formats (e.g., treatises or whitepapers). Both are designed to be ephemera. However, an individual exemplar sometimes resonants beyond its intended lifespan and audience. That long-term impact potential is greater for blogs. Since blogs are digital, they are searchable and sharable without limits. Since broadsides are printed, they are static and nonscabable. Their size and content is limited by the properties of the physical press, printing press of the broadside heyday most cheaply produced a single page.

The illusion of being ephemera makes both more accessible, thus encouraging writing (and publication). Even if the writing is intended to be disposable, more writing makes better writers.

April 7, 2014

Treating manuscripts like pieces of code

As I revise a manuscript, I find bugs (i.e., things that are not the way they should be). If they can be fixed in less than two minutes, then I immediately correct them. Otherwise, I stack and track via a bug list. My bug list has two contexts: full focus and brain dead.

Brain dead bugs can be fixed with minimal cognitive effort. For example, fixing the axis on a figure.

Full focus bugs require cognitive horsepower. For example, synthesizing previous research.

March 31, 2014

Sometimes sharp tools aren't needed for interesting problems

Sharp tools help at the edges of science and business. If your tools are dull, you simply cannot keep up. However, you probably do not need the Large Hadron Collider to make a discovery or a High-Performance Computing Cluster to make your business idea a reality.

Given the tools you have access to at this instant (which is probably more than most people had 5 years ago), how can you make a dent in the universe?

March 24, 2014

Infastructure over willpower

I have very little willpower and don't like use the little amount I do I have.

Instead, I choose to create an infrastructure that makes the "right thing the easy thing." I set a timer for stretch and perspective breaks during head's down work. I keep my computer and web browser "clean." They only show me the right thing at the right time.

I carefully construct that infrastructure to be right for the given context. Very few options (or none) in my physical or virtual environment gives me the freedom I'm looking for.

March 17, 2014

Drowning in (the) waterfall (of) research plans

Most researchers plan too much (if they plan at all). I have seen Gantt charts and reverse calendars for research projects that do not reflect reality by the time the laser printer spits them out.

By definition, you conduct research because you do not know everything. It is foolish to think you will not discover new information about your project or your process by "doing the work."

This is where Agile software practice can inform research practice. Set a quick iteration goal (e.g., collect pilot data or run primary statistical analysis). Then assess what was done and how it was done. Adjust course.

Are we running in the right direction?

How can we run faster?

Daily stand-ups wouldn't hurt either.

March 10, 2014

My focus on commonalities over differences

Humans are remarkably similar. As a species, we have relatively little genetic diversity[1]. There are cultural differences. But IMHO - our commonalities trump our differences.

I rather spend my limited time understanding the rules of humanity than the exceptions.

My scientific research focused on the basic process growing out the unique neurobiological constraints of humans. Much of psychology focuses on minor differences. The narcissism of minor differences is a sticky subject. Endless fascinating but has only a fraction of the power of unlocking our shared fundamentals.

  1. Probably a result of a near extinction-level event.  ↩

March 3, 2014

Creating playgrounds

Everyday I create playgrounds. Some of them are physical, most of them are virtual.

I see who comes to play with me. If not enough of the right people want to frolic, I change the structure or the rules. It is easier to change virtual playgrounds, but there is something magic about exchanging molecules.

I don't stress if the playground is right the first time (or ever "perfect"). I baked-in continuous change with continuous improvement is a byproduct.

February 24, 2014

Working with visionaries

Visionaries are big dreamers. They are a driving force for change in the world. They are the spark that ignites the fire of revolutions.

They are also crazy makers. Their ideas are unbounded by external constraints. They overextend themselves and the people that work for them. They switch directions like the wind on top of Mount Everest.

I choose do not chase the wild ideas of visionaries. Ideas are real to them; Ideas are their world. I listen (and acknowledge) their world but always pause before I allow their idea-based world to influence my action-based world. I take time to weigh their ideas against the discrete, real-world actions steps necessary to manifest them.

February 17, 2014

Modern day mathematician

I have always wanted to be a mathematician (weird I know). Their job is playing with pure ideas and solving hard problems. All a mathematician needs is paper, a pencil, and a waste basket.

There is an old proverb - "A mathematician never soils his hands with calculations." First, ignore the gender bias. Second, in the time before computers that perspective made sense. Actual calculations waste precious time. Now that world view is limiting. Testing ideas, at any scale, is computational efficient. However if there is little (or no thought) for Big O, it is difficult to compare multiple correct methods.

I'm pragmatic in choosing between abstract calculations of run time and Monte Carlo simulations. I choose the quickest, best time estimation method for a given problem. But I always makes estimates. A modern day mathematician has to realize the constraints of reality on pure solutions.

February 10, 2014

Action-oriented reading

Just reading an item (and most likely forgetting it) is a low-value activity for me. Reading should be more than just providing the raw material for the cocktail party grist mill. I want to make a dent in the universe - make the world a better, more interesting place. I read as a means towards that end.

I ask myself:

  • What will I do differently because of what I just read?
  • How will I take what I have read and manifest it as visible, positive change?