Stepwise Plot

In [9]:
from verticapy.learn.linear_model import LogisticRegression
model = LogisticRegression(name = "public.LR_titanic",
                           tol = 1e-4,
                           max_iter = 100, 
                           solver = 'Newton')

from verticapy.learn.model_selection import stepwise
stepwise(model,
         input_relation = "public.titanic", 
         X = ["age", "fare", "parch", "pclass",], 
         y = "survived",
         direction = "forward",)
Starting Stepwise
[Model 0] bic: -1797.4537281723472; Variables: []
[Model 1] bic: -1937.9168392321783; (+) Variable: "pclass"
[Model 2] bic: -1943.1918759949126; (+) Variable: "fare"
[Model 3] bic: -2219.8559430056216; (+) Variable: "age"

Selected Model

[Model 3] bic: -2219.8559430056216; Variables: ['"pclass"', '"fare"', '"age"']
Out[9]:
features
bic
change
variable
importance
0[]-1797.4537281723472[null][null]0.0
1['pclass']-1937.9168392321783+"pclass"33.21504058447908
2['pclass', 'fare']-1943.1918759949126+"fare"1.2473777551759295
3['pclass', 'fare', 'parch']-1943.6797392350866-"parch"0.11536407815395282
4['pclass', 'fare', 'age']-2219.8559430056216+"age"65.42221758219104
Rows: 1-5 | Columns: 6