function createFeatures({
bmi,
smoking,
alcoholDrinking,
stroke,
physicalHealth,
mentalHealth,
diffWalking,
sex,
ageCategory,
raceCategory,
diabetic,
physicalActivity,
genHealth,
sleepTime,
asthma
}) {
return {
bmi: normalize(bmi, 10, 50),
smoking: smoking.includes('Smoker?') ? 1 : 0,
alcoholDrinking: alcoholDrinking.includes('Drinks Alcohol?') ? 1 : 0,
stroke: stroke.includes('Stroke History?') ? 1 : 0,
physicalHealth: normalize(physicalHealth, 0, 30),
mentalHealth: normalize(mentalHealth, 0, 30),
diffWalking: diffWalking.includes('Difficulty Walking?') ? 1 : 0,
sex: sex === 'Male' ? 1 : 0,
ageCategory: encodeCategory(ageCategory, ['18-24', '25-29', '30-34', '35-39', '40-44', '45-49', '50-54', '55-59', '60-64', '65-69', '70-74', '75-79', '80 or older']),
raceCategory: encodeCategory(raceCategory, ['American Indian/Alaskan Native', 'White', 'Black', 'Asian', 'Hispanic', 'Other']),
diabetic: diabetic.includes('Diabetic?') ? 1 : 0,
physicalActivity: physicalActivity.includes('Physically Active?') ? 1 : 0,
genHealth: encodeCategory(genHealth, ['Excellent', 'Very Good', 'Good', 'Fair', 'Poor']),
sleepTime: normalize(sleepTime, 0, 24),
asthma: asthma.includes('Asthma?') ? 1 : 0
};
}