Question: Use the HousePrices.db. Write a script that: Will bin the prices into 3 bins Bin 1 = $100,000 to $199,000 Bin 2 = $200,000 to
- Use the HousePrices.db. Write a script that:
- Will bin the prices into 3 bins
Bin 1 = $100,000 to $199,000
Bin 2 = $200,000 to $299,000
Bin 3 = $300,000 and up
- Will create a 1-hot-encoding of the binned prices.
The final table should look like this
| HouseID | Price | Bin | Bin1 | Bin2 | Bin3 |
| 1 | 250,000 | 2 | 0 | 1 | 0 |
| 2 | 310,000 | 3 | 0 | 0 | 1 |
Copy and paste your SQL code in this file or submit an extra file.
1 2 3 4 5 6 7 123 houselD T: 123 price Ti 1 250,000 2 310,000 3 160,000 4 310,000 5 360,000 6 500,000 7 210,000 8 155,000 9 190,000 10 230,000 8 9 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
