| |
Methods defined here:
- __init__(self, formula=None, data=None, data_sequence_column=None, data_order_column=None)
- DESCRIPTION:
The NaiveBayesMap and NaiveBayesReduce functions generate a model from
training data. A virtual data frame of training data is input to
the NaiveBayesMap function, whose output is the input to
NaiveBayesReduce function, which outputs the model.
PARAMETERS:
formula:
Required Argument.
A string consisting of "formula". Specifies the model to be fitted. Only
basic formula of the "col1 ~ col2 + col3 +..." form is supported and
all variables must be from the same virtual data frame object. The
response should be column of type real, numeric, integer or boolean.
Types: str
data:
Required Argument.
This is teradataml DataFrame defining the input training data.
data_order_column:
Optional Argument.
Specifies Order By columns for data.
Values to this argument can be provided as a list, if multiple
columns are used for ordering.
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 NaiveBayes.
Output teradataml DataFrames can be accessed using attribute
references, such as NaiveBayesObj.<attribute_name>.
Output teradataml DataFrame attribute name is:
result
RAISES:
TeradataMlException
EXAMPLES:
# Load the data to run the example
load_example_data("NaiveBayes","nb_iris_input_train")
# Create teradataml DataFrame object.
nb_iris_input_train = DataFrame.from_table("nb_iris_input_train")
# Run the train function
naivebayes_train = NaiveBayes(formula="species ~ petal_length + sepal_width + petal_width + sepal_length",
data=nb_iris_input_train)
# Print the result DataFrame
print(naivebayes_train.result)
- __repr__(self)
- Returns the string representation for a NaiveBayes 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.
|