Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature extraction methods in sklearn pipeline #12

Open
MSasta opened this issue Dec 8, 2021 · 0 comments
Open

Feature extraction methods in sklearn pipeline #12

MSasta opened this issue Dec 8, 2021 · 0 comments

Comments

@MSasta
Copy link

MSasta commented Dec 8, 2021

Hey, I'm facing an issue with implementing BayesianTargetEncoder and CycleTransformer in a pipeline that I've made. This might be because of my lack of experience but any help would still be appreciated.

The pipeline I currently have is

model = RandomForestRegressor(n_estimators = 1000, min_samples_split = 2, max_features = 'sqrt',
max_depth = 20, random_state = 42, bootstrap = True, oob_score = True, n_jobs = 4)

ss = StandardScaler()
bte = BayesianTargetEncoder()
ct = CycleTransformer()

rf = Pipeline(
    [
    ("transformer", ColumnTransformer
        (
            [
                ("scaler", ss, num_cols),
                ("bayesian_target_encoder", bte, cat_cols),
                ("cycle_transformer"), ct, times
            ]
        )
    ),
    ("reg", model) 
    ]
)  

and the issue that I am facing is that it says TypeError: 'CycleTransformer' object is not iterable

If I remove CycleTransformer and proceed without it, then I get this issue:

C:\py\lib\site-packages\xam\feature_extraction\encoding\bayesian_target.py in transform(self, X, y)
     73             raise ValueError('X has to be a pandas.DataFrame')
     74 
---> 75         for cols in self.columns:
     76 
     77             if isinstance(cols, list):

TypeError: 'NoneType' object is not iterable

I understand it says that X has to be a pandas dataframe but i'm not sure what the work around to this would be.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant