TransWikia.com

Filling created feature with values

Data Science Asked by Omer Beden on December 1, 2020

I’m trying to improve accuracy. I created a few new features based on old features. So I need to fill new feature’s empty cell with same values in order to equaling shapes.Then, I tried it with median and also with mean but nothing changed. Is there any method that I can apply these cells in order to improve accuracy?

for example, there is a feature named age
I created new 2 feature named age_1 and age_2 ,
age1 consisting of age < 55 ,
age2 consisting of age > 55

therefore there is some empty cells in the new features and I have to fill these

One Answer

If I understood your question right - you've created a new feature age<55 - which gets True/False, hence, there is no need for the second feature since it has a perfect (negative) correlation with the first one (i.e False in every record that the other new feature got True..).

2 last notes:

  • Note that the second feature ain't addeing any new information to the first one.
  • Note that you've missed the recodes with age==55

I would suggest:

df['is_old'] = df['age'].apply(lambda x: x>55)

Answered by Romid on December 1, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP