MCPcopy Index your code
hub / github.com/rushter/MLAlgorithms / fit

Method fit

mla/ensemble/random_forest.py:39–45  ·  view source on GitHub ↗
(self, X, y)

Source from the content-addressed store, hash-verified

37 self.trees = []
38
39 def fit(self, X, y):
40 self._setup_input(X, y)
41 if self.max_features is None:
42 self.max_features = int(np.sqrt(X.shape[1]))
43 else:
44 assert X.shape[1] > self.max_features
45 self._train()
46
47 def _train(self):
48 for tree in self.trees:

Callers

nothing calls this directly

Calls 2

_trainMethod · 0.95
_setup_inputMethod · 0.80

Tested by

no test coverage detected