diff --git a/wandb/sklearn/__init__.py b/wandb/sklearn/__init__.py index 9f8ddc28220..012c1ce9d26 100644 --- a/wandb/sklearn/__init__.py +++ b/wandb/sklearn/__init__.py @@ -5,7 +5,6 @@ plot_classifier, plot_clusterer, plot_confusion_matrix, - plot_decision_boundaries, plot_elbow_curve, plot_feature_importances, plot_learning_curve, @@ -30,7 +29,6 @@ "plot_roc", "plot_precision_recall", "plot_confusion_matrix", - "plot_decision_boundaries", "plot_elbow_curve", "plot_silhouette", "plot_residuals", diff --git a/wandb/sklearn/plot/__init__.py b/wandb/sklearn/plot/__init__.py index 22e4fa499d9..c4e9d4bcf68 100644 --- a/wandb/sklearn/plot/__init__.py +++ b/wandb/sklearn/plot/__init__.py @@ -3,7 +3,6 @@ from .classifier import class_proportions as plot_class_proportions from .classifier import classifier as plot_classifier from .classifier import confusion_matrix as plot_confusion_matrix -from .classifier import decision_boundaries as plot_decision_boundaries from .classifier import feature_importances as plot_feature_importances from .classifier import precision_recall as plot_precision_recall from .classifier import roc as plot_roc @@ -28,7 +27,6 @@ "plot_roc", "plot_precision_recall", "plot_confusion_matrix", - "plot_decision_boundaries", "plot_elbow_curve", "plot_silhouette", "plot_residuals", diff --git a/wandb/sklearn/plot/classifier.py b/wandb/sklearn/plot/classifier.py index 3fb479449d6..647ce9a809a 100644 --- a/wandb/sklearn/plot/classifier.py +++ b/wandb/sklearn/plot/classifier.py @@ -319,68 +319,3 @@ def calibration_curve(clf=None, X=None, y=None, clf_name="Classifier"): calibration_curve_chart = calculate.calibration_curves(clf, X, y, clf_name) wandb.log({"calibration_curve": calibration_curve_chart}) - - -def decision_boundaries(binary_clf=None, X=None, y=None): - """Visualizes decision boundaries of a binary classifier. - - Works by sampling from the feature space where the classifier's uncertainty - if greater than > 0.5 and projecting these point to 2D space. - - Useful for measuring model (decision boundary) complexity, visualizing - regions where the model falters, and to determine whether any over or - underfitting occured. - - Should only be called with a fitted **binary** classifer (otherwise an error is - thrown). Please note this function fits variations of the model on the - training set when called. - - Arguments: - model: (clf) Takes in a fitted binary classifier. - X_train: (arr) Training set features. - y_train: (arr) Training set labels. - - Returns: - None: To see plots, go to your W&B run page then expand the 'media' tab - under 'auto visualizations'. - - Example: - ```python - wandb.sklearn.plot_decision_boundaries(binary_classifier, X, y) - ``` - """ - if utils.test_missing(binary_clf=binary_clf, X=X, y=y) and utils.test_types( - binary_clf=binary_clf, X=X, y=y - ): - y = np.asarray(y) - # plot high-dimensional decision boundary - db = DBPlot(binary_clf) - db = None - db.fit(X, y) - ( - decision_boundary_x, - decision_boundary_y, - decision_boundary_color, - train_x, - train_y, - train_color, - test_x, - test_y, - test_color, - ) = db.plot() - - wandb.log( - { - "decision_boundaries": calculate.decision_boundaries( - decision_boundary_x, - decision_boundary_y, - decision_boundary_color, - train_x, - train_y, - train_color, - test_x, - test_y, - test_color, - ) - } - )