result_set#


class ResultSet(df: DataFrame)[source]#

Bases: object

A result set which is designed for interactive result inspection (e.g. in an iPython notebook). An instance can, for example, be created with a data frame as returned by VectorRegressionModelEvaluationData.to_data_frame and subsequently be applied to interactively analyse the results.

The class is designed to be subclassed, such that, in particular, method _show_df can be overridden to display meaningful information (use case-specific) in the notebook environment.

query(sql: str) ResultSet[source]#

Queries the result set with the given condition specified in SQL syntax.

NOTE: Requires duckdb to be installed.

Parameters:

sql – an SQL query starting with the WHERE clause (excluding the ‘where’ keyword itself)

Returns:

the result set corresponding to the query

show(first: Optional[int] = None, sample: Optional[int] = None) None[source]#

Shows all or some of the result set’s contents.

Parameters:
  • first – if not None, show this many rows from the start of the result set

  • sample – if not None, sample this many rows from the result set to be shown

class RegressionResultSet(df: DataFrame, predicted_var_names: List[str])[source]#

Bases: ResultSet

classmethod from_regression_eval_data(eval_data: VectorRegressionModelEvaluationData, modify_input_df: bool = False, output_col_name_override: Optional[str] = None, regression_result_set_factory: Callable[[DataFrame, List[str]], RegressionResultSet] = None) RegressionResultSet[source]#
static col_name_predicted(predicted_var_name: str)[source]#
static col_name_ground_truth(predicted_var_name: str)[source]#
static col_name_error(predicted_var_name: str)[source]#
static col_name_abs_error(predicted_var_name: str)[source]#
eval_stats(predicted_var_name: Optional[str] = None)[source]#

Creates the evaluation stats object for this result object, which can be used to compute metrics or to create plots.

Parameters:

predicted_var_name – the name of the predicted variable for which to create the object; can be None if there is but a single variable

Returns:

the evaluation stats object