def test_finalize(self):
model = neighbors.KNeighborsClassifier(3)
viz = DecisionBoundariesVisualizer(
model, features=['one', 'two'], show_scatter=False)
fitted_viz = viz.fit(X_two_cols, y=y)
fitted_viz.draw(X_two_cols, y=y)
fitted_viz.ax = mock.Mock()
fitted_viz.ax.legend = mock.MagicMock()
fitted_viz.ax.set_xlabel = mock.MagicMock()
fitted_viz.ax.set_ylabel = mock.MagicMock()
fitted_viz.poof()
fitted_viz.ax.legend.assert_called_once_with(loc='best', frameon=True)
fitted_viz.ax.set_xlabel.assert_called_once_with('one')
fitted_viz.ax.set_ylabel.assert_called_once_with('two')
评论列表
文章目录