From 37347dcbfe5eb26abf87a5a42f2b73a78bccefe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Dupr=C3=A9?= Date: Sun, 18 Jan 2026 13:09:09 +0100 Subject: [PATCH] style --- _doc/examples/plot_kmeans_l1.py | 1 - _doc/examples/plot_piecewise_linear_regression.py | 1 - _doc/examples/plot_predictable_tsne.py | 1 - _doc/examples/plot_quantile_mlpregression.py | 1 - .../plot_regression_confidence_interval.py | 1 - _doc/examples/plot_search_images_torch.py | 1 - _doc/examples/plot_sklearn_transformed_target.py | 1 - _doc/examples/plot_traceable_ngrams_tfidf.py | 1 - _doc/examples/plot_visualize_pipeline.py | 1 - _unittests/ut_plotting/test_dot.py | 14 ++++---------- 10 files changed, 4 insertions(+), 19 deletions(-) diff --git a/_doc/examples/plot_kmeans_l1.py b/_doc/examples/plot_kmeans_l1.py index 6ab0bba..51b2179 100644 --- a/_doc/examples/plot_kmeans_l1.py +++ b/_doc/examples/plot_kmeans_l1.py @@ -14,7 +14,6 @@ from sklearn.cluster import KMeans from mlinsights.mlmodel import KMeansL1L2 - ###################################################################### # Simple datasets # --------------- diff --git a/_doc/examples/plot_piecewise_linear_regression.py b/_doc/examples/plot_piecewise_linear_regression.py index b235468..2d15e00 100644 --- a/_doc/examples/plot_piecewise_linear_regression.py +++ b/_doc/examples/plot_piecewise_linear_regression.py @@ -26,7 +26,6 @@ from sklearn.dummy import DummyRegressor from mlinsights.mlmodel import PiecewiseRegressor - X = npr.normal(size=(1000, 4)) alpha = [4, -2] t = (X[:, 0] + X[:, 3] * 0.5) > 0 diff --git a/_doc/examples/plot_predictable_tsne.py b/_doc/examples/plot_predictable_tsne.py index 8cbc22c..c340c25 100644 --- a/_doc/examples/plot_predictable_tsne.py +++ b/_doc/examples/plot_predictable_tsne.py @@ -28,7 +28,6 @@ from sklearn.preprocessing import StandardScaler from mlinsights.mlmodel import PredictableTSNE - digits = datasets.load_digits(n_class=6) Xd = digits.data yd = digits.target diff --git a/_doc/examples/plot_quantile_mlpregression.py b/_doc/examples/plot_quantile_mlpregression.py index e7df984..cff2546 100644 --- a/_doc/examples/plot_quantile_mlpregression.py +++ b/_doc/examples/plot_quantile_mlpregression.py @@ -17,7 +17,6 @@ from sklearn.neural_network import MLPRegressor from mlinsights.mlmodel import QuantileMLPRegressor - X = numpy.random.random(1000) eps1 = (numpy.random.random(900) - 0.5) * 0.1 eps2 = (numpy.random.random(100)) * 10 diff --git a/_doc/examples/plot_regression_confidence_interval.py b/_doc/examples/plot_regression_confidence_interval.py index a23b3f9..6788f5f 100644 --- a/_doc/examples/plot_regression_confidence_interval.py +++ b/_doc/examples/plot_regression_confidence_interval.py @@ -35,7 +35,6 @@ from sklearn.tree import DecisionTreeRegressor from mlinsights.mlmodel import IntervalRegressor, QuantileLinearRegression - N = 200 X = rand(N, 1) * 2 eps = randn(N, 1) * 0.2 diff --git a/_doc/examples/plot_search_images_torch.py b/_doc/examples/plot_search_images_torch.py index 3b002c1..a2a3e09 100644 --- a/_doc/examples/plot_search_images_torch.py +++ b/_doc/examples/plot_search_images_torch.py @@ -26,7 +26,6 @@ from mlinsights.plotting import plot_gallery_images from torchvision.models.squeezenet import SqueezeNet1_0_Weights - model = models.squeezenet1_0(weights=SqueezeNet1_0_Weights.IMAGENET1K_V1) model diff --git a/_doc/examples/plot_sklearn_transformed_target.py b/_doc/examples/plot_sklearn_transformed_target.py index c0470ae..41deeda 100644 --- a/_doc/examples/plot_sklearn_transformed_target.py +++ b/_doc/examples/plot_sklearn_transformed_target.py @@ -31,7 +31,6 @@ from mlinsights.mlmodel import TransformedTargetRegressor2 from mlinsights.mlmodel import TransformedTargetClassifier2 - rnd = random((1000, 1)) rndn = randn(1000) X = rnd[:, :1] * 10 diff --git a/_doc/examples/plot_traceable_ngrams_tfidf.py b/_doc/examples/plot_traceable_ngrams_tfidf.py index 971acaf..7123ffd 100644 --- a/_doc/examples/plot_traceable_ngrams_tfidf.py +++ b/_doc/examples/plot_traceable_ngrams_tfidf.py @@ -22,7 +22,6 @@ TraceableTfidfVectorizer, ) - corpus = numpy.array( [ "This is the first document.", diff --git a/_doc/examples/plot_visualize_pipeline.py b/_doc/examples/plot_visualize_pipeline.py index 750389f..6a341c0 100644 --- a/_doc/examples/plot_visualize_pipeline.py +++ b/_doc/examples/plot_visualize_pipeline.py @@ -34,7 +34,6 @@ ) from mlinsights.plotting import pipeline2dot, pipeline2str - iris = datasets.load_iris() X = iris.data[:, :4] df = pandas.DataFrame(X) diff --git a/_unittests/ut_plotting/test_dot.py b/_unittests/ut_plotting/test_dot.py index 5f4a156..bcf6933 100644 --- a/_unittests/ut_plotting/test_dot.py +++ b/_unittests/ut_plotting/test_dot.py @@ -122,8 +122,7 @@ def test_union_features(self): self.assertIn("MinMaxScaler", dot) def test_onehotencoder_dot(self): - data = dedent( - """ + data = dedent(""" date,value,notrend,trend,weekday,lag1,lag2,lag3,lag4,lag5,lag6,lag7,lag8 2017-07-10 13:27:04.669830,0.003463591425601385,0.0004596547917981044,0.0030039366338032807, ###0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 @@ -151,8 +150,7 @@ def test_onehotencoder_dot(self): 2017-07-21 13:27:04.669830,0.005866058541412791,0.00217339675927127,0.0036926617821415207,4,0.004773874566436903, ###0.004200435956007872,0.0038464710972236286,0.0035533180858140765,0.008716378909294038,0.006336617719481035, ###0.006078151848127084,0.004277700876279705 - """ - ).replace("\n###", "") + """).replace("\n###", "") df = pandas.read_csv(StringIO(data)) cols = ["lag1", "lag2", "lag3", "lag4", "lag5", "lag6", "lag7", "lag8"] model = make_pipeline( @@ -180,9 +178,7 @@ def test_pipeline_tr_small(self): 7.8,0.76,0.04,2.3,0.092,15.0,54.0,0.997,3.26,0.65,9.8,5,red 11.2,0.28,0.56,1.9,0.075,17.0,60.0,0.998,3.16,0.58,9.8,6,white 7.4,0.7,0.0,1.9,0.076,11.0,34.0,0.9978,3.51,0.56,9.4,5,red - """.replace( - " ", "" - ) + """.replace(" ", "") X_train = pandas.read_csv(StringIO(buffer)).drop("quality", axis=1) pipe = Pipeline( @@ -224,9 +220,7 @@ def test_pipeline_tr(self): 7.8,0.76,0.04,2.3,0.092,15.0,54.0,0.997,3.26,0.65,9.8,5,red 11.2,0.28,0.56,1.9,0.075,17.0,60.0,0.998,3.16,0.58,9.8,6,white 7.4,0.7,0.0,1.9,0.076,11.0,34.0,0.9978,3.51,0.56,9.4,5,red - """.replace( - " ", "" - ) + """.replace(" ", "") X_train = pandas.read_csv(StringIO(buffer)).drop("quality", axis=1) numeric_features = [c for c in X_train if c != "color"]