Analyzing the Movielens Data – Part 4

This is Part 4 of our “Analyzing the Movielens data” series.

In Part 3, we answered the following by building Juxt flows –

  • List only the good movies – the ones that got an average rating of 4.3 or higher

In that example, we went over the select module to create custom filters.

Let’s build on that to address the next one

  • What genres of movies do Programmers rate the most?

As always, let’s lay down the logical steps needed to address this

  • Filter the data to include only the movies rated by Programmers (Occupation code =12)
  • Group the filtered data by Genres.
  • Iterate through each group and count the number of items in each of the buckets
  • Sort the Genre buckets by the count and derive the top 10 genres

The data flow for this is shown below

Juxt Flow - Movies Programmers Rate Most
Juxt Flow – Movies Programmers Rate Most

We first filter the data set using the now familiar Select module with our custom filter. Again, the filter is a rather simple one here where we simply do a lookup for occupation and if it is equal to 12 which is the occupation code in the dataset for Programmers, we pass it through to the next stage of analysis.

The figure below shows the filter logic.

Filter Logic to Select Only Programmer Ratings
Filter Logic to Select Only Programmer Ratings

The next step is to group the filtered dataset into buckets of data by genres. This is done simply by using the Group By module with genres as the column to be grouped by. There are 294 genre combinations in the dataset. So, the Group By operation creates 294 buckets each of them containing the data belonging to that specific genre categorization.

Now we need to iterate through each of those buckets and count the number of records in the bucket. We do that with Collect module. Collect works very similar to Select. It takes in collection of data and performs the user (or template) logic in each of the items in the collection. One simply picks the user logic or Collector from the drop down menu.

Figure below shows the collector logic for our use case here. Here, we simply lookup each bucket, Count the number of entries and assign a name (key) to the result.

Collector Logic to Count Ratings in Every Data Group
Collector Logic to Count Ratings in Every Data Group

Top N module outputs the top 10 results sorted by count to an HTML table.

Results - Top Genres Programmers Rate
Results – Top Genres Programmers Rate

A two minute video of the discussion can be seen here

Analyzing Movielens Data Part 2

This is Part 2 of our “Analyzing the Movielens data” series.

In Part 1, we did the following:

  • reviewed the organization of the data
  • outlined a set of questions we’d like to ask
  • created Juxt workflows to integrate the data from three different data sources

Now, let’s look at a couple of the questions.

  1. What is the average rating for each movie broken down by gender?
  2. What are the top 10 movies that men rate higher than women?

Average Rating by Gender

We start by fetching from the user DB, where we have already integrated the Users, Movies and Ratings data. This is done with the Fetch from User DB module using the key “movielens-dataset”.

Juxt flow for calculating average ratings by gender
Juxt flow for calculating average ratings by gender

Average rating by gender can be computed using the built-in Pivot Table library module. Since we want the average Ratings, we set the Value property to “rating” and the Aggregation property to “mean”. We Group By the “title”, and split the “gender” Column values into new columns.

Finally, we render the results as a HTML Data Table, which is as follows:

Average ratings by gender
Average ratings by gender

Top 10 Movies that Men rate higher than Women

Now that we have the average ratings by gender, we can do the following:

  1. Calculate the difference in ratings from men and women for each movie
  2. Sort the movies in descending order by the difference in ratings
  3. Take the top 10
Ratings Difference by Gender
Ratings Difference by Gender

The Calculate New Column module adds a new column to the dataset based on an expression we specify. The expression can be any mathematical equation which references existing columns. In this case, we simply subtract the mean ratings to create a new column “difference”

rating-mean_gender_M - rating-mean_gender_F

The module Top N with Feature of “difference” and a Count of 10, will give us the top 10 movies with the most difference in ratings.

And the results are in:

Ratings Difference by Gender
Ratings Difference by Gender

Please check out our screencast of building these workflows in Juxt.io:

Analyzing Movielens Data Part 1

This might be familiar – a perennial question that keeps coming up in our home – What movie to watch tonight?

There’s a ton of movie ratings from actual users in the Movielens dataset. Wouldn’t it be great to use all this data to help us pick the right movie everytime?
We’ll use a Movielens dataset that contains 1,000,209 anonymous ratings of 3,900 movies made by 6,040 MovieLens users. – data explained here

From this, let’s say we want to ask the following –

  1. What is the average rating for each movie broken down by gender
  2. List only movies that received at least 100 ratings
  3. Of those, list only the good ones – movies that got ratings of 4.3 or higher
  4. List the top 10 movies that, on average, men rate higher than women
  5. What genres of movies do programmers like?

Organization of Data

The data is distributed across three disparate data stores.

Movie data is in a Comma Separated Value (CSV) file in Amazon S3. This contains MovieID, Title and Genres

Users data is in a CSV file in Dropbox data store. This contains UserID, Gender, Age, Occupation and Zip-code

Ratings data is in a Relational Database table in PostgreSQL that contains UserID, MovieID, Rating and a Timestamp

Data Integration

Since the data is spread across multiple silos (Amazon S3, Dropbox) and multiple formats (CSV, PostgreSQL), we need to combine the relevant data into a form that is easier to work with.

In the figure below, functional modules are wired together to create the data integration. At a high level:

  • We load the data from the different sources
  • Combine them (Join) based on a common feature or column to create a virtual data source (user-id for ratings & users, movie-id for movies)
  • The combined data is stored in a user DB (in-memory cache) with the ID “movielens-dataset”. This can be fetched in subsequent modules for further analytics
Data Import Flow
Data Import Flow

Please check out the video version of the data integration

In the next post, we will get into building the flows needed to answer the questions we started with.

Introducing the Juxt Data Workbench

Juxt is an interactive data workbench in the cloud that enables business users to build sophisticated data applications without writing any code. Similar to how you would describe a process on a whiteboard, i.e., identifying the steps needed and sequencing them into a complete end-to-end flow, Juxt lets you build data apps. For example – send promo email offers to a target set of customer profiles based on past behavior, forecast product demand based on seasonal trends.

Juxt - an Interactive Data Workbench
Juxt – an Interactive Data Workbench

In Juxt, you can create apps by dragging functional blocks from our component library onto a design canvas, wire them together and press the “Run” button. Our built-in component library includes connector blocks for various data sources & types, components for data munging, augmentation & aggregation, statistical & predictive machine learning algorithms, and web API’s to popular online services.

Explore, Integrate and Operationalize Data
Explore, Integrate and Operationalize Data

You can also build your own functional blocks using Juxt’s built-in library components or wrap existing R, Python, Javascript & Clojure code assets. This is huge, because all the interesting work you’ve already done can start being applied across your company right away. Every block that you create becomes usable in all your projects and across your entire organization. Wheel reinvention problem … solved!

Once you’re done creating your cool data app, publish it and show your peers & users what a rockstar you are!!

Hello from Juxt

Hello, we are Juxt.io – a startup building Data Analysis software for Business Users. I’m Panch, one of the founders. My co-founder Ram, and I built Juxt in response to the repeated challenges and frustrations we experienced in our past jobs, trying to derive insights from available data at our companies and actually apply them in making business decisions.

Currently, Business Data Analysis tools fall into one of two extreme camps. In one camp, the tools are severely feature-constrained in the name of ease-of-use. This often leaves the user with limited freedom of expression. On the other hand, the tools make no sacrifices in power or performance, but expect the users to be software engineers to even get started.

Neither of these approaches addresses the needs of savvy business users who seek something more expressive than Excel without having to get a CS degree.

In one of my previous roles as a Product Line Manager, I found myself in this predicament. My company collected a great deal of interesting data from various information sources and I wanted to get my hands on this data to, say, build a forecast model or play with some what-if scenarios. But, whenever I started to build anything I ran into all manners of technical issues. The data wasn’t in an appropriate format, or was too large or split across multiple sources, behind API walls and so on. Invariably, I had to seek the help of someone from IT or a developer to get things going. These attempts would usually play out along the following lines:

  1. I’d write up an informal spec for what I was trying to do
  2. The IT/dev person would interpret that and code it up, if I could get their time, and that’s a big if
  3. They run the code, collect the results, and I’d review it
  4. Sometimes, there’d be bugs that would need fixing, or the data would be incomplete, or I’d discover something new that I’d want to extract.

… whatever the reason, I’d have to go back to Step 1, rinse and repeat. Answering even the simplest questions would take days or weeks, and tight schedules would force me to abandon the data backed approach, and resort to other sub-optimal options.

analytics-loop
The Dreaded Analytics Loop

Perhaps, this scenario is familiar to you as well. It certainly was to a number of my peers.

Ram who is on the developer side of the equation had the mirror image of the problem – too many business guys asking him and his team to run reports etc. He couldn’t understand why the business folks didn’t just tweak a few lines of code since most reporting requests were just slightly different versions of the same problem.

At some point, Ram and I were commiserating over the challenges at respective jobs, and it occurred to us that this was a real problem to be solved. This needed a solution that was easy to use for the business guys, who could apply their domain expertise to drive data rather than rely on IT for everything. The IT guys can then focus their energies on cooler problems rather than run reports all the time.

So our approach to solving this problem was to create a visual representation of data processes with the technology hidden underneath. Now, one can build rather sophisticated data apps with a business process perspective without a technology dependency.

Our interactive data workbench enables business users to integrate diverse data sources & online APIs, apply Business Intelligence & Machine Learning algorithms, with a drag, drop & configure UX.

Over the next few blog posts we’ll cover a number of popular data analysis use-cases and demonstrate the advantages of our interactive data workbench. Using Juxt, business users will be able to easily crunch complex datasets without having to write any code.

Stay tuned.