لدي الكود التالي :
data = pd.read_excel('testreglogistic.xlsx',sheet_name='raz1')
x=data.loc[:,data.columns != 'g'].values y=data.loc[:,'g'].values
x_train, x_test, y_train, y_test= train_test_split(x,y, test_size= 0.25, random_state=42) sc= StandardScaler() x_train= sc.fit_transform(x_train) x_test= sc.transform(x_test) y_train = preprocessing.normalize([y_train]) y_test = preprocessing.normalize([y_test]) model= RandomForestRegressor(n_estimators=20,max_depth=3, random_state=42) model.fit(x_train,y_train) y_pred=model.predict(x_test)
يظهر الخطأ التالي :
ValueError: Found input variables with inconsistent numbers of samples: [273, 1]