Passed
Push — master ( 65e4f4...bd0b66 )
by Simon
01:38
created

test.OptPipe.__init__()   A

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nop 4
1
finetuned_opt = OptPipe([("first", FooOpt())("second", BarOpt(params))], more_params)
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable params does not seem to be defined.
Loading history...
Comprehensibility Best Practice introduced by
The variable BarOpt does not seem to be defined.
Loading history...
Comprehensibility Best Practice introduced by
The variable more_params does not seem to be defined.
Loading history...
Comprehensibility Best Practice introduced by
The variable OptPipe does not seem to be defined.
Loading history...
Comprehensibility Best Practice introduced by
The variable FooOpt does not seem to be defined.
Loading history...
2
3
column_transformer = BetterColumnTransformer(
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable BetterColumnTransformer does not seem to be defined.
Loading history...
4
    [
5
        {"name": "num", "transformer": StandardScaler(), "columns": ["age", "income"]},
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable StandardScaler does not seem to be defined.
Loading history...
6
        {"name": "cat", "transformer": OneHotEncoder(), "columns": ["gender", "city"]},
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable OneHotEncoder does not seem to be defined.
Loading history...
7
    ]
8
)
9
10
11
class MyPipeline(Pipeline):
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable Pipeline does not seem to be defined.
Loading history...
12
    def transform(self, data):
13
        numeric = self.columns(["age", "income"]).apply(StandardScaler())
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable StandardScaler does not seem to be defined.
Loading history...
14
        categorical = self.columns(["gender", "city"]).apply(OneHotEncoder())
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable OneHotEncoder does not seem to be defined.
Loading history...
15
        combined = self.concat(numeric, categorical)
16
        return combined.then(SVC())
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable SVC does not seem to be defined.
Loading history...
17
18
19
finetuned_opt = OptPipe(more_params)
20
finetuned_opt.add_step(RandomOpt(), fraction=0.3)
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable RandomOpt does not seem to be defined.
Loading history...
21
finetuned_opt.add_step(fraction=0.4)
22
finetuned_opt.add_step(fraction=0.3)
23
24
finetuned_opt
25
26
27
class OptPipe:
28
    def __init__(self, a, b, c):
29
        self.a = a
30
        self.b = b
31
        self.c = c
32
33
    def set_params(self):
34
        # einzige Möglichkeit um a b c zu ändern
35
        pass
36