Skip to content
Snippets Groups Projects

WIP: Resolve "Adding new datasets"

Merged Charly Lamothe requested to merge 17-adding-new-datasets into master
5 files
+ 55
32
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -53,14 +53,14 @@ class EnsembleSelectionForestRegressor(BaseEstimator, metaclass=ABCMeta):
@@ -53,14 +53,14 @@ class EnsembleSelectionForestRegressor(BaseEstimator, metaclass=ABCMeta):
def score(self, X, y):
def score(self, X, y):
predictions = self._predict_base_estimator(X)
predictions = self._predict_base_estimator(X)
mean_predictions = np.mean(predictions, axis=0)
return self._score_metric(predictions, y)
return self._score_metric(mean_predictions, y)
def predict_base_estimator(self, X):
def predict_base_estimator(self, X):
predictions = list()
predictions = list()
for tree in self._ensemble_selected:
for tree in self._ensemble_selected:
predictions.append(tree.predict(X))
predictions.append(tree.predict(X))
return np.array(predictions)
mean_predictions = np.mean(np.array(predictions), axis=0)
 
return mean_predictions
@staticmethod
@staticmethod
def generate_library(X_train, y_train, random_state=None):
def generate_library(X_train, y_train, random_state=None):
Loading