| |
- GetFutileColumns(data=None, object=None, category_summary_column='ColumnName', threshold_value=0.95, **generic_arguments)
- DESCRIPTION:
GetFutileColumns() function returns the futile column names if either
of the conditions is met:
* If all the values in the columns are unique
* If all the values in the columns are the same
* If the count of distinct values in the columns divided by the
count of the total number of rows in the input data is greater than
or equal to the threshold value
Notes:
* This function requires the UTF8 client character set for UNICODE data.
* This function does not support Pass Through Characters (PTCs).
For information about PTCs, see Teradata Vantage™ - Advanced SQL Engine
International Character Set Support.
* This function does not support KanjiSJIS or Graphic data types.
* This function works only for categorical data.
PARAMETERS:
data:
Required Argument.
Specifies the input teradataml DataFrame.
Types: teradataml DataFrame
object:
Required Argument.
Specifies the teradataml DataFrame containing the categorical summary
generated by CategoricalSummary() or the instance of CategoricalSummary.
Types: teradataml DataFrame or CategoricalSummary
category_summary_column:
Optional Argument.
Specifies the column from categorical summary DataFrame which provides names of
the columns in "data".
Default Value: 'ColumnName'
Types: str
threshold_value:
Optional Argument.
Specifies the threshold value for the columns in "data".
Default Value: 0.95
Types: float
**generic_arguments:
Specifies the generic keyword arguments SQLE functions accept. Below
are the generic keyword arguments:
persist:
Optional Argument.
Specifies whether to persist the results of the
function in a table.
When set to True, results are persisted in a table;
otherwise, results are garbage collected at the end of the
session.
Default Value: False
Types: bool
volatile:
Optional Argument.
Specifies whether to put the results of the
function in a volatile table.
When set to True, results are stored in a volatile table,
otherwise not.
Default Value: False
Types: bool
Function allows the user to partition, hash, order or local
order the input data. These generic arguments are available
for each argument that accepts teradataml DataFrame as
input and can be accessed as:
* "<input_data_arg_name>_partition_column" accepts str or
list of str (Strings)
* "<input_data_arg_name>_hash_column" accepts str or list
of str (Strings)
* "<input_data_arg_name>_order_column" accepts str or list
of str (Strings)
* "local_order_<input_data_arg_name>" accepts boolean
Note:
These generic arguments are supported by teradataml if
the underlying SQL Engine function supports, else an
exception is raised.
RETURNS:
Instance of GetFutileColumns.
Output teradataml DataFrames can be accessed using attribute
references, such as GetFutileColumnsObj.<attribute_name>.
Output teradataml DataFrame attribute name is:
result
RAISES:
TeradataMlException, TypeError, ValueError
EXAMPLES:
# Notes:
# 1. Get the connection to Vantage to execute the function.
# 2. One must import the required functions mentioned in
# the example from teradataml.
# 3. Function will raise error if not supported on the Vantage
# user is connected to.
# Load the example data.
load_example_data("teradataml", ["titanic"])
# Create teradataml DataFrame objects.
titanic = DataFrame.from_table("titanic")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1 : Get futiles columns from target columns 'cabin', 'sex', and 'ticket'.
CategoricalSummary_out = CategoricalSummary(data=titanic,
target_columns=["cabin", "sex", "ticket"])
GetFutileColumns_out = GetFutileColumns(data=titanic,
object=CategoricalSummary_out,
category_summary_column="ColumnName",
threshold_value=0.7
)
# Print the result DataFrame.
print(GetFutileColumns_out.result)
|