[
https://issues.apache.org/jira/browse/MADLIB-907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15281920#comment-15281920
]
Orhan Kislal commented on MADLIB-907:
-------------------------------------
A follow up to the previous comment. Here is a generic python function to place
the srf output into a table. This reduces the redundant replication of create
table lines as [~riyer] mentioned.
def pm_srf_into_table(
schema_madlib, func_name, table_in, table_out,
prediction_col, observed_col, grouping_cols):
sql_st = """
CREATE TABLE {table_out} AS
SELECT * FROM {schema_madlib}.{func_name}(
'{table_in}', '{prediction_col}', '{observed_col}', '{grouping_cols}'
) AS srf({func_name} FLOAT8)
""".format(**locals())
plpy.execute(sql_st)
> Prediction Metrics
> ------------------
>
> Key: MADLIB-907
> URL: https://issues.apache.org/jira/browse/MADLIB-907
> Project: Apache MADlib
> Issue Type: New Feature
> Components: Module: Utilities
> Reporter: Frank McQuillan
> Assignee: Orhan Kislal
> Fix For: v1.9.1
>
> Attachments: interface_v1.sql, interface_v3.sql
>
>
> Story
> As a data scientist, I want to compute prediction metrics on my data, so that
> I can gauge model accuracy based on predicted values vs. actual values.
> 1) The PDL Tools modules "Prediction Metrics" [1] is an example of what
> could be ported to MADlib. Source code is located at [2].
> 2) Here is functionality from PDL tools to use as a starting point:
> mf_mae
> Mean Absolute Error.
>
> mf_mape
> Mean Absolute Percentage Error.
>
> mf_mpe
> Mean Percentage Error.
>
> mf_rmse
> Root Mean Square Error.
>
> mf_r2
> R-squared.
>
> mf_adjusted_r2
> Adjusted R-squared.
>
> mf_binary_classifier
> Metrics for binary classification.
>
> mf_auc
> Area under the ROC curve (in binary classification).
>
> mf_confusion_matrix
> Confusion matrix for a multi-class classifier.
> References
> [1] PDL Tools Prediction Metrics module
> http://pivotalsoftware.github.io/PDLTools/group__grp__prediction__metrics.html
> [2] PDL tools source code
> https://github.com/pivotalsoftware/PDLTools
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)