I am building an isolation forest using sklearn and python and am running into the error 'ValueError: Number of features of the model must match the input. Model n_features is 24 and input n_features is 1.' I am trying to predict 'pages' from various size features. The actual data set I am working with has 300 rows and 14 columns. The first and second are irrelevant, then there are 10 'size' labels, then the 'pages' column, so I am not sure why it says the input is 1. I have attached some code below and what the data looks like, thank you!
X = df.iloc[:, 2:12].values
y = df['pages']
from sklearn.model_selection import train_test_split
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.2,random_state=0)
from sklearn.preprocessing import StandardScaler
sc = StandardScaler()
X_train = sc.fit_transform(X_train)
X_test = sc.transform(X_test)
model = IsolationForest(n_estimators = 100, max_samples = 'auto', contamination = 'auto')
model.fit(df[['pages']])
df['anomaly']=model.fit_predict(df[['size2','size3','size4', 'size5','size6','size7','size8','size9','size10','size11']])
df['anomaly']= model.predict(df[['pages']])
print(model.predict(X_test))
print(df.head(10))
anomaly = df.loc[df['anomaly']==-1]
anomaly_index = list(anomaly.index)
print(anomaly)