explained_variance

In [ ]:
explained_variance(y_true: str, 
                   y_score: str, 
                   input_relation: Union[str, vDataFrame)]

Computes the Explained Variance.

Parameters

Name Type Optional Description
y_true
str
Response column.
y_score
str
Prediction.
input_relation
str / vDataFrame
The relation used for scoring. This relation can be a view, table, or customized relation. For example, you could write: "(SELECT ... FROM ...) x" as long as an alias is given at the end of the relation.

Returns

float : score

Example

In [116]:
from verticapy import vDataFrame
vDataFrame("regression_example")
123
y_score
Float
123
y_true
Int
14.832308288163425
24.909738654714036
34.935815710390533
44.947535295563053
54.975998206969145
64.982522351352353
75.005682845106845
85.024211496638075
95.024211496638075
105.064083112937236
115.075937203610935
125.078563969201396
135.081377231478774
145.084364970194894
155.084853360026916
165.084879752897756
175.085556272115735
185.091282850385094
195.095030375968975
205.105457554546765
215.106177583984265
225.110608571099186
235.111571844297754
245.121739442811585
255.127490705681145
265.127893489992835
275.129403172807525
285.131055198979555
295.135300256946036
305.13791845248856
315.13791845248856
325.142527304180925
335.14362535775835
345.144316949806338
355.146018784709785
365.149178231397563
375.154046880934276
385.162783904335795
395.16618467797084
405.17253456369565
415.173604525368635
425.175620145960565
435.17610224155376
445.17610224155376
455.176432226603135
465.176781874723894
475.177170721973565
485.178427398113856
495.178427398113856
505.179197165675295
515.179197165675295
525.180323093376685
535.182327890858815
545.184220689949766
555.184220689949766
565.184338698465036
575.185387013918476
585.185387013918476
595.185387013918476
605.18587080854516
615.18587080854516
625.186435329371916
635.186435329371916
645.187122889480015
655.189975066771536
665.191345151948687
675.191345151948687
685.192301704584856
695.193990671859885
705.194083068550085
715.195500917940035
725.196494194589975
735.197114184514145
745.197326643778045
755.198810496987355
765.199586771603876
775.200949436011246
785.201697557353086
795.201907971795695
805.204237084724174
815.205886072170044
825.20774986598755
835.20782492754875
845.208191910798457
855.208377210346994
865.208861856626895
875.208861856626895
885.210146970156646
895.210798729202815
905.211591842017355
915.211591842017355
925.211608893031564
935.21208016551495
945.214714640262955
955.214860958462896
965.215145516478986
975.215798974558656
985.216030396383814
995.217021046775395
1005.218114505147396
Out[116]:
Rows: 1-100 of 6497 | Columns: 2
In [117]:
from verticapy.learn.metrics import explained_variance
explained_variance("y_true", "y_score", "regression_example")
Out[117]:
0.214960768970105