The olr function systematically evaluates multiple linear regression models by exhaustively considering all possible combinations of independent variables against the dependent variable. It then provides a statistical summary based on either the highest adjusted R-squared or R-squared value obtained from these models.
In the realm of model evaluation, both R-squared and adjusted R-squared serve as prominent metrics, each offering unique insights into the quality of the model fit. R-squared, while widely used, has a tendency to increase with the inclusion of any explanatory variable, regardless of its significance. This characteristic can potentially lead to the incorporation of unnecessary variables, contributing to overfitting issues.
To address this concern, adjusted R-squared penalizes the addition of superfluous variables, offering a more refined assessment of model fit. Within the olr function framework, the primary objective is to identify the model that best aligns with the underlying data, maximizing predictive accuracy without sacrificing model complexity. Thus, while adjusted R-squared provides valuable insights into model parsimony, the inclusion of R-squared alongside it ensures a comprehensive evaluation of model performance.
By considering both metrics, the olr function facilitates the identification of the most suitable model, striking a balance between explanatory power and complexity. This approach ensures that the selected model effectively captures the inherent relationships within the data while mitigating the risk of overfitting.
dataset = pd.read_csv('C:\Users\wfky1\OneDrive\Documents\PythonFolder\PythonOlr\olr_python_package\data\crudeoildata.csv')
responseName = dataset[['OilPrices']]
predictorNames = dataset[['SPX', 'RigCount', 'API', 'FieldProduction', 'RefinerNetInput', 'OperableCapacity', 'Imports', 'StocksExcludingSPR', 'NonCommercialLong', 'NonCommercialShort', 'CommercialLong', 'CommercialShort', 'TotalLong', 'TotalShort', 'NonReportablePositionsLong', 'NonReportablePositionsShort', 'OpenInterest']]
The TRUE or FALSE in the olr function, specifies either the adjusted R-squared or the R-squared regression summary, respectfully.
When responseName and predictorNames are None (NULL), then the first column in the dataset is set as the responseName and the remaining columns are the predictorNames.
Adjusted R-squared
olr(datasetname, resvarname = None, expvarnames = None, adjr2 = "True")
R-squared
olr(datasetname, resvarname = None, expvarnames = None, adjr2 = "False")
list of summaries
olrmodels(datasetname, resvarname = None, expvarnames = None)
list of formulas
olrformulas(datasetname, resvarname = None, expvarnames = None)
list of forumlas with the dependant variables in ascending order
olrformulasorder(datasetname, resvarname = None, expvarnames = None)
the list of adjusted R-squared terms
adjr2list(datasetname, resvarname = None, expvarnames = None)
the list of R-squared terms
r2list(datasetname, resvarname = None, expvarnames = None)
An R version of this package olr is available on CRAN.
Metadata
Release files for olr 1.3.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| olr-1.3.6.tar.gz | 21.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| olr-1.3.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.2 kB
Release files / olr-1.3.6.tar.gz
| Download URL | olr-1.3.6.tar.gz |
|---|---|
| Size | 21.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
06ab3b2eb8c7199943f9be48be960ac7e3d12970a5a0ce63776b76185a309bed
|
|
BLAKE2b-256 checksum How to use checksums |
c62bc11e765e83fe07687bd55d30cd2b155a882625ead61ea1bf2b13896852d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.4
|
Release files / olr-1.3.6-py3-none-any.whl
| Download URL | olr-1.3.6-py3-none-any.whl |
|---|---|
| Size | 20.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe54e195f6694325aea1595ed29f50e9aa65060263aa378617de39c846514493
|
|
BLAKE2b-256 checksum How to use checksums |
c4115c02819543525b115b301bede80d42d7c8eb0a6c5cd78da403b2d46c1756
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.4
|
Security for olr 1.3.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.