Question
Which data transformation technique would be best for
converting categorical variables, such as “Gender” (Male, Female), into a format usable in machine learning models?Solution
One-hot encoding is a technique used to convert categorical variables into a numerical format, where each category is represented by a binary variable. For instance, in the “Gender” variable, one-hot encoding would create two binary columns: “Male” and “Female.” Each observation will have a value of 1 in one column and 0 in the other, making the data usable in machine learning algorithms that require numerical input. One-hot encoding prevents ordinal relationships from being falsely implied, ensuring accurate representation of non-numeric data in modeling. The other options are incorrect because: • Option 1 (normalization) scales data but is ineffective for categorical conversion. • Option 3 (logarithmic transformation) is used for continuous data to reduce skew, not categorical data. • Option 4 (binning) groups continuous data into categories rather than encoding existing categories. • Option 5 (polynomial transformation) applies to numerical features and is unrelated to categorical conversion.
There was a race of 1080 meters between P & Q on a circular track of 360 meters. First time they meet during the race after 6 minutes of starting of rac...
- Two cars, ‘X’ and ‘Y’, started from towns ‘M’ and ‘N’ towards each other at the same time. When they met after 6 hours, car ‘Y’ had tra...
The distance between two stations A and B is 900 km. A train starts from A and moves towards B at an average speed of 30 km/hr. Another train starts fr...
A train covers a distance of 40 km at the speed of 30 km/h the next 50 km distance covers with a speed of 40 km/h and last 30 km with the speed of 40 km...
A man running with the speed of 58 km/hr covers a certain distance in ‘x’ hours. If the same distance can be travelled with a speed of 62 km/h in (x...
Akash, during his journey, travels for 30 minutes at a speed of 20 km/h, another 20 minutes at a speed of 30 km/h, and 2 hour at a speed of 40 km/h and ...
Average speed of ‘A’ during a 20-hour journey is 20 km/h. If he covered the first 200 km of his journey at a speed of 20 km/h, then find the speed a...
Anju's journey comprises three segments. He travels the first 'd - 30' km at a speed of 12 km/h, the next 'd' km at a speed of 30 km/h, and finally, she...
A car travels at a speed of 90 km/h and takes 4.5 hours to cover a specific distance. A train can cover the same distance in 3 hours. If the speed of th...
Speed of a car and a bus is 20 km/h and 10 km/h, respectively. If the time taken by the car to cover a distance of ‘8x’ km is 1 hour less than time ...