O'Reilly logo

C# Machine Learning Projects by Yoon Hyup Hwang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Feature engineering and data aggregation

The records in the dataset we have now represent individual transactions. However, we want to build a clustering model that clusters customers into different segments. In order to do that, we need to transform and aggregate our data by customer. In other words, we will need to group our data by CustomerID and aggregate all the transactions that belong to each customer by summing, counting, or taking averages of the values. Let's look at an example first. The following code groups the transaction-level data by CustomerID and computes the net revenue, total number of transactions, total number of cancel orders, average unit price, and average order quantity:

// 1. Net Revenue per Customervar revPerCustomerDF ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required