Skip to main content

Kiku

cavemanstatistics 1.0

This package contains unnecessarily slow, brute-force search methods for finding highest R^2 (of linear regression models with specified or unspecified dependant variable) in a dataset. This project is mainly intended to get to know packaging with pypi.org and to develope my workflow. In the future I'd like to vectorize the loops and maybe add more search options and better search methods. Be careful about combinatorial explosion and set the bounds appropriately.

Dependancies

  • NumPy
  • Pandas
  • SciPy
  • scikit-learn
  • Tabulate

Installing

Install with:

pip install cavemanstatistics

Quick documentation

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

After installation, import:

from cavemanstatistics import ExhaustiveSearch, BruteForce

Search for highest R^2 (unspecified dependant variable):

model, results = ExhaustiveSearch(data = pd.dataframe, remove = list, lowerbound = int, upperbound = int, adjusted_R2 = bool).solve()
y, x = model
print(model)

('depedant variable', [list of explanatory variables])

ExhaustiveSearch().solve() returns a touple containing a string (dependant variable) and a list (explanatory variables) and a sorted dictionary with all results.

Parameters:

  • data: has to be a pandas dataframe
  • remove: place list of variable names that you would like to exclude as depedant variables (or place an empty list)
  • lowerbound: smallest integer number of explanatory variables in solution set
  • upperbound: largest integer number of exoplanatory variables in solution set
  • adjusted_R2: True for adjusted R^2, false for R^2

Search for highest R^2 (specified dependant variable):

model, results = BruteForce(data = pd.dataframe, Y = str, lowerbound = int, upperbound = int, adjusted_R2 = bool).solve()
y, x = model
print(model)

('depedant variable', [list of explanatory variables])

BruteForce().solve() returns a touple containing a string (dependant) and a list (explanatory variables) and a sorted dictionary with all results.

Parameters:

  • data: has to be a pandas dataframe
  • Y: the name of the variable that you would like to specify as dependant variable
  • lowerbound: smallest integer number of explanatory variables in solution set
  • upperbound: largest integer number of exoplanatory variables in solution set
  • adjusted_R2: True for adjusted R^2, false for R^2

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • This is a spawn of the frustration caused by the R-Package 'leaps'
  • Tip fedora to the ascii art creators

Release files for cavemanstatistics 0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cavemanstatistics 0.5
File Size Uploaded
cavemanstatistics-0.5.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cavemanstatistics 0.5
File Interpreter ABI Platform
cavemanstatistics-0.5-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / cavemanstatistics-0.5.tar.gz

Download URL cavemanstatistics-0.5.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3e6960649005491c951b6f89edb3a3f8fd674adcdabd16b162aef0b450d77b58
BLAKE2b-256 checksum
How to use checksums
fbe1a15aaddf59c683ad6c192fd278384448a459cd88a5b06fdae1a284a7659e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

Release files / cavemanstatistics-0.5-py3-none-any.whl

Download URL cavemanstatistics-0.5-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63bf3fc87814b36b81eb85134b8444987cfdf32404b6535b2b383172e50d0417
BLAKE2b-256 checksum
How to use checksums
6a1c07e355a3abc6d016ad42eb1f457f2f86dfb72c412ad7e8e6880ee26bcc7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

Release history Release notifications | RSS feed

This release

0.5 This release

2 release files

0.4

2 release files

0.3

2 release files

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page