graphlab.linear_regression.LinearRegression.get

LinearRegression.get(field)

Get the value of a given field. The list of all queryable fields is detailed below, and can be obtained programmatically using the list_fields() method.

Field Description
coefficients Regression coefficients
convergence_threshold Desired solver accuracy
feature_rescaling Bool indicating if features were rescaled during training
features Feature column names
l1_penalty l1 regularization weight
l2_penalty l2 regularization weight
lbfgs_memory_level LBFGS memory level (‘lbfgs only’)
max_iterations Maximum number of solver iterations
num_coefficients Number of coefficients in the model
num_examples Number of examples used for training
num_features Number of dataset columns used for training
num_unpacked_features Number of features (including expanded list/dict features)
solver Type of solver
step_size Initial step size for the solver
target Target column name
training_iterations Number of solver iterations
training_loss Residual sum-of-squares training loss
training_rmse Training root-mean-squared-error (RMSE)
training_solver_status Solver status after training
training_time Training time (excludes preprocessing)
unpacked_features Feature names (including expanded list/dict features)
Parameters:

field : string

Name of the field to be retrieved.

Returns:

out : [various]

The current value of the requested field.

See also

list_fields

Examples

>>> data =  graphlab.SFrame('https://static.turi.com/datasets/regression/houses.csv')
>>> model = graphlab.linear_regression.create(data,
                                     target='price',
                                     features=['bath', 'bedroom', 'size'])
>>> print model['num_features']
3
>>> print model.get('num_features')       # equivalent to previous line
3