(self, X, y=None)
| 63 | return error |
| 64 | |
| 65 | def fit(self, X, y=None): |
| 66 | self._setup_input(X, y) |
| 67 | self.init_cost() |
| 68 | self.n_samples, self.n_features = X.shape |
| 69 | |
| 70 | # Initialize weights + bias term |
| 71 | self.theta = np.random.normal(size=(self.n_features + 1), scale=0.5) |
| 72 | |
| 73 | # Add an intercept column |
| 74 | self.X = self._add_intercept(self.X) |
| 75 | |
| 76 | self._train() |
| 77 | |
| 78 | @staticmethod |
| 79 | def _add_intercept(X): |
nothing calls this directly
no test coverage detected