Teradata Package for Python Function Reference - LAR - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.

Teradata® Package for Python Function Reference

Product
Teradata Package for Python
Release Number
17.00
Published
November 2021
Language
English (United States)
Last Update
2021-11-19
lifecycle
previous
Product Category
Teradata Vantage

 
teradataml.analytics.mle.LAR = class LAR(builtins.object)
     Methods defined here:
__init__(self, formula=None, data=None, type='LASSO', max_steps=None, normalize=True, intercept=True, data_sequence_column=None)
DESCRIPTION:
    The LAR (Least Angle Regression) function creates a model that the function LARPredict uses to
    make predictions for the response variables.
 
 
PARAMETERS:
    formula:
        Required Argument.
        A string consisting of "formula". Specifies the model to be fitted.
        Only basic formula of the "col1 ~ col2 + col3 +..." form are
        supported and all variables must be from the same teradataml
        DataFrame object. The response should be column of type float, int or
        bool.
        Types: str
 
    data:
        Required Argument.
        Specifies the name of the input teradataml DataFrame.
 
    type:
        Optional Argument.
        Specifies the method to use for linear regression.
        Default Value: "LASSO"
        Permitted Values: LAR, LASSO
        Types: str
 
    max_steps :
        Optional Argument.
        Specifies the maximum number of steps the function executes. The
        default value is 8 * min(number_of_predictors, sample_size -
        intercept).
        For example, if the number of predictors is 11, the sample size
        (number of rows in the input teradataml DataFrame) is 1532, and the intercept
        is 1, then the default value is 8 * min(11, 1532 - 1) = 88.
        Types: int
 
    normalize:
        Optional Argument.
        Specifies whether each predictor is standardized to have unit L2
        norm.
        Default Value: True
        Types: bool
 
    intercept:
        Optional Argument.
        Specifies whether an intercept is included in the model (and not
        penalized).
        Default Value: True
        Types: bool
 
    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 LAR.
    Output teradataml DataFrames can be accessed using attribute
    references, such as LARObj.<attribute_name>.
    Output teradataml DataFrame attribute name is:
        1. output_table
        2. output
 
 
RAISES:
    TeradataMlException
 
 
EXAMPLES:
    # Load example data
    load_example_data("lar", "diabetes")
 
    # Create teradataml DataFrame objects.
    diabetes = DataFrame.from_table("diabetes")
 
    # Example - Build a LAR model with response variable 'y' and ten baseline predictors
    LAR_out = LAR(formula = "y ~ hdl + glu + ldl + map1 + sex + tch + age + ltg + bmi + tc",
                  data = diabetes,
                  type = "lar",
                  max_steps  = 20,
                  normalize = True,
                  intercept = True
                  )
 
    # Print the results
    print(LAR_out)
__repr__(self)
Returns the string representation for a LAR 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.