Linear Regression

Module: deeprai.models.regression.linear_regression

This module introduces a simple Linear Regression model. Linear Regression is a statistical technique commonly used for modeling and analyzing relationships between two variables.


Class: LinearRegression

A class representation of the linear regression model.


1. Initializer: __init__(self)

Description:

Initializes the LinearRegression class.

Attributes:

Example:

from deeprai.models.regression.linear_regression import LinearRegression

model = LinearRegression()

2. Method: fit(self, x_vals, y_vals)

Description:

Fit the model to the given x_vals and y_vals using linear regression.

Parameters:

Returns:

Example:

model.fit(x_vals=[1, 2, 3], y_vals=[2, 4, 6])

3. Method: run(self, x_val)

Description:

Use the previously fitted model to predict the output for a given x_val.

Parameters:

Returns:

Example:

predicted_val = model.run(4)
print(predicted_val)

Revision #2
Created 6 September 2023 13:17:23 by Kieran Carter
Updated 6 September 2023 13:22:17 by Kieran Carter