Skip to content
Advertisement

Tag: scikit-learn

How do I make sure GridSearchCV first does the cross split and then the imputing?

I have a GridSearchCV, with a pipeline that looks something like this: my GridSearchCV looks like this: with Cross Validation = 5 So, how do I ensure that I split the data first, and then impute in the most frequent? Answer GridSearchCV will run roughly like this: You can be sure that SimpleImputer and StandardScaler will do .fit() and .transform()

How can I prepare my image dataset for a federated model?

How could I transform my dataset (composed of images) in a federated dataset? I am trying to create something similar to emnist but for my own dataset. tff.simulation.datasets.emnist.load_data( only_digits=True, cache_dir=None ) Answer You will need to create the clientData object first for example: where create_dataset is a serializable function but first you have to prepare your images read this tutorial

Scaler fitted in a pipeline turns out to be not fitted yet

Please consider this code: I get this message: Why is the scaler not fitted? Answer When passing a pipeline or an estimator to RFE, it essentially gets cloned by the RFE and fit until it finds the best fit with the reduced number of features. To access this fit estimator you can use fit_pipeline = rfe.estimator_ But note, this new

Advertisement