How to create a categorical column from numerical column
I have a numerical column "median_income" with values ranging from 0.49(min) to 15.0(max) with more than 20000 records.
I want to create a categorical columns with 6 categories for different ranges i.e.
- for median_income < 1.5, label 1,
- for 1.5 < median_income < 3.0, label 2
and so on.
what are different ways in Dataiku by which I can accomplish this?
Thanks
Best Answer
-
Just use prepare recipe with the formula :
if(median_income < 1.5, "label 1",
if(median_income < 3.0, "label 2", "label3"
))
Answers
-
Jurre Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS Core Concepts, Registered, Dataiku DSS Developer, Neuron 2022 Posts: 115 ✭✭✭✭✭✭✭
Hi @deepakdhiman
,Welcome to the community!
some reference material to what @FlorentD
mentioned :Formula-language : https://doc.dataiku.com/dss/latest/formula/index.html
The Academy has some nice courses about data preparation : https://academy.dataiku.com/page/advanced-data-preparation
-
Thank you