0

I am trying to set the target and then scale my features. However I am getting an error:

# Set a variable (features) with the names of all the features BUT the target variable.

X = data.drop("diagnosis_result",1)   #Feature Matrix
y = data["diagnosis_result"]          #Target Variable
data.head()

print(f"The list of columns that represent features is:\n{X}")
print(f"So, we have {len(X)} dimensions in our feature vectors.")

scaler = RobustScaler().fit(data[X])
data[X] = scaler.transform(data[X]).round(2)

print()
data.head()
1
  • which line is the error? Commented Oct 4, 2022 at 15:04

1 Answer 1

1

you can reshape it target variable and featurematrix ..

X = data.drop("diagnosis_result",1).reshape(-1,1)   #Feature Matrix
y = data["diagnosis_result"]..reshape(-1,1)          #Target Variable
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.