Problem with: line features_train_scaled = ct.fit_transform(features_train) - ValueError: too many values to unpack (expected 3)

Here comes a rookie! I am gettin an above-mentioned error in line 27 and I have no idea what to do. I posted that question on stack overflow and I was advised to change tuple format: “the transformers are triples, not 4-tuples. See the docs page for possible formats of passing the list of columns to operate on.” Still I have no idea what to do. This code snipet is from Deep Learning Regression with Admissions Data. Could someone help me please?:slight_smile: Just to be comperhensive, I attached all my code.

import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import Normalizer
from sklearn.compose import ColumnTransformer
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import InputLayer
from tensorflow.keras.layers import Dense
from tensorflow.keras.optimizers import Adam

dataset = pd.read_csv("life_expectancy.csv")
print(dataset.describe())
dataset = dataset.drop(['Country'], axis = 1)

labels = dataset.iloc[:, -1]
features = dataset.iloc[:,0:-1]

features = pd.get_dummies(features)
features_train, labels_train, features_test, labels_test = train_test_split(features, labels, test_size = 20, random_state = 23)

ct = ColumnTransformer([("only numeric", StandardScaler(), features_train,features_test)], remainder='passthrough')
features_train_scaled = ct.fit_transform(features_train)
features_test_scaled = ct.fit_transform(features_test)

It’s always helpful to link the project for something like this. The error you’re getting occurs when something like this happens-

a, b = [1, 2, 3]  # Too many to unpack

Combine that with the advice you got previously and you should be able to locate any possible issue. As suggested before you’d need to look at the docs to find out what’s passed and what is returned for your calls.

how do I make new predictions with my own data??? Thanks you:)