Wednesday, February 28, 2018

Learning Outcomes

I came across an interesting essay entitled "The Misguided Drive to Measure Learning Outcomes" by Molly Worthen in the NY Times Sunday review. In it, she bemoans the positioning of colleges as "glorified trade schools" rather than places of intellectual and personal exploration. She places much of the blame on the desire to quantify the student experience, arguing that not only does it trivialize the nature of intellectual pursuits by reducing them to checklists of desired outcomes, it also diverts focus from the larger societal factors (e.g., erosion of federal education dollars, unequal access to quality primary education, need to work part-time during the school year) that students face. 

As someone who greatly benefited from a "meandering" liberal education, I am very sympathetic to her argument. At the same time, I do wish that she had provided some references to her claim that "proponents [of learning outcomes] have struggled to provide much evidence -- beyond occasional anecdotes -- that [learning outcomes] improves student learning". Given that many folks in the learning outcomes movement are former educators themselves, a point the author makes explicitly, it would be nice to know specifically what evidence has, or has not, been amassed. And, in the case where some positive evidence exists, it would be important determine whether that evidence simply reflects movement on a scale purporting to assess e.g., "critical thinking" or actual evidence for the targeted ability.

That said, I found her essay a powerful reminder that the drive to become a "data driven" institution must be tempered with the recognition that there are unmeasured aspects of the college experience that may be more important.

I'll leave you with a quote from the article:

If we describe college courses as mainly delivery mechanisms for skills to please a future employer, if we imply that history, literature and linguistics are more or less interchangeable “content” that convey the same mental tools, we oversimplify the intellectual complexity that makes a university education worthwhile in the first place. We end up using the language of the capitalist marketplace and speak to our students as customers rather than fellow thinkers. They deserve better. 

Tuesday, February 27, 2018

We'll Do It Live!

As a student, I was never a huge fan of tests (who is?), but it was when I became an instructor that I really began to understand just how strange educational testing can sometimes be. 

After college, I got a job teaching English in Japan at a private high school associated "technical college" that shared the same campus. Unlike many of the foreign English teachers in Japan (at least at the high school level), I was hired directly by the school rather than through a third party program. This meant that I was responsible for creating and administering tests in my classes. 

At the high school, I was teaching a class called "English Conversation" to all of the students. There were over 600, and I saw them in groups of 45 or so once a week for 50 minutes. (In most Japanese schools, the students stay with the same "homeroom" group all day, and the teachers move from classroom to classroom rather than the other way around.) The students were what might be called "false beginners" -- they had been studying English for at least three years in junior high school, but tended to not have much in the way of productive ability. My lessons consisted of the usual tropes -- introductions, favorite things, daily schedule, etc. 

When the mid-term tests rolled around, I had only seen each group for a couple of classes. Nevertheless, I was expected to give them a mid-term just like all of the other subjects. Tests were by subject and class year, so all first year students would take their math test while all second year were taking their history test, and so on. I put together a short multiple-choice quiz based on the handful of phrases that I had taught up to that point ("How are you?  a) I am fine, b) I am a student, c) My name is Kenta, d) Yes, I do", etc.). I anticipated that the test would take about 15 - 20 minutes for the students to finish.

The evening before the exams, the lead English teacher told me that because the class was "English Conversation," I should deliver the test a "listening" test. Not only that, the test needed to fill the entire 50 minute exam period, otherwise the students might get rowdy and disrupt the "real" tests being given in the other subjects. Because there wasn't enough time to rewrite everything from scratch, the only solution was to deliver the test "live" over the school's PA system. (Because homerooms were grouped by class year on different floors of the building, it was possible to target just the relevant rooms with the PA system.)

The day of the test, I sat before the announcer's microphone on the school's PA system and proceeded to read my multiple-choice test out loud, as s-l-o-w-l-y a-s p-o-s-s-i-b-l-e to take up as much of the 50 minute period as I could. Towards the end of the quiz, when I was really trying to stretch things out, I think that there was a good 5 seconds or more between the item number, the prompt, the letter of each option, and the text  of each options. Try it yourself to get an idea of how absurd the whole thing sounded:

1. (5 sec) How are you? (5 sec)
  a. (5 sec) I am fine (5 sec)
  b. (5 sec) I am a student (5 sec)
  c.  (5 sec) My name is Kenta (5 sec)
  d. (5 sec) Yes, I do (5 sec)

After this dismal mid-term experience, I tried to create a longer "script" for the final exam, enlisting the help of another English teacher to play my counterpart in short conversations and basing the questions on the contents of the conversations rather than grammatical points. This was better, but we were still trying to speed up or slow down the delivery based on the amount of time left in the test period, and the absurdity of the situation caused us to giggle uncontrollably throughout -- thank heavens for the mute button on the PA console!

By my third go round, I had moved to prerecording everything on cassettes. The moral of the story?  Never try to do a listening test "live."

Saturday, February 24, 2018

Steve Jobs Invented the Computer

Without trying to make this blog too political, one of my pet peeves is the general lack of appreciation for the impact of government investment in research on the technology that we take for granted in our lives. Perhaps this is because much of my career has been spent in jobs that are supported by federal or state funding (via grants, contracts, and/or by virtue of being employed by a state institution). Because of that, I tend to bristle at the suggestion that such institutions are a "waste" of taxpayer money and that "the private sector" is the place where "real" discoveries and innovation happen. I would not surprise me to find people who literally believe that Steve Jobs (or Bill Gates) invented the computer. 

As an occasional C-SPAN junkie, I recall Senator John McCain, in his role as chairman on the Senate Armed Services Committee, make a statement to the effect that cutting edge innovation in Silicon Valley makes things cheaper, so why are government research programs so expensive? In my mind, this is conflating three different things -- basic research, applied research, and commercialization of research.* It is most likely true that non-government entities do a better job of commercializing and mass producing technology, which makes it "cheaper," but by that point, the technology has probably already benefited from decades of research supported by millions (or billions) of dollars of government funding. Not to trivialize the role that companies play in commercialization, but this is kind of like giving the server in the restaurant all of the credit for the meal simply because they carried it from the kitchen to your table, ignoring the fact that someone had to create the recipe, grow and harvest the food, prepare the meal, etc.

The trigger for this post was actually a TED talk that I happened upon a few days ago by Mariana Mazzucato. She is an economist whose research focus is the role of government funding on innovation. The talk is from 2013, and based on one of her many books. (I'll need to check those out.) Though I had never heard of her before nor read any of her work, her presentation is much more eloquent that I could ever be.  



----

*To be fair to Senator McCain, the context was cost overruns on weapons programs, which have all sorts of mismatched incentives and unrealistic initial cost estimates, so they probably are more inefficient than they should be. (And because there was insufficient money allocated to research and testing of those cutting edge systems before production.) That said, I think the underlying assumption is that the private sector and the government do the same things, but one can do them much cheaper than the other.  (And since government contracts go to "private sector" companies, that kind of proves my point anyway.)

Friday, February 23, 2018

Plotting in Pandas: A Cautionary Tale

OK, so we're actually plotting via matplotlib, but that lacked the alliteration needed for a decent title.

This is a follow-on post to one a couple of days ago about plotting some "log"-ish information from our LMS. The idea is to visualize the types of action (what the learning is doing) / application (which part of the LMS the learner is using) patterns for several different learners. This time, I was trying to illustrate the relative frequency different patterns across students.

We'll start by creating some fake data again. We have five learners, some of whom have performed a random subset of actions across a subset of applications. (I'm sure there are much more compact ways of generating fake data, but I'm the kind of person that needs to think it through step-by-step.)


import pandas as pd
import numpy as np 
import matplotlib.pyplot as plt
%matplotlib inline
 
application = ['files', 'discussion', 'assignment', 'quiz', 'wiki', 'announcement']
action = ['show', 'index', 'create', 'backup']
names = np.array(['alice', 'bob', 'charlie','dorothy', 'ellen']) 

student = np.repeat(names, [100, 100, 100, 100, 100], axis=0)
applications1 = np.random.choice(application[:4], 300, replace=True) # subset
applications2 = np.random.choice(application, 200, replace=True) # all
actions1 = np.random.choice(action[:4], 300, replace=True) # subset
actions2 = np.random.choice(action, 200, replace=True) # all 

applications = np.concatenate((applications1,applications2))
actions = np.concatenate((actions1,actions2)) 

df = pd.DataFrame({'id':student, 'web_application':applications, 'web_action':actions})
df.head()

This gives us a data frame with learners, actions, and applications.


We can do some aggregation in pandas to make a chart of the frequency of each action/application combination for each learner. We'll count and sort the values as part of the process, saving each resulting aggregation to a list. At the end, we'll plot one of the list elements (the results for 'charlie') to make sure things look as expected.

 # get the list per student
names = ['alice', 'bob', 'charlie','dorothy', 'ellen']

df_list = []
for name in names:
    mytemp = df[df['id'] == name].groupby(['web_action','web_application'])['web_action'].count().sort_values()
    mytemp.name = name
    df_list.append(mytemp)

df_list[2].plot(kind='barh', title=df_list[2].name)

This gives us:


Not bad. We could repeat the process for each of the elements in the list to get a plot for all of the students if we wanted. But wouldn't it be nice to all of the students together in one plot? That's what I thought, and that's where the cautionary tale part of the story comes in.

I haven't done a whole lot of plotting in Python, but working out some of the initial kinks of properly  specifying subplots, I managed to create a single plot with the information that I wanted. Unfortunately, the plot seemed a little busy in terms of labeling.
fig,axs = plt.subplots(3,2, figsize=(20,15))

for i in range(0, len(df_list)):
    df_list[i].plot(kind='barh', title=df_list[i].name, ax=axs.flat[i])




Wouldn't it be nice if we could clear up some of the clutter by getting rid of the y axis label and having the plots share the tick labels? That led to my next plot.


fig,axs = plt.subplots(3,2, sharey = True, figsize=(20,15))

for i in range(0,len(df_list)):
    df_list[i].plot(kind='barh', title=df_list[i].name, ax=axs.flat[i]).yaxis.label.set_visible(False)


Much less cluttered, which is good. Unfortunately, sharing the y axis tick labels makes the chart, well, wrong. Although a superficial glance makes it look as though things are working --some students had fewer possible application/action combinations, so there are the expected gaps for the expected students-- closer inspection reveals that sharing the y labels has led to mislabeled information for the majority of the subplots. Things are aesthetically pleasing, but not correct because the data are not in the same order across the students. (I know, I know...duh!)

Rather than putz around some more, I decided to revert back to the previous version. The moral of the story is that oft repeated dictum that computers are stupid and they will do what you tell them to do (even if you told them to do something stupid), so always double-check.

Thursday, February 22, 2018

College Kids These Days

I recently read an article entitled "What's college good for?" by Bryan Caplan in The Atlantic.  The article was based on his book The Case Against Education, which I have not read. Although the article makes for some interesting reading, the author's main point seems to be that college kids these days are lazy, stupid (no one has actually earned their 4.0 GPA due to rampant grade inflation), and woefully unprepared for the workforce. He suggests that the only value in a college degree is the "signaling" that it provides to potential employers -- hey, this kid got through Yale, therefore they probably have some decent skills even if they did major in a "ridiculous" field like literary criticism.

Caplan seems to suggest that vocational education would be much better for many would-be college students and for the society at large. Does the world really need more sociology majors? Exactly what kind of job are they training for?

There are no specific research studies cited in the article, although there are nods to what "teams of researchers" have found (much of the information mentioned seems to be at least a decade old, however). Caplan seems to want a better match between education and job skills, but it is unclear what that would look like. Much of the job growth since the great recession has been in low wage jobs, though there have also been some gains in relatively technical fields. Of course, even majoring in a technical field is no guarantee that you will find employment. Perhaps we need educators who can better help students predict the future?

It is unclear exactly what Caplan sees as the solution. Is he suggesting more rigorous student tracking in early education, where folks who are not college material are diverted into vocational programs? (Does working fast food count as a vocation?) Does he envision a cap on the number of degrees to confer for "useless" majors, in an effort to push students into the "correct" course of study?

I admit to not understanding his thesis, which he states as follows:
My thesis, in a single sentence: Civilized societies revolve around education now, but there is a better, indeed, more civilized--way. 
Perhaps I would understand his argument better if I read his book. Or is "book learning" the cause of the problem in the first place? 
       

Wednesday, February 21, 2018

Plotting Crosstabs in Pandas

This post is primarily to remind myself of a solution that worked for me. I was analyzing some request table data from our LMS provider. (The request table is derived from log files.) To get a rough and ready estimate of what students were doing in the LMS over the course of a semester, I wanted to create a contingency table from two of the columns: web_application_controller and web_application_action, which specify how the web request was serviced (an assignment was created, a discussion was viewed, etc.)

(I'm still working on getting code snippets to look good in these posts. Bear with me.)

First, we'll create some fake data by randomly creating 100 request records for each of three students, each consisting of an application and an action:

 import numpy as np  
 import pandas as pd  

 application = ['files', 'discussion', 'assignment', 'quiz']  
 action = ['show', 'index', 'create']  
 names = np.array(['alice', 'bob', 'charlie'])  

 student = np.repeat(names, [100, 100, 100], axis=0)  
 applications = np.random.choice(application, 300, replace=True)  
 actions = np.random.choice(action, 300, replace=True)  

 df = pd.DataFrame({'id':student, 'web_application':applications, 'web_action':actions})  
 df.head()

This gives us the following:

Next, we create a create a table of the count of requests per student, using Pandas crosstab:


 df_cross = pd.crosstab([df.id, df.web_action], df.web_application)
 df_cross

This results in:

This was what I wanted, but I couldn't figure out a good way to plot the results. After lots of searching, I came across an answer (I'll try to track down the original) which involved "flattening" or "tidying" the table, using Pandas melt function (which is just like R's melt). Note that we have to reset the index as part of the process.


 df_cross_melt = pd.melt(df_cross.reset_index(), id_vars=['id', 'web_action'], var_name='web_application', value_name = 'count')
 df_cross_melt.head()

From there, it is possible to use Seaborn's factorplot to visualize the results:

 import matplotlib.pyplot as plt
 import seaborn as sns
 %matplotlib inline

 g = sns.factorplot(x='web_application',
                  y='count',
                  hue='web_action',
                  col='id',
                  kind='bar',
                  data=df_cross_melt,
                  sharey=True)

 g.set_xticklabels(rotation=90)
This produces the following chart:


I'm sure that there are much more efficient ways to do this, but this worked for me and got me the result that I needed.

Tuesday, February 20, 2018

Rubick's Cubicle

The arrangement of office space can be a puzzle. Does an open work space promote more collaboration? Do private offices create resentment and isolation? Does the height of cubicle walls matter?

I will be the first to admit that I haven't taken the time to read the research literature related to this topic. (Though if you believe a reporter-generated synopsis of the general findings, open office plans don't work.) My take on the issue is based on experience and gut feeling. In my mind, the arrangement of the office serves to attenuate whatever positive or negative feelings you have towards your situation (in addition to whatever measurable effects they might have on noise, productivity, etc.)

I've been in shared offices, both with and without windows to the outside world; in private offices, with and without windows; in a completely open office setting (no cubicles whatsoever); and in a shared space with low-walled cubicles. Although I was always working with people whose company I enjoyed, I found the low-walled cubicles the worst of the bunch -- although they provided a physical demarcation, the cubicles were far too close to each other to provide any feeling of personal space. The completely open office setting led to everyone wearing earphones to cut down on distractions (though it did have the advantage of seeing who was "available" at any given point in time). Being in an office, even if it is shared, gives a sense of permanence. Cubicles give a feeling of being replaceable/interchangeable. 

But it is not just the office layout that is important. If the space itself is nice (the chairs are comfortable, the technology is modern, the temperature control is adequate, etc.), that can help. A mold-infested private office in a dank basement is probably less desirable than a shared office with natural light or even a decent cubicle. 

At the end of the day, the office environment tells a story about how the organization views its workers. If there is a mismatch between the environment that an employee feels is a prerequisite to performing at a professional level and that which is provided, there will be tension. Employees usually want a sense of ownership and autonomy, and that can be more difficult to engender in a shared or open space that feels "temporary." (It is curious that managers rarely, if ever, believe that shared offices will make themselves more productive.) A substandard or ill-conceived working environment can make statements like "We value our employees" ring hollow.