Python Forum
Applying function - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Applying function (/thread-32708.html)



Applying function - mapypy - Feb-27-2021

code

Hi,

I still see nulls in X_train and my pipline seems to not have applied. For example, there should be more columns due to one-hot encoding. Am I doing something wrong?

def apply_fe_pipeline(X_train,X_test):
    # fit the imputer
    feature_engineering_pipeline.fit(X_train)

    # transform the data
    X_train= feature_engineering_pipeline.transform(X_train)
    X_test= feature_engineering_pipeline.transform(X_test)
    training_null=X_train.isna().values.sum()
    test_null=X_test.isna().values.sum()
    
    return print ('count of nulls in training set after fe:',training_null,
                 'count of nulls in test set after fe:',test_null)
apply_fe_pipeline(X_train,X_test)



RE: Applying function - nilamo - Mar-11-2021

This looks like a question that should be directed at the pytorch/tensorflow/whatever library you're using's forum, since the input/output/errors are all completely within those libraries.