Showing posts with the label scikit-learn

[FIXED] How to handle category mismatch after onehotencoding from test data while predicting?

Issue I'm sorry if the title of the question is not that clear, I could not sum up the problem …

[FIXED] I'm getting an **NumPyClient.fit did not return a tuple with 3 elements.** error when I run client.py file. What could be the problem?

Issue I am using the Flower code example to try POC of Federated Learning but I keep getting the er…

[FIXED] ValueError: Shape mismatch: if categories is an array, The error is not resolved even after specifying the columns as indexes

Issue trf1=ColumnTransformer([("Infuse_val",SimpleImputer(strategy="mean"),…

[FIXED] What does it mean when cluster label is -1?

Issue from sklearn.cluster import DBSCAN model = DBSCAN(eps=3.3, leaf_size=5, min_samples=3) y_pred…

[FIXED] How to colour a scatter plot of a 2d data frame (reduced using tsne/umap) according to label information in index ({country,year}) of different frame

Issue The problem I am facing is that I have a dataframe - sector_features_ which looks like this: …

[FIXED] Subsample size in scikit-learn RandomForestClassifier

Issue How is it possible to control the size of the subsample used for the training of each tree in…

[FIXED] When saving a list of LabelEncoders the classes_ get overwritten by the last LabelEncoder

Issue im trying to save a dict of LE encoders for use in inferencing, this is the code that trains …

[FIXED] Difference between Standard scaler and MinMaxScaler

Issue What is the difference between MinMaxScaler() and StandardScaler() . mms = MinMaxScaler(fea…

[FIXED] Understanding sklearn's KNNImputer

Issue I was going through its documentation and it says Each sample’s missing values are imput…

[FIXED] logistic regression using more than one predictor

Issue I want to fit a logistic regression model that predicts Y using X1 and X2. What I know is tha…

[FIXED] how to use trained model to test new sentence in python (sklearn)

Issue I have code to training the model for multi class text classification and it's work but …

[FIXED] How to keep the number and names of columns in training and test dataset equal after one hot encoding?

Issue Shape of the original dataset is 82580×30 with multiple string columns. Example dataset: imp…

[FIXED] Using fit_transform() and transform()

Issue from sklearn.preprocessing import StandardScaler sc = StandardScaler() X_train = sc.fit_trans…

[FIXED] For loop iterating with only last value of the list

Issue For-loop iterating but store with only last value of the list Here is the code: models = [K…

[FIXED] difference between StratifiedKFold and StratifiedShuffleSplit in sklearn

Issue As from the title I am wondering what is the difference between noreferrer">Stratifi…

[FIXED] A huge number of discrete features

Issue I'm developing a regression model. But I ran into a problem when preparing the data. 17 o…

[FIXED] Does AutoML accept external models?

Issue I used random search and got the best hyper parameters for my model, can I pass that model to…