A multiclass target represents a categorical prediction problem with more than two possible classes. Here, five price-based classes support classification rather than regression. section 4.2.1
Turning price into five classes
Create the target by dividing price into five percentile-based groups: target_multiclass = pd.qcut(data["price"], q=5, labels=False). The resulting classes contain 10,063, 9,835, 9,804, 10,809, and 8,384 cases, providing a broadly balanced classification target. section 4.2.1
target_mean = (data["price"] > data["price"].mean()).astype(int) target_median = (data["price"] > data["price"].median()).astype(int) target_multiclass = pd.qcut(data["price"], q=5, labels=False) target_regression = data["price"]
Use the supplied pandas listing to construct multiclass, binary, and regression versions of the same price target. section 4.2.1
