Skip to content

Commit

Permalink
remoes telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
edublancas committed Sep 18, 2024
1 parent 175e6c9 commit 04308d8
Show file tree
Hide file tree
Showing 15 changed files with 3 additions and 34 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## 0.12.2dev

- [Feature] Removes telemetry

## 0.12.1 (2024-02-07)

- [Feature] Adds `ploomber-extension` as dependency
Expand Down
3 changes: 0 additions & 3 deletions doc/reference/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@

[See here](https://docs.ploomber.io/en/latest/community/coc.html)

## Telemetry

[See here](https://docs.ploomber.io/en/latest/community/user-stats.html)
2 changes: 0 additions & 2 deletions src/sklearn_evaluation/plot/grid_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import matplotlib.pyplot as plt
import numpy as np
from six import string_types
from sklearn_evaluation.telemetry import SKLearnEvaluationLogger

from sklearn_evaluation.plot.matplotlib.bar import BarShifter

Expand Down Expand Up @@ -50,7 +49,6 @@ def _validate_kind_input(kind, valid):
validate.keys(valid, passed=kind, name="kind")


@SKLearnEvaluationLogger.log(feature="plot")
@modify_exceptions
def grid_search(
cv_results_, change, subset=None, kind="line", cmap=None, ax=None, sort=True
Expand Down
2 changes: 0 additions & 2 deletions src/sklearn_evaluation/plot/ks_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
from sklearn_evaluation.telemetry import SKLearnEvaluationLogger
from ploomber_core.exceptions import modify_exceptions
from sklearn_evaluation.plot.style import apply_theme

Expand Down Expand Up @@ -141,7 +140,6 @@ def _binary_ks_curve(y_true, y_score):


@apply_theme()
@SKLearnEvaluationLogger.log(feature="plot")
@modify_exceptions
def ks_statistic(
y_true,
Expand Down
2 changes: 0 additions & 2 deletions src/sklearn_evaluation/plot/learning_curve.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import numpy as np
import matplotlib.pyplot as plt
from sklearn_evaluation.telemetry import SKLearnEvaluationLogger
from ploomber_core.exceptions import modify_exceptions
from sklearn_evaluation.plot.style import apply_theme


@apply_theme()
@SKLearnEvaluationLogger.log(feature="plot")
@modify_exceptions
def learning_curve(train_scores, test_scores, train_sizes, ax=None):
"""Plot a learning curve
Expand Down
2 changes: 0 additions & 2 deletions src/sklearn_evaluation/plot/metrics.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import numpy as np
from sklearn_evaluation.metrics import compute_at_thresholds
from sklearn_evaluation.plot.util import set_default_ax
from sklearn_evaluation.telemetry import SKLearnEvaluationLogger
from ploomber_core.exceptions import modify_exceptions


@set_default_ax
@SKLearnEvaluationLogger.log(feature="plot")
@modify_exceptions
def metrics_at_thresholds(fn, y_true, y_score, n_thresholds=10, start=0.0, ax=None):
"""Plot metrics at increasing thresholds"""
Expand Down
2 changes: 0 additions & 2 deletions src/sklearn_evaluation/plot/pca.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from sklearn_evaluation.telemetry import SKLearnEvaluationLogger
from ploomber_core.exceptions import modify_exceptions
from sklearn_evaluation.plot.style import apply_theme, get_color_palette

Expand Down Expand Up @@ -38,7 +37,6 @@ def _validate_inputs(X, n_components, target_names, colors, ax):

@apply_theme()
@modify_exceptions
@SKLearnEvaluationLogger.log(feature="plot")
def pca(X, y=None, target_names=None, n_components=2, colors=None, ax=None):
"""
Plot principle component analysis curve.
Expand Down
4 changes: 0 additions & 4 deletions src/sklearn_evaluation/plot/precision_recall.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from sklearn.metrics import auc
from sklearn.metrics import precision_recall_curve
from sklearn.preprocessing import label_binarize
from sklearn_evaluation.telemetry import SKLearnEvaluationLogger
from sklearn_evaluation.util import is_column_vector, is_row_vector
from sklearn_evaluation.plot.plot import AbstractComposedPlot, AbstractPlot
from sklearn_evaluation import __version__
Expand Down Expand Up @@ -133,7 +132,6 @@ class PrecisionRecall(AbstractPlot):
"""

@modify_exceptions
@SKLearnEvaluationLogger.log(feature="plot", action="precision-recall-init")
def __init__(self, precision, recall, label=None):
self.precision = precision
self.recall = recall
Expand Down Expand Up @@ -204,7 +202,6 @@ def plot(self, ax=None):
def _from_data(cls):
pass

@SKLearnEvaluationLogger.log(feature="plot", action="precision-recall-add")
def __add__(self, another):
return PrecisionRecallAdd(
precisions=[self.precision, another.precision],
Expand Down Expand Up @@ -327,7 +324,6 @@ def plot(self, ax=None):


@modify_exceptions
@SKLearnEvaluationLogger.log(feature="plot")
def precision_recall(y_true, y_score, ax=None):
"""
Plot precision-recall curve.
Expand Down
5 changes: 1 addition & 4 deletions src/sklearn_evaluation/plot/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import numpy as np
import pandas as pd

from sklearn_evaluation.telemetry import SKLearnEvaluationLogger

from sklearn.linear_model import LinearRegression
from ploomber_core.exceptions import modify_exceptions
from sklearn_evaluation.plot.style import apply_theme, get_color_palette
Expand All @@ -43,7 +43,6 @@ def _check_parameter_validity(y_true, y_pred):


@apply_theme()
@SKLearnEvaluationLogger.log(feature="plot")
@modify_exceptions
def residuals(y_true, y_pred, ax=None):
"""
Expand Down Expand Up @@ -89,7 +88,6 @@ def residuals(y_true, y_pred, ax=None):


@apply_theme()
@SKLearnEvaluationLogger.log(feature="plot")
@modify_exceptions
def prediction_error(y_true, y_pred, ax=None):
"""
Expand Down Expand Up @@ -157,7 +155,6 @@ def prediction_error(y_true, y_pred, ax=None):


@apply_theme()
@SKLearnEvaluationLogger.log(feature="plot")
@modify_exceptions
def cooks_distance(X, y, ax=None):
"""Plots cooks distance.
Expand Down
3 changes: 0 additions & 3 deletions src/sklearn_evaluation/plot/roc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import matplotlib.pyplot as plt
from sklearn.metrics import roc_curve, auc
from sklearn.preprocessing import label_binarize, LabelBinarizer
from sklearn_evaluation.telemetry import SKLearnEvaluationLogger
from sklearn_evaluation.util import (
is_column_vector,
is_row_vector,
Expand Down Expand Up @@ -350,7 +349,6 @@ class ROC(AbstractPlot):
.. versionadded:: 0.8.4
"""

@SKLearnEvaluationLogger.log(feature="plot", action="roc-init")
@modify_exceptions
def __init__(self, fpr, tpr, label=None):
if fpr is None or tpr is None:
Expand Down Expand Up @@ -389,7 +387,6 @@ def __init__(self, fpr, tpr, label=None):
self.tpr = tpr
self.label = label

@SKLearnEvaluationLogger.log(feature="plot", action="roc-add")
def __add__(self, other):
roc_add_result = ROCAdd(self, other)
roc_add_result.plot()
Expand Down
2 changes: 0 additions & 2 deletions src/sklearn_evaluation/plot/target_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import numpy as np
import matplotlib.pyplot as plt
from sklearn_evaluation.telemetry import SKLearnEvaluationLogger
from sklearn.utils.multiclass import unique_labels, type_of_target
from ploomber_core.exceptions import modify_exceptions
from sklearn_evaluation.plot.style import get_color_palette, apply_theme
Expand All @@ -42,7 +41,6 @@ def _validate_target(y):


@apply_theme()
@SKLearnEvaluationLogger.log(feature="plot")
@modify_exceptions
def target_analysis(y_train, y_test=None, labels=None, colors=None, ax=None):
"""Target analysis plot for visualising class imbalance.
Expand Down
2 changes: 0 additions & 2 deletions src/sklearn_evaluation/plot/validation_curve.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import numpy as np
import matplotlib.pyplot as plt
from sklearn_evaluation.telemetry import SKLearnEvaluationLogger
from ploomber_core.exceptions import modify_exceptions
from sklearn_evaluation.plot.style import apply_theme


@apply_theme()
@SKLearnEvaluationLogger.log(feature="plot")
@modify_exceptions
def validation_curve(
train_scores, test_scores, param_range, param_name=None, semilogx=False, ax=None
Expand Down
2 changes: 0 additions & 2 deletions src/sklearn_evaluation/report/model_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from sklearn_evaluation.report import ModelHeuristics, ReportSection
import time
import numpy as np
from sklearn_evaluation.telemetry import SKLearnEvaluationLogger


COMMUNITY_LINK = "https://ploomber.io/community"
Expand Down Expand Up @@ -276,7 +275,6 @@ def check_array_balance(self, array) -> bool:
return all(expected_range.in_range(w) for w in weights)


@SKLearnEvaluationLogger.log(feature="report", action="evaluate_model")
def evaluate_model(model, y_true, y_pred, X_test=None, y_score=None, report_title=None):
"""
Evaluates a given model and generates an HTML report
Expand Down
2 changes: 0 additions & 2 deletions src/sklearn_evaluation/report/models_comparer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from sklearn_evaluation import plot
from sklearn_evaluation.report.util import run_if_args_are_not_none, check_model
from sklearn_evaluation.report import ModelHeuristics, ReportSection, ModelEvaluator
from sklearn_evaluation.telemetry import SKLearnEvaluationLogger


class ModelsComparer(ModelHeuristics):
Expand Down Expand Up @@ -217,7 +216,6 @@ def add_combined_pr(self, X_test, y_true):
self._add_section_to_report(combined_pr_section)


@SKLearnEvaluationLogger.log(feature="report", action="compare_models")
def compare_models(model_a, model_b, X_test, y_true, report_title=None):
"""
Compares two models and generates an HTML report
Expand Down
2 changes: 0 additions & 2 deletions src/sklearn_evaluation/report/report.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from jinja2 import Template
from pathlib import Path
from sklearn_evaluation.telemetry import SKLearnEvaluationLogger

try:
import mistune
Expand Down Expand Up @@ -36,6 +35,5 @@ def __init__(self, evaluator, template=None):
def _repr_html_(self):
return self.rendered

@SKLearnEvaluationLogger.log(feature="report", action="save")
def save(self, path):
Path(path).write_text(self.rendered)

0 comments on commit 04308d8

Please sign in to comment.