I am trying to test a preexisting python machine learning script with a subset of my genetic data. One of the feature columns I am using happens to only have NA values in it. I lose this column when I use the following code: Imputer(missing_values='NaN', strategy='mean', axis=0).fit_transform(data) This causes problems later on because my model expects the correct number of features, and I do not want to retrain my model at this time. Is there any way to work with Imputer or fit_transform to prevent this column from getting dropped?

  • 1
    $\begingroup$ Join the "NA" containing column after the transformation. $\endgroup$
    – arup
    Oct 31 '17 at 6:02
  • 1
    $\begingroup$ I am in no way expert in machine-learning but this seems more like a programming question than a bioinformatician problem, (although you use genetic data). Consider "telling" the model that there is now one feature less. But if you have new data enough different from the original you need to retrain your model AFAIK... $\endgroup$
    – llrs
    Oct 31 '17 at 13:48
  • 1
    $\begingroup$ We might conceivably be able to help if you gave us some details but without your code or a dataset to test it on, we can't. You are using various commands there which, presumably, are defined in your model. We can't help if you don't tell us how they work or what they are. $\endgroup$
    – terdon
    Oct 31 '17 at 16:33