1
$\begingroup$

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

$\endgroup$
0
$\begingroup$

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)
|improve this answer|||||
$\endgroup$
  • $\begingroup$ for example, my old feature's shape is (180,12) if I create a new feature from old feature my new feature's shape is for instance (150,12) that's why I need to fill this rows with some values. My question is all about how i can fill these rows with $\endgroup$ – Omer Beden Aug 26 '19 at 10:46
  • $\begingroup$ I think that a better practice is applying a function that fills the whole feature values - and not changing the data structure by filtering it and then merging or filling it back with values. Anyway, if you are creating a new feature that you dont know or cant apply it's logic to the whole population - this feature wont have signal while it is missing and it wont be a good one.. $\endgroup$ – Romid Aug 26 '19 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.