Monday, December 20, 2021

Predict and Control versus Inspect and Adapt

 I came across an interesting idea the other day in the context of data governance (or, rather, governance in general at a tech-heavy company). The argument is that traditional management tends to adopt a "predict and control" mindset, which will only work well in situations in which the leaders really do know best and the workers are not used to (or capable of) any kind of autonomy. Such an approach might be appropriate for people working on a construction site, where there is a clear plan that should result in success if followed, assuming it was created by competent engineers. (Even in this scenario, there may still be some amount of local "troubleshooting" that requires the ingenuity of those closest to the work to handle.)

 For knowledge work, the situation is different, especially in a quickly changing landscape. Although there is obviously repetition at some level, knowledge work tends to be much less predictable than e.g., building widgets from known materials using a well-tested methodology. For this reason, a better approach is "inspect and adapt" -- make whatever course corrections are warranted given what you observe in the current situation. It is rarely possible to mindlessly repeat what was done before and expect a positive result.

The problem arises when there is a push to impose a predict and control structure on a group of workers who are expecting more of an inspect and adapt approach. Workers want to solve the problem, but they know that they will not be able to give specific details about exactly how that will be accomplished. Managers, on the other hand, want "certainty" and create more and more cumbersome processes to ensure that everything is "on track." This leads to frustration on both sides.      

Thursday, December 2, 2021

Should Education Be Like Amazon and Uber?

 Have you ever bought a book that you started but didn't finish, a piece of exercise equipment that is sitting unused in a closet or garage, watched the first part of a movie or TV show only to change the channel before the end, or purchased a piece of clothing that you only wore once? Were those items ever the result of a recommendation from an online retailer (who has access to our past viewing and purchasing habits)? 

I've been thinking about this a lot recently. There seems to be a growing sentiment that higher education needs to move into the modern era lest it lose all relevance. In-person lecture classes are outdated and foreign to a generation of students raised on consumer-oriented apps like Amazon and Uber. To compete in this new modern era of smart phones and personalized experiences, we need to radically rethink the delivery of educational content, harness the power of learning analytics, and jettison all of the outmoded trappings of the past that we cling to for sentimental rather than practical reasons. 

Or so the argument goes. 

I'm not convinced that the path forward is as obvious or easy as others believe it to be. Take the case of recommender system, such as those used in Amazon or Netflix. It seems like a no-brainer to apply a recommender system approach to a course catalog ("Students who took Course A also took Course D.", "Based on your grade in Course C, here are other courses you might like."). Surely that would improve the student experience, right?

But courses are not movies or books. There are prerequisites and graduation requirements that need to be considered, not to mention availability and scheduling. And the feedback mechanism to improve the system moves at a much slower pace (it takes two hours to watch a movie, but 16 weeks to take a class). And, as suggested in the opening paragraph, just because we were recommended a product doesn't mean that we engaged with it once purchased. 

Of course, we could re-envision how educational content is delivered. We could create a series of mini-courses that can be combined in various ways, with evaluation based on micro-credentialing or similar. But make no mistake -- that would be a huge lift. Amazon doesn't write the books it sells. You need sufficient inventory before you can make tailored recommendations.

What about the Uber model? It isn't based on recommendations per se, but rather the ability to connect travelers with willing drivers. This, of course, assumes that the traveler knows where they want to go, though they don't necessarily need to know how to get there. This is essentially what the current system provides -- a program of study leading to a particular degree, led by "willing drivers" (instructors). One could argue that Uber provides convenience -- a ride at anytime to where you need to go. Do our students know where they need to go next educationally? Who would be the "willing drivers" in the "any class, any time" model? (Uber decimated local taxi systems as it rolled out in cities.) What if the route to software engineer (their dream job) takes them through subjects that they are less interested in (advanced mathematics)? Do we give students the ability to vote down prerequisites they don't like? Should we allow them to cobble together any old set of classes they want and call it a degree?

I'm not saying that institutions of higher education shouldn't leverage modern technology to create more efficient processes to improve the student experience, and nothing in this post should be construed as being "anti-technology" or "anti-analytics." My point, rather, is that technology and analytics are not "solutions" but rather "tools" that can be leveraged (or not) in the service of improved educational outcomes that are based on more foundational (and often contested) beliefs around the appropriate role of institutions of higher education; the relationship between instruction and learning; the utility and meaning of prerequisites; the most efficient use of campus resources (financial, physical, and human); the appropriate assessment of educational "readiness," progress, and outcomes; and a whole host of others.

Unless careful and transparent consideration of those core issues is part of the mix, technology- or analytics-driven educational improvement efforts are likely doomed to failure. What presents itself in faculty meetings as "I'm not going to change how I teach" intransigence is not necessarily just an unreasonable unwillingness to embrace modernity; it may be a reflection those underlying, though largely unexamined, foundational beliefs. 

A final caveat -- I am not suggesting that naysayers (myself included) are correct in their assessment of appropriate educational goals or analysis of what will or will not work better than the current system. I merely want to suggest that most educators, even most naysayers, believe they are acting in the best interest of the educational enterprise, at least as they perceive it. 

Thursday, November 11, 2021

The Ice Bucket Challenge (Almost)

Although I'm certainly not as regimented in my thinking as an engineer, I like to think that I have a non-zero ability to look at a simple mechanical process and figure out how it works ("Oh, I see....when you pull on this, that makes this other thing spin which hooks onto that..." etc.). That self-perception was sorely tested during a recent hotel stay. 

I was staying in a very nice room in a conference hotel. When I first got to the room after checking in, I saw that the amenities had been recently upgraded, including a very fancy looking shower setup. Instead of the usual small, round shower head, there was a massive flat square with lots of little water jets. Very posh. Next to that was something that resembled chrome TV remote attached to a flexible tube, which I assumed was a handheld shower extension. In between the two was a large handle that seemed to have three positions, which I took to be off, handheld, and main shower. In my mind's eye, I was already envisioning a refreshing shower the following morning.

But it was not to be. The next morning, I stepped into the shower, turned on the water, grabbed the large handle, and moved it from the 9:00 position to the 12:00 position and waited for the blast of warm water on my face.

And waited.....and waited.....and waited. Water was still flowing out of the faucet, not the shower head.

I moved the lever back to the starting position and tried again, feeling a very distinct click along the way (presumably for the hand held attachment) as I moved the handle from 9:00 to 12:00. Still nothing from the shower head, as water streamed out of the faucet and began filling up the tub.

"Perhaps they were a little too aggressive in their remodeling schedule and forgot to make sure everything works," I thought to myself. I moved the lever back and forth several times, but nothing seemed to divert the water from the faucet. Not wanting to be late for the first conference session, I made do with the water that had collected in the tub to get clean. 

As I was walking back to the hotel after the morning sessions, I asked myself whether it was worth making a fuss to the hotel staff. I know that times have been tough for the service industry due to the pandemic, and didn't want to come across like some entitled jerk. Besides, there is an ice bucket in the hotel room, and I could just use that for my next shower and let them know about the issue when I check out. As I mulled the issue over, I noticed that there was no one in line at the front desk, and decided to just give them a friendly heads up.

I told the woman at the front that there was something wrong with my shower and she said that she would send someone up immediately. It was literally only a few minutes after I got back to my room that I heard a knock at my door and opened it to find a maintenance man saying that he was here to check on a faulty shower.

After letting him in, I retreated to the main part of the bedroom to put on my mask (hotel Covid 19 protocols and all). Seconds later, I could hear the shower running in the bathroom. This led to an exceedingly embarrassing "What seems to be the problem, sir?" moment as I entered the bathroom.  

Long story short, I was right in thinking that the lever controlled which shower head to use. However, it doesn't actually divert the water from the faucet to the shower. On most showers, there is a little handle on top of the faucet that you pull to divert the water. But on this super snazzy posh shower, the diverter handle was actually "hidden" in the curve of the faucet -- you pull on the "elbow" in the faucet to activate the shower. I was so sure that the lever was the main mechanism for the shower, that I neglected to carefully inspect the faucet. 

I thanked the maintenance guy while sheepishly mumbling something about "user error." 

On a positive note, my shower the next morning was much nicer than it would have been with the ice bucket. Live and learn, I suppose.


Friday, October 8, 2021

No More More With Less

When resources get tight, people are often extolled to do "more with less." This is sometimes the result of dips in funding, or perhaps a co-worker leaving suddenly. Whatever the reason, there is now less of what there used to be.

All other things being equal, you can't do more with less. Lots of people would like to believe that you can, but they are just fooling themselves. If you are saying it to others, you are likely really saying "Don't complain, just work harder." If you are saying it to yourself, perhaps you have visions of being "the scrappy team" with the "can do" attitude that impresses the higher ups with their "resourcefulness." That's not a bad attitude, but believing doesn't make it so.

Doing more with less? I don't buy it. 

That said, there are other possibilities.  

You can certainly do less with less. If you lose a team member or have a cutback in resources, you might be able to cut out things that aren't really very useful or efficient. In fact, not doing those might actually be a good thing. Cutting down the number of things you are doing might actually give you time focus on other, more important, things. This might give the illusion of doing more with less, but it is actually doing less with less (or doing different with less, which we'll get to).

It might also be possible to do more with same. If you give yourself a cold, hard look, you might realize that you are not always taking advantage of what is already available in terms of resources to improve performance. This might even include some unlikely candidates, such as taking advantage of sick leave or annual leave to recharge and reset, taking advantage of a training opportunity provided by the company, etc. The resources haven't changed, but you've found a way to make better use of them.   

A final option is to do more with different, and this is the usual result of trying to do more with less. You end up doing less with less, but if you do things differently, it might be an improvement overall. For example, if there is a way to automate a previously manual task, that might free up resources. Getting rid of "zombie" meetings or reports might free up resources. Moving to a different tool or to a managed service might be a net gain in productivity even if team size stays constant or shrinks. 

I like to believe (unless convincing evidence is presented to the contrary) that most people in most workplaces are trying to do an honest day's work. Let's not be dishonest by pretending that it is possible to do more with less.

Thursday, September 23, 2021

The Ice-Cream is Melting

A few months back, I blogged about a project in which the goal was to use an API to grab data from our LMS about which students had completed a particular course, and "reward" completion by means of a free ice cream in the form of credit on their student account. I had written a proof-of-concept Python script to grab the data, which I passed on to others on the project, but not being a software developer or data engineer, I assumed that the project team would put together a more robust solution. Early emails back and forth suggested that everyone had what they needed, so I assumed everything was under control.

Fast-forward to a few days ago (many weeks since the original meetings). Once again, people seemed to be talking about the need to grab LMS data to assess course completion. I had been under the impression that we were already more than a month into a working solution. 

What happened? I don't have any particular insight into who was doing what during the interim, but I can venture as to the general challenge. (I think I first heard these ideas in a presentation years ago by Johanna Rothman.)

Information about a new project is lowest before the project has begun. All we have are assumptions about how long things will take, who will be available to do the work, where the bottlenecks will be (if we even recognize that there will be some), which systems require special permissions, etc. (An exception to this is projects very similar to current or previous work, which can serve as initial estimates of resource requirements and probable timelines.) Our assumptions of how long something will take can easily be off by orders of magnitude if we start from a blank slate. Not just "I thought I could do it in three hours, but it looks like it will take four or five", but rather, "I thought I could do this in an afternoon, but now I realize that it might take several weeks to get it working." 

Because the project scope seemed to be rather small (extract data from a single class), there was likely a shared (and unvoiced) assumption that it should be a relatively trivial task, and there would certainly be no need to prioritize it over the many other, "obviously higher priority" tasks that folks had on their respective plates. By the time people rolled up their sleeves and got to work, unforeseen challenges emerged. 

I would also posit that these assumptions were not just on the IT side, but also on the original concept side. I don't know who was involved in discussions and on what level, but my guess is that IT was not consulted (or the people who might actually be responsible for doing the work were not consulted) before the project was given the green light. 

The moral of the story is that, in a room full of "sure, we can do thats," there is also a need for "has anyone thought abouts?". 


Wednesday, August 11, 2021

Leaves of Three, Let it Be

 Have you ever had one of those minor annoyances that isn't really a big deal in the grand scheme of things, but is just intrusive enough to cast a pall over everything? Like if you step in a puddle of water just before entering a really nice restaurant and can't focus on the juicy steak in front of you because your are distracted by your wet shoe and squishy sock under the table? That's what my last few weeks have been like. My "puddle" was poison ivy.

This series of unfortunate events started one evening. We have a small tree in our front yard surrounding by an "island" of ankle high plants. (I'm sure there's some fancy landscaping term for that arrangement, but you get the idea.) At one edge of the "island" there was some kind of fast-growing "weed" sticking up here and there, creating quite an unsightly mess. As this was right next to where my (newly moved-in) neighbor's yard starts, I thought I'd take advantage of the fact that they were out for the evening and do some quick cleanup. 

I put on a pair of gloves and pulled out anything and everything that was sticking up more than the surroundings. At one point, I stepped onto the "island" to pull some stuff from closer to the interior. The whole job was done in about 15 minutes. 

That happened on a Friday. On Monday, I noticed some raised red scratches or welts on my wrists and arms that were a little itchy. My first thought was mosquito bites or, worse, bedbugs or something. I did briefly consider poison ivy or poison oak, but couldn't recall touching any plants that day. I bought some over-the-counter cream to on my way home from work to help with the itching. 

By Wednesday, it was pretty clear that I was getting a rash that might not go away on its own, so I made a doctor's appointment for that afternoon. That's when I learned that, depending on the person, a poison ivy rash can take several days to appear and, because the plant's oil (which actually causes the reaction) gets on different parts of skin in different amounts, the rash can appear to "spread" as the reaction occurs. 

The doctor prescribed some steroid cream, though I had to wait until Thursday evening for my local drug store to fill the prescription as it was initially out of stock. Even after using the cream twice daily for a few days, the rash still seemed to be slowly "spreading" towards my fingers.

That's when I learned one of those tidbits of information that are kind of scary when you think about them -- the oil from the poison ivy plant can remain active for up to a year after contact, so any oil residue left on clothing, etc., can cause the same kind of reaction as touching the plant, depending on the amount. I had washed the clothes that I had been wearing, but had neglected the shoes! Covid-19 has trained us all to avoid touching our face when we are out and about and to always wash our hands when coming back inside. This made perfect sense as to why I was getting a "spread" to my fingers, but never had anything on my face...

So there was another round of washing (sheets, shoes, pillows, etc.) anything that I might have inadvertently contaminated with poison ivy oil.

Now three weeks on, the rash is finally beginning to subside. I was usually able to resist the urge to scratch, but there were a few days (ironically right at the start of annual leave from work) when the itching between my fingers was quite annoying and frustrating. (It is very hard to avoid moving your fingers if you actually want to do anything.)  

Though dealing with poison ivy is small potatoes compared to so many other problems people are facing these days, it is still a good idea to heed the advice we got as kids, "Leaves of three, let it be." 

    

 

Saturday, July 3, 2021

Proactive Tweaking

 This is the third (and hopefully last) post chronicling my attempts to extract some data from a PDF. While those posts were focused on the challenges, this post is focused a little more on one of the successes. 

To set the stage, I was working with a document that had a chronological list of colleges and universities that had gone to "test optional" for their admissions process. The document was mostly just the list of school names, but occasionally had a date range to the left:

Summer 2011     Bryant University 
                Earlham College 
                Nichols College 
                Anna Maria College

Though this format is quite readable for humans, it is obviously not the most useful format for processing. The me of a few years ago would probably have just saved to text and then gone through the text file manually to pull out the dates. But the current me knew better. I knew that I should do something to make things easier on myself for downstream processing. 

I had a simple idea. I went through the document and prepended the word "DATE:" before each date, then hit return to make sure that the school name was not on the same line. That resulted in, after saving to text, something that looked like this:

DATE:Summer 2011    
Bryant University 
Earlham College 
Nichols College 
Anna Maria College

From there, I could use a simple Python script to loop through each line, ignore blank lines, identify and extract the dates, and create a dataframe that had dates and schools for every row: 

cur_date = ''
results = []
for element in data:
    element = element.strip()
    if not element:
        continue
    if element.startswith("DATE:"):
        new_date = element.split("DATE:",1)[1]
        if (cur_date != new_date):
            cur_date = new_date
            continue
    results.append((cur_date,element)) 

# make dataframe
df = pd.DataFrame(results, columns =['Date_Range', 'Schools'])

 Once I had the data in a dataframe, grouping by date and plotting the count of schools became quite easy.  


Bar chart showing growth in schools with test optional policies over time
 

The moral of this story is that even if you are doing something partially manually, why not add some proactive tweaking to make things easier on yourself down the line. Though this process may not have saved time in terms of making this particular chart (I could have just counted the number of schools in each time period and tracked the results in Excel), I don't consider it a wasted effort. I now have the list of the schools themselves along with the dates for each school in a machine-friendly format for future use, if needed.


Friday, July 2, 2021

Don't Use Cut and Paste

 This is a follow-up to a recent post about regex. The context is trying to take data from a PDF that presented a chronological list of colleges and universities that have adopted a test optional admissions process. As detailed in the previous post, I had tried (and eventually given up trying) to extract data directly from the PDF via a Python program and finally broke down and cut and pasted the contents into a text file from a Word doc that the PDF had been exported to using Adobe Acrobat.

 Now that I had a text file (and a good night's sleep to forget all about regex), I thought that it should be relatively easy to finish up the process. Determined to use Python for at least part of the process, I created a small script to read in the text file that I had created previously, initially printing the results to the screen. 

At first, I noticed that there were a number of blank lines when reading in the file, but I figured I could get rid of those easily enough before saving. But as I looked more carefully at the lines, I noticed the same issue I had run into when reading directly from PDF -- multiple entries on the same line. Huh? How could that happen? 

I don't know for sure, but my best guess is that, whatever the process used to create the original file, not everything that looked like a separate line was actually a separate line. In other words, there was not a line break after everything that looked like a line. (You've probably seen the same behavior at the page level in Word, where things will flow to the next page automatically. You may have even added some additional spaces at the end of a sentence near the bottom of a page to "help" that process along.....)

 The solution was to go back to the exported Word doc (which I had saved, luckily) and, rather than cut and paste, try to save directly to text. Lo and behold, a dialog box popped up asking if I would like to add line breaks. Yes, please! 

With that done, the script correctly read the lines as expected, and I could get on to the business of manipulating the data (which I'll describe in the next post). 

 The moral of the story? Just because something "looks" like columns or lines or whatever in a document, that doesn't mean that it will behave as such programmatically. Be careful when cutting and pasting! 

 

Thursday, July 1, 2021

Now You've Got Two Problems

 According to Wikipedia, regex (short for "regular expression") is "a sequence of characters that specifies a search pattern." There's an old regex joke in coding circles that goes something like this:

You have a problem. You are trying to extract specific information from a string. So you say to yourself, "I know, I'll use regular expressions." Now you have two problems.

This is one of those jokes which makes you laugh and wince at the same time. It's funny because it's true. Here's my story.

 The other day, I came across a chronological list of colleges and universities that have moved to a "test optional" application process. ("Test optional" means that students are not required to submit e.g., SAT or ACT scores as part of their application, a policy which is not new, but became supercharged as Covid-19 wreaked havoc on standardized testing sites and schedules.) Because the list was in PDF format, I thought it might be useful to parse the data to something more amenable to manipulation, such as csv, so that the increase in schools over time could be more easily counted or even plotted. 

The first challenge was trying to initially extract data from the PDF (which is about 17 pages long). Based on some Googling and Stack Overflow posts, I first looked into a Python package called PyPDF2, but that didn't seem to work for me. I knew that I didn't want to spend to much time on this (famous last words), so I tried just exporting to Excel from Adobe Acrobat, but that wasn't much better. I also tried copy/pasting from the "edit" view in Acrobat, but that was also quite frustrating and I quickly gave up. (Seventeen pages is not trivial to cut and paste, and my wrist started complaining pretty quickly.)

 I went back to more pressing tasks for a bit, but had that gnawing desire in the back of my mind to not admit defeat yet. The next time I had a break, I decided to search for alternative Python package and came across another post that had some sample code to extract text from a PDF using the "SimplePDFViewer" module from the pdfreader package. I tweaked the sample code, pointed it at the PDF, and got promising results. Not perfect but any stretch of the imagination (breaks in strange places, empty lines, only one page parsed, etc.), but promising. 

The format of the document is basically a list of colleges (one per line) with occasional date ranges to the left of the names. Most entries also contain some kind of parenthetical material about the details of the test optional process (e.g., "Alfred University (for high school classes of 2021, 2022 and 2023)").  

It took several tries to rewrite the sample code to actually read all seventeen pages of the document and extract the text from each page. I found that using spaces and ignoring the parentheses via regex

 (re.split('\([^()]*\)|\s\s+', page)  

tended to do a relatively decent job of splitting the schools on each page, allowing me to go from something that looked like a single string (to the computer) after the initial extract:

 '  Union College   Franklin & Marshall College (extend optional policy to all)   King’s College   Nazareth College   Mitchell College   Lake Forest College   Salisbury University (3.5 GPA) Summer 2006        Hobart & William Smith Colleges   Providence College Spring 2006  Bennington College     Gustavus Adolphus College   George Mason University (3.5 GPA)   Lebanon Valley College Fall 2005  Knox College     Drew University   Chatham College Spring 2005  Lawrence University   The College of the Holy Cross   St. Lawrence University Winter 2004-2005 Susquehanna University (“Write Option” for all)   Sarah Lawrence College  '   

to something that looked like this (a Python list):

 ['', 'Union College', 'Franklin & Marshall College', '', 'King’s College', 'Nazareth College', 'Mitchell College', 'Lake Forest College', 'Salisbury University', '', 'Summer 2006', 'Hobart & William Smith Colleges', 'Providence College', 'Spring 2006', 'Bennington College', 'Gustavus Adolphus College', 'George Mason University', '', '', 'Lebanon Valley College', 'Fall 2005', 'Knox College', 'Drew University', 'Chatham College', 'Spring 2005', 'Lawrence University', 'The College of the Holy Cross', 'St. Lawrence University', 'Winter 2004-2005', 'Susquehanna University', '', 'Sarah Lawrence College', '']  

But there were still empty strings in the list, as well as elements that didn't parse nearly as well, leading to some multiple entries like: "Illinois State University Illinois Wesleyan University" as a single line in the final processed file.

If regex helped the first time, then of course the answer is "more regex"! So I decided to rewrite the program to read back in the initial processed output, remove blank lines (which worked), and use "regex magic" to split those long, confusing entries into individual schools (which didn't).

At first, things seemed to be going smoothly. I read the file line by line, ignoring the blank lines, and looked for lines that had more than once instance of the word "University" or "College" to identify lines with multiple entries. If no multiple entries were found, the line was saved back to a file. If a multiple entry was found, I would try to parse the line using regex:

 ([\w\s]+(University|College))\s([\w\s]+(University|College))  

which could then extract each of the school names as a regex group before saving. This worked wonderfully, until it didn't. I quickly realized that some schools have "Institute" in the name, though adding "Institute" to the regex was not terribly challenging:

 ([\w\s]+(University|College|Institute))\s([\w\s]+(University|College|Institute))  

The bigger problem was three-fold: The first was that, while most of the troublesome lines contained two entries, some contained many more (like this humdinger: "Indiana Tech Indiana University East Indiana University Kokomo Indiana University Northwest Indiana University Southeast Indiana University South Bend Indiana University of Pennsylvania Indiana Wesleyan University Iowa State University").  I haven't yet been able to successfully modify my query to match "one or more" additional schools on the same line, though I know it is possible in theory (and probably even trivial for someone who works with regex daily).

The second problem was the variation in naming conventions all of which the regex pattern would need to account for. Here are just a couple:

  • <something> College (e.g., Swarthmore College)
  • <something>University (e.g., Harvard University)
  • <something> Institute (e.g., Rensselaer Polytechnic Institute)
  • <something> Institute of <something> (e.g., Massachusetts Institute of Technology)
  • University of <something> (e.g., University of Hawai`i Hilo)
  • College of <something> (e.g., College of Wooster)
  • <something> University <something> (e.g., Loyola University Chicago)

(And don't forget the "false friends" like the string "University of Maryland College Park", which is a single place and not the name of two distinct schools, unlike the "Illinois State University Illinois Wesleyan University" string earlier.)

The third problem was the not insignificant number of typos and similar in the document. This was usually in the form of mismatched brackets (e.g., opening parentheses, but closing brackets; brackets rather than parentheses; doubled opening or closing parentheses; square rather than curly brackets), but such things all would need to be accounted for in the regex. The difference between "Caldwell University {Three-year pilot)" and "Caldwell University (Three-year pilot)" may be trivial and inconsequential for the human reader, but is a world of difference for an automatic parser.  

So, although I had some moments of success along the way, I realized that regex is not going to save the day this time. Maybe this kind of thing is trivial for a regex guru, but I could feel myself getting dragged deeper and deeper into the regex rabbit hole. (There is some email validation regex that runs over 6,000 characters in length! Dealing with all of the edge cases get get pretty hairy.) 

At the end of the day, I gave up, exported the PDF to Word, manually added carriage returns to each date range along with a prepended "DATE:" designation, and copy/pasted everything to text document which I then saved, after using Notepad++ to remove all of the tabs. Maybe tomorrow I'll feel like trying to do something with the file, but regex beat me up pretty good today. 

  

Monday, June 21, 2021

The Bus Stop Problem

I ran into a fairly familiar conundrum (for me) the other day -- how long to wait for a long-running process to finish before assuming that there is something wrong? The details of the particular case are not important, but it had to do with doing with creating a Redshift table from a materialized view using INSERT INTO. I knew that the query would take some time, so I kicked it off and then went on to other things, checking back every once in a while. 

After an hour or so, I began to get a little nervous. Not having any admin access to Redshift itself, I had no real way of assessing progress. I was hoping that the job would finish within an hour, but I also knew that we had other operations that took several hours to complete, so I figured that this might take more time than hoped.

So I waited.

An hour later, I checked in again. Still not finished. Hmm. Maybe three hours is the magic number? I decided to be patient. 

As I kept checking in on my always-in-process query throughout the day, it struck me that I was feeling very much like someone waiting at a bus stop for the last bus of the evening. If you get to the bus stop right on time, but the bus isn't there, you start to wonder if it already came already (in which case you will be waiting all night) or if it is just running a few minutes late. The more you wait, the more nervous you become that you may be too late. But you also don't want to start walking away from the bus stop only to have the bus zoom by without seeing you. Do you wait, or do you walk?*  

I have a friend and former colleague, we'll call him "Bill", who rarely seems to experience this problem. As a long-time IT guru, he has a much better understanding of how various systems interact with each other, what the hardware specs of the machines he is working on are, what the theoretical limits are for certain operations, and how to combine all of that information into a reasonable estimate of expected performance. I've often marveled at how quickly after kicking off a process he will say something like "Hmmm, we should be getting much better throughput than that. I wonder if X, Y, or Z is happening?" I wish I had that ability.

Long story short, I ended up canceling the job after many more hours than I'd care to admit. I don't know for sure, but I think that there was a connection error early on and I was really waiting for the DB management tool to re-establish the connection rather than for the job to finish. Bill would know.....

*My analogy probably works better for someone like me who didn't grow up in a world with Uber and Lyft just a click away.

Monday, June 14, 2021

Pareto Learning Analytics

 The Pareto Principle (knows also as the 80/20 rule) roughly states that 80% of the benefit/cost comes from 20% of the input. (I'm sure there's a more rigorous definition, but this will do for our purposes.) That got me thinking about learning analytics, particularly in terms of the always elusive "learning dashboard" that will finally (in theory) bring the power of data to the business of teaching and learning.

If we grant that there is a Pareto-like effect for educational analytics, this would suggest that perhaps our dashboard won't need very many metrics on it. (Or, perhaps, no matter how many metrics are presented, only a small subset will be actually useful for anything.) Even though modern automobiles collect all sorts of information about the system, only a small subset are presented to the driver. And, of that subset, the only one we really pay attention to in real-time is probably the speedometer. (When was the last time you drove fixated on the engine temperature gauge or RPMs?)

This, in turn, got me thinking about what we could ever expect from a teacher- or student-oriented dashboard, even with "predictive analytics." Sure, it might be nice to know that historically N% of students who got X grade on test Y ended the course with a B+, but does that really change anything fundamental about what the student and/or instructor need to do to change the situation. Do we really need historical performance data to tell us that not leaving major assignments to the last minute is probably a good idea? 

But, you may argue, data allows us to make mid-course corrections. This is probably more true in theory than in practice and is very context dependent. If you are teaching an introductory session (or one of several sections) with hundreds of students, how much leeway is there really to diverge from the planned material? One can certainly hold an "after action report" at the end of the semester, replete with all sorts of information, to try to tweak the syllabus or materials to provide a better experience for future cohorts, but that may be rather tricky to do on-the-fly.

I'm not saying that one should not alter instruction in response to student performance -- I'm all for greater use of real formative assessment in the curriculum. But, rather, my point is that more than learning analytics, the cultivation of an environment in which that type of reflective, responsive teaching is supported (and even expected) is the real prerequisite to educational change, not the provision of a dashboard.

Tuesday, June 8, 2021

Moving Forward Without Prematurely Worrying About Future Bridges

This post is based on a "note to self" from two years ago.

In many undertakings, there is a fine line between being proactive (or energetic or take-charge) and being reckless. Very few people work in an environment where you can merely think your way to success, so the more things you try, the more likely you are to succeed. In general it is good make progress, but not if that progress comes at the expense of other important qualities, such as sustainability or safety, or causes irreparable damage to an important relationship. 

At the other end of the spectrum, there is a fine line between being cautious (or careful or prudent) and being moribund. In many situations, it is good to "look before you leap" to prevent avoidable mistakes or to make sure that you really understand what you are trying to do so you aren't happily running down the wrong path at the outset. At the same time, however, there are many situations in which you will be waiting forever if you wait for perfect information or the perfect design, so you really need to try something to move forward. Even if that approach ends up being abandoned in the long run, you will have learned more about your problem space.

Most people probably fall somewhere in the middle of the spectrum, with some being a little more on the "risk-taking" side and others being a little more on the "measure twice, cut once" side. I might also posit that the same person can exhibit different tendencies over time based on previous experiences. If you have been burned in the past by moving too quickly (perhaps an egregious error made its way to the the final version of the project and revealed itself in a very public way), you will likely have that in the back of your mind when similar conditions present themselves. On the other hand, if your deliberate approach has caused you to lose opportunities (or funding) to others "who can get things done," that may also influence your attitude moving forward.

One might imagine that there are certain organizations which tend to attract folks that are to one side or the other of the continuum. Even so, within an organization, or even a team, there may be a range of attitudes. And, of course, a proactive approach may be more appropriate for some projects while a cautious approach is more appropriate for others. Identifying your own "default" attitude can be useful, as can developing the ability to articulate specific reasons for why a proactive (or cautious) approach is warranted in a given situation. Otherwise you run the risk of being seen as reckless or moribund. 

The title of this post comes (obviously, I assume) from the saying "we'll cross that bridge when we come to it." Pretending that the bridge is of no consequence as you barrel towards it is probably reckless. That said, worrying endlessly about how you will cross the bridge is futile if that prevents you from ever starting the journey towards it in the first place.

Monday, June 7, 2021

When an AI Presentation Makes You Think of Proficiency Testing

 This is a very belated post about a presentation that I saw many months ago (summer 2020?). If memory serves, the presentation was from a NASEM (National Academies of Science Engineering Medicine) event, but I don't recall the details or the speakers. Like so many virtual talks during these pandemic times that I had planned to view with rapt attention, I ended up listening to it in the background while working on more pressing tasks.

 I do recall, however, one of the discussions which was focused on the topic of AI fairness. One thing that made me perk up was when of the panelists noted that although we rely on supervised learning algorithms to solve many real-world prediction needs, they are limited in scope of what we can predict because our predictions will be for the same relationships on which the model was trained, such as the creditworthiness of a credit card applicant given demographic, income, banking history and other such information. 

This made me recall the discussions of (educational) test validity from when I was in that world. At the end of the day, we really don't care about performance on the particular assessment tasks per se ("Hey, Tommy got Item 6 correct!"), but rather the inferences that we are able to make based on performance across all of the assessment tasks in the test battery. And we don't really care about predicting performance on the test battery, but rather the inferences that we can make about real-world performance in untested domains. 

In the case of language proficiency, for example, we may use a thirty minute oral proficiency interview with a very limited number of tasks to assess how well the examinee might perform in a virtually infinite number "real world" language interactions post assessment. Are they ready (linguistically speaking) to lead the students on a study abroad program? To staff the front desk at an international hotel? To work as a foreign area officer?  In other words, the tasks on the test do not constitute the sum total of the domain of potential to which you want to make the inference. 

Thinking about learning analytics, we have the same challenge. Does it really do us any good to predict student performance in a course if that requires us to never change the course assignments because those were the items used to train the predictive model? What we need is a model of student performance that treats assignments as samples from a larger pool of potential assignments. We're not there yet. 

Other parts of the discussion made me think of the distinction between norm referenced and criterion referenced decisions. Much of AI fairness looks at whether or not group level rates are equitable given the respective rates in the population. Are the false negative rates proportional? That the error rates are equitable at the group level (in a norm referenced kind of way) is little consolation if e.g., you are the one falsely denied a raise. 

(If this post seems a little jumbled, it is because I was trying to reconstruct my thoughts based on a couple of phrases that were jotted down here months ago with a "make a post out of this" reminder to myself.....)


Saturday, June 5, 2021

Don't Forget the Cone

In keeping with the ice-cream metaphor, this is yet another follow-on from a post a few days ago that talked about creating logic and a proof-of-concept script that would check for LMS course completion (to identify students eligible for a free scoop of ice-cream). 

I had created a script to 1) get the most recent roster for the target course (as students could self-enroll), 2) check that roster against a list of previously identified finishers and filter them out, and 3) check the remaining students in the roster to get their completion status. As the script runs, it saves information to three csv files: the current roster for the course (overwritten each time the script is run), a running list of students who had finished the course (appended to each time the script is run), and a "recent completers" list of those students who had finished the course since the last time the script was run (created with a timestamp each time the script is run, but empty if there are no new "completers"). 

Although my script is not being used for the official project (it was only intended to illustrate how the logic might work), I've been running it a couple times a day to see how it performs now that the course is live. 

The first time I ran it, as expected, I noticed a few places where my script was not quite working correctly. Because I only had access to finished courses when writing it, the number of completions never changed no matter how many times it ran. Once I pointed it to the live class, I noticed that it was appending the complete list of "completers" each time rather than just the "delta" between the first and last time it was run. A few code tweaks here and there seemed to get things working as intended.

The next day, I ran the script again. It caught the updated class roster, correctly identified previously completed students, and saved everything where it should be. (Because the class is targeting incoming students, the roster expands rather quickly as they self-register.) I ran the script again a few hours later and it worked perfectly again. 

I was pretty pleased with myself. 

The next day, I ran the script first thing in the morning, and again it worked just as expected. By this point, I was becoming fairly convinced that the only potential glitch remaining would be if the number of students got too large there might be a bottleneck when checking completion status, as that is a separate API call for each student. I added a simple "end time - start time" calculation to keep track of how long things were taking. I ran the script again a couple of times throughout the day. So far, no problems.

Now I was really pleased with myself. 

The next day, I again ran the script first thing in the morning, and again it worked flawlessly. The overall time that the script was taking was slowly increasing as more and more students self-enrolled, but the rate was much less than I expected because I was filtering out those students who were already finished, so the overall number to check was still quite manageable. 

And then it happened.  

I ran the script again a little later in the day. I had a couple of print statements here and there so I could get a sense of where things were in terms of execution, and one that I didn't expect to see popped up: "No existing completions found."  Huh? That should only happen the first time I run the program....

One of the first things that the program does it to check for the "completed students" file so it can use it to filter out those students whose completion status has already been verified. Because, by definition, there will be no completed students the first time the program is run, I wrapped the piece of code that reads the file in a try-except block because it will throw an error if it tries to read a non-existent file. The "No existing completions found" message is from the error-handling part, which prints out that message and then creates an empty "completed students" list. I got that message the very first time I ran the script for the "live" course, but that was to be expected and I hadn't seen it since....

I looked at the directory where the output files were stored. Perhaps I had inadvertently deleted the file? Nope, everything seemed to be there. In fact, because my code was written to handle the exception (*any* exception), produce the message, and continue on, and because the completed student file appends results, I now had duplicates of "completers" in the saved file.

I was beginning to feel a little less smug (and quite grateful that my script wasn't the linchpin in the actual project -- see my other ice-cream post). 

So, what had happened? After a bit of Googling and head-scratching, it appears that the issue was one of file encoding. My script was failing to read the file because the Pandas read_csv default is utf-8. However, one of the records must have included a special characters (probably in a student name) that caused an error reading the file, throwing an exception. Explicitly setting the encoding to ISO-8859-1 in the read_csv statement removed the error. 

There are actually two morals to this story. The first is that the difference between a fragile script and a bullet-proof script may not be apparent until an unanticipated edge-case appears. Not being a software developer, it never occurred to me to think about things like file encoding. Just because a script can run for a few days without issue does not mean that it is production ready (as we have just seen). 

The second moral is that I should have been more specific in my error handling. When writing the script, it threw an exception when it couldn't find the completed students file. But rather than handling that *specific* exception, I wrote the script to handle *any* exception in the same way.  This allowed a completely different error to be treated the same as the error that I had anticipated, with obviously unfortunate consequences.

Friday, June 4, 2021

Another Scoop of Ice-cream

This is a follow-on from the last post where I talked about projects things that involve "data" may also require skills that are not necessarily part of the data analyst/scientist tool box (even though others, and even ourselves, may assume that we have them). This seems to be particularly noticeable with areas that are adjacent to, or even overlapping with, some of our daily activities, specifically around infrastructure and coding.   

I've been writing scripts in R and Python for a number of years, but never trained as a software developer and do not have a background in computer science. For most of what I need to do, this has not seemed to be much of an issue. But, of course, I don't know what I don't know, and that can be dangerous. Like so many other areas of endeavor, you can get pretty far with a surface understanding. (A Pareto principle-like idea, 80% of the problems can be solved with 20% of the knowledge/techniques.)

The unfortunate side effect of this, however, is that there are times when the techniques that work fine for developing a small, local script are completely inappropriate for other situations. A fairly trivial example is debugging an issue through the use of "print" statements or just inspecting program output through an IDE like RStudio. This is fine if you are sitting at the keyboard and able to watch the program as it runs, but completely useless if your program is running on unattended on a server and triggered by a scheduler. Unless you have become familiar with logging and error handling, you are flying blind. 

In the same vein, rather "inefficient" (from a computer science point of view) programming techniques may go virtually unnoticed when working with a relatively small data set locally. That your for-loop takes .2 seconds to iterate through the 100 records in the single file that you are working with locally may not even be noticeable. However, if you use that same technique to iterate over the records in 19,000 files you are now contending with over an hour of processing time. This can become a real issue if you are paying a per minute computing charge in a cloud environment. 

The other unfortunate side effect is that our estimates of effort and how close we are to "ready" can become very biased. Once we have our local process working, we get the false sense that we have conquered the hard part (and we probably have, in terms of our portion of the work). But because we are only familiar with our own working context, we might greatly underestimate how close to "production ready" our locally-produced code or data process may actually be. It is like looking at the tip of the iceberg and ignoring everything under the water.  Moving from a desktop to the enterprise may not be a matter of "just" automating or "just" scaling up what we have working locally -- it may be much more complicated and involve all sorts of issues, contingencies, and edge cases that we never even contemplated. 


Thursday, June 3, 2021

The Ice-cream Problem

As one of several people responsible for data-related requests about our enterprise Learning Management System (LMS), I was recently involved in several meetings relating to a seemingly simple proposition -- incoming students to the university would self-register for a course in the LMS (using their newly acquired university credentials), and upon successful completion of all of the course modules, they would be eligible for a free scoop of ice-cream at a shop in the student union on campus.

At first blush, it is not surprising that this would be seen as essentially a "data" issue. Our team regularly pulls data from the LMS to investigate trends in LMS usage (number of published courses, assignments per course, etc.), so one could imagine that the core issue to solve is how to query the data to identify the number of completed students for that particular course. And, to be sure, the ability to retrieve that course completion data from the LMS is indeed a prerequisite for the "complete the course, get some ice-cream" idea. 

However, the ability to retrieve the data is only part of the challenge. The data must be retrieved in a timely fashion. Our normal data process is very much retroactive, e.g., "What did LMS activity look like last semester compared to the semester before?". As such, the LMS information in our reporting database lags the LMS system by at least a couple of days. It defeats the purpose of the ice-cream incentive if a student who completed the course has to wait several weeks before that completion is verified in order to get their free ice-cream.

Luckily, the LMS also includes an API, and potentially relevant endpoints seemed to exist for the data that was needed. (The challenge of confirming that the API results did indeed include the data we need without having a sample of the course to use as a test case is an issue for another post.) We do occasionally use the API to get targeted data that is not readily available from our database.  

Another challenge is where the data needed to flow and how frequently. The "free" ice-cream is actually provided in the form of a credit in the amount of one scoop of ice-cream associated with the student's university ID card which can be swiped to be redeemed. This means that the data need to end up in a place where that card swipe system can take over the process. In other words, this is not only a "data" issue, but also an "integration" issue.

Lots of the pain points in integration are hidden if you never have to deal with them. For most of our daily data work, we explicitly control the scripts that we run and have access to the locations where the data are stored, with most of the authentication processes happening seamlessly behind-the-scenes. (And we are there to enter our credentials if prompted.) We don't think twice about manually running a script that points to a local folder or shared drive. But we are logged into the system what happens. To automate the ice-cream data pipeline the script has to hit the API (with the appropriate LMS credentials to do so) and save the data in the appropriate place (with the appropriate file system permissions to do so) via an automatic scheduler that has been provisioned (by someone with the appropriate permissions to do so), and then populate the swipe system (with appropriate permissions to do so), all without human intervention.

As for my part, I thought through the logic that one would need to implement in order to query the API for the current student roster (as student could self-enroll, the roster is always increasing), check the current roster against a list of completed students and filter them out, and then hit the API again to check for completion status of those remaining. I created a proof-of-concept script which implemented the basic logic for the LMS data side of the problem and shared that with others on the team (who then engaged their developers). I'm not sure what, if any, of my proof-of-concept script made it into the final version, but I don't feel slighted. For anything involving non-trivial integration, it makes much more sense to give the appropriate LMS credentials to a software developer who can put all the pieces together rather than trying to make a "data person" into an integration specialist. 

 

 


 

Thursday, March 4, 2021

Are We Measuring Student Engagement or Just Student Compliance?

 I've recently begun toying with the notion that many of the learning analytics metrics that we measure are likely to be telling us more about student compliance with course requirements than student engagement per se. This is particularly true when looking at data from an LMS (learning management system). Unlike an online tutoring system, where learners are actively engaging in instruction and practice activities while they are using the tool, an LMS is primarily just a repository of course materials. This is especially likely if the course is being taught face-to-face (ah, those were the days). Thus, metrics like time spent in the LMS are, at best, measures of "engagement" with the LMS itself, not necessarily the learning materials contained therein.

 Of course, there are "interactive" elements to LMS courses, such as discussion boards and quizzes, and the shift to remote learning has created a greater reliance on these tools. Even so, students are not likely to make use of them unless they are required elements of the course. If a course requirement is that students respond to at least three discussion posts by other students, most will dutifully do so. In a course where the discussion board is optional or not graded, there will be very little usage.

One could instead use very broad measures of engagement, such as whether or not a student visits the course site at all during the week.While such measures might be better correlated with ultimate attainment in the course, we are still essentially measuring as aspect of compliance, e.g., attendance. 

The challenge is not just that we are using proxy measures, which we are, but that we use "engagement" as a shorthand for a positive or desirable attribute without defining exactly what we mean. And, if we are using course outcome as the dependent variable for the effect of engagement, what does that mean? Are "easy A" courses by definition the most engaging? Are students who get higher scores in harder courses "more engaged" than students with lower scores?

Like so many things in life, the more I ponder, the less I know.