TypeError: fit() missing 1 required positional argument: 'y' (using sklearn - ExtraTreesRegressor)
问题 Just trying out the Sklearn python library and I re-purposed some code I was using for Linear regression to fit a regression tree model as an example I saw (here's the example code): def fit(self, X, y): """ Fit a Random Forest model to data `X` and targets `y`. Parameters ---------- X : array-like Input values. y: array-like Target values. """ self.X = X self.y = y self.n = self.X.shape[0] self.model = ExtraTreesRegressor(**self.params) self.model.fit(X, y) Here's the code I've written