doenut.models.model

Module Contents

Classes

Model

A simple linear regression model.

class doenut.models.model.Model(data: doenut.data.data_set.DataSet, fit_intercept: bool)[source]

A simple linear regression model.

Note

This class mostly exists as a base - you probably want AveragedModel

Parameters:
  • data (doenut.data.DataSet) – The inputs and responses for this model

  • fit_intercept (bool) – Whether to fit the intercept of the model to the axis

get_predictions_for(inputs: pandas.DataFrame) pandas.DataFrame[source]

Generates the predictions of the model for a set of inputs

Parameters:

inputs (pd.DataFrame) – The inputs to test against.

Returns:

the predictions from the model

Return type:

pd.DataFrame

get_r2_for(data: doenut.data.data_set.DataSet)[source]

Calculate the R2 Pearson coefficient for a given pairing of inputs and responses.

Parameters:

data (doenut.data.DataSet) – The data to test.

Returns:

The calculated R2 value as a float

Return type:

float