Model.fit

In [ ]:
Model.fit(input_relation: (str, vDataFrame),
          X: list,
          y: str, 
          test_relation: (str, vDataFrame) = "")

Trains the model.

Parameters

Name Type Optional Description
input_relation
str / vDataFrame
Training relation.
X
list
List of the predictors.
y
str
Response column.
test_relation
str / vDataFrame
Relation to use to test the model.

Returns

object : self

Example

In [71]:
from verticapy.learn.linear_model import LogisticRegression
model = LogisticRegression(name = "public.logit_titanic")
model.fit("public.titanic", ["fare", "age"], "survived")
Out[71]:

=======
details
=======
predictor|coefficient|std_err |z_value |p_value 
---------+-----------+--------+--------+--------
Intercept| -0.09135  | 0.15559|-0.58709| 0.55714
  fare   |  0.01546  | 0.00212| 7.29445| 0.00000
   age   | -0.01439  | 0.00475|-3.02600| 0.00248


==============
regularization
==============
type| lambda 
----+--------
 l2 | 1.00000


===========
call_string
===========
logistic_reg('public.logit_titanic', 'public.titanic', '"survived"', '"fare", "age"'
USING PARAMETERS optimizer='cgd', epsilon=0.0001, max_iterations=100, regularization='l2', lambda=1, alpha=0)

===============
Additional Info
===============
       Name       |Value
------------------+-----
 iteration_count  |  5  
rejected_row_count| 238 
accepted_row_count| 996