2.2coeffs
2.3predict
2.4r2_adj
8.18
top
← prev up next →

linear-regressionπŸ”— i

Gabriel Haeck <haeckgabriel@gmail.com>

This pakcage performs the basic tasks of Linear Regression in (base) Racket. It supports univariate as well as multivariate covariates. The code can be found here.

1InstallationπŸ”— i

To install this library, use:

raco pkg install linear-regression

You can keep the package up to date by using

raco pkg update linear-regression

2Using the PackageπŸ”— i

The package gives public use to four functions:

  • csv-transform

  • coeffs

  • predict

  • r2_adj

2.1csv-transformπŸ”— i

This function takes a csv file as input. More specifically, it is structured by rows: The first row contains the observation data, and any subsequent row is a covariate.

It returns a list of two matrices: the first matrix is the observations, and the other matrix are your covariates (which may be multivariate).

2.2coeffsπŸ”— i

This function takes the result from csv-transform and calculates the regression coefficients, as a column matrix.

2.3predictπŸ”— i

This function takes a matrix of coefficients (the result of coeffs) and a vector of new data, of the correct dimension. It simply returns the predicted value given the coefficients.

2.4r2_adjπŸ”— i

This function takes coefficients (result of coeffs) and data set (result of csv-transform) and calculates the adjusted coefficient of correlation.

top
← prev up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /