| |
Methods defined here:
- __init__(self, data=None, feature_columns=None, time_interval_column=None, event_column=None, threshold=1e-09, max_iter_num=10, categorical_columns=None, accumulate=None, data_sequence_column=None)
- DESCRIPTION:
The CoxPH function is named for the Cox proportional hazards model, a
statistical survival model. The function estimates coefficients by
learning a set of explanatory variables. The output of the CoxPH
function is input to the function CoxHazardRatio and CoxSurvFit.
PARAMETERS:
data:
Required Argument.
Specifies the name of the teradataml DataFrame that contains the
input parameters.
feature_columns:
Required Argument.
Specifies the names of the input teradataml DataFrame columns that
contain the features of the input parameters.
Types: str OR list of Strings (str)
time_interval_column:
Required Argument.
Specifies the name of the column in input_table that contains the
time intervals of the input parameters; that is, end_time -
start_time, in any unit of time (for example, years, months, or days).
Types: str
event_column:
Required Argument.
Specifies the name of the column in input_table that contains 1 if
the event occurred by end_time and 0 if it did not. (0 represents
survival or right-censorship.) The function ignores values other than
1 and 0.
Types: str
threshold:
Optional Argument.
Specifies the convergence threshold.
Default Value: 1.0E-9
Types: float
max_iter_num:
Optional Argument.
Specifies the maximum number of iterations that the function runs
before finishing, if the convergence threshold has not been met.
Default Value: 10
Types: int
categorical_columns:
Optional Argument.
Specifies the names of the input teradataml DataFrame columns that
contain categorical predictors. Each categorical_column must also be
a feature_column. By default, the function detects the categorical
columns by their SQL data types.
Types: str OR list of Strings (str)
accumulate:
Optional Argument.
Specifies the names of the columns in input_table that the function
copies to linear_predictor_table.
Types: str OR list of Strings (str)
data_sequence_column:
Optional Argument.
Specifies the list of column(s) that uniquely identifies each row of
the input argument "data". The argument is used to ensure
deterministic results for functions which produce results that vary
from run to run.
Types: str OR list of Strings (str)
RETURNS:
Instance of CoxPH.
Output teradataml DataFrames can be accessed using attribute
references, such as CoxPHObj.<attribute_name>.
Output teradataml DataFrame attribute names are:
1. coefficient_table
2. linear_predictor_table
3. output
RAISES:
TeradataMlException
EXAMPLES:
# Load the data to run the example
load_example_data("coxph", "lungcancer")
# Create teradataml DataFrame objects.
lungcancer = DataFrame.from_table("lungcancer")
# Example 1 -
coxph_out = CoxPH(data = lungcancer,
feature_columns = ["trt","celltype","karno","diagtime","age","prior"],
time_interval_column = "time_int",
event_column = "status",
categorical_columns = ["trt","celltype","prior"]
)
# Print the results
print(coxph_out.coefficient_table)
print(coxph_out.linear_predictor_table)
print(coxph_out.output)
- __repr__(self)
- Returns the string representation for a CoxPH class instance.
- get_build_time(self)
- Function to return the build time of the algorithm in seconds.
When model object is created using retrieve_model(), then the value returned is
as saved in the Model Catalog.
- get_prediction_type(self)
- Function to return the Prediction type of the algorithm.
When model object is created using retrieve_model(), then the value returned is
as saved in the Model Catalog.
- get_target_column(self)
- Function to return the Target Column of the algorithm.
When model object is created using retrieve_model(), then the value returned is
as saved in the Model Catalog.
- show_query(self)
- Function to return the underlying SQL query.
When model object is created using retrieve_model(), then None is returned.
|