Error: float() argument must be a string or a number, not 'StandardScaler' I am getting this error for the mentioned code. Please help me with this as I am a beginner and learning machine learning

# Polynomial Regression

# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

# Importing the dataset
dataset = pd.read_csv('Position_Salaries.csv')
x = dataset.iloc[:, 1:2].values
y = dataset.iloc[:, 2].values

#Feature scaling
from sklearn.preprocessing import StandardScaler
sc_x=StandardScaler()
sc_y=StandardScaler()
x=sc_x.fit(x)
x=sc_x.fit(y)

#Fitiing SVR to the dataset
from sklearn.svm import SVR
regressor = SVR(kernel = 'rbf')
regressor.fit(x,y)

#Predict the results
regressor.predict(np.array([6.5]).reshape(1, 1))

#Visualizing the results
plt.scatter(x,y,color = 'red')
plt.plot(x,regressor.predict(x))
plt.label("Positon Level")
plt.label("Salary")
plt.show()
.fit method returns the standard scalar object. You are using that to train the model. please use fit_transfor or transform after the fit. like below

sc_x.fit(x)
x = sc_x.transform(x)


or

x = sc_x.fit_transform(x)