Skip to content
Merged

style #141

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion _doc/examples/plot_kmeans_l1.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from sklearn.cluster import KMeans
from mlinsights.mlmodel import KMeansL1L2


######################################################################
# Simple datasets
# ---------------
Expand Down
1 change: 0 additions & 1 deletion _doc/examples/plot_piecewise_linear_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion _doc/examples/plot_predictable_tsne.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion _doc/examples/plot_quantile_mlpregression.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion _doc/examples/plot_regression_confidence_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion _doc/examples/plot_search_images_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion _doc/examples/plot_sklearn_transformed_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion _doc/examples/plot_traceable_ngrams_tfidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
TraceableTfidfVectorizer,
)


corpus = numpy.array(
[
"This is the first document.",
Expand Down
1 change: 0 additions & 1 deletion _doc/examples/plot_visualize_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
)
from mlinsights.plotting import pipeline2dot, pipeline2str


iris = datasets.load_iris()
X = iris.data[:, :4]
df = pandas.DataFrame(X)
Expand Down
14 changes: 4 additions & 10 deletions _unittests/ut_plotting/test_dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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"]
Expand Down
Loading