Applied regression modeling and visualization for business analytics
Project description
Ravix
Ravix is a Python package for regression analysis and data visualization. It provides tools for model fitting, prediction, and various types of plots to help visualize your data particularly for regression analysis.
Features
- Model fitting and prediction with convenient formula notation
- Streamlined code for plotting (boxplot, histogram, scatter plot, etc.)
- Regression analysis diagnostic tools
- Integration with popular libraries like
pandasandstatsmodels
Installation
You can install the package using pip:
pip install ravix
Usage
Here are some examples of how to use the key functions in the package.
Importing the Package
To use the functions provided by the package, import it as follows:
import ravix
Getting Data
There are multiple datasets available from Ravix and are easily attained using the get_data function. The datasets currently available are:
- AirBnb.csv
- Betas.csv
- Charges.csv
- Employment.csv
- HousePrices.csv
- HR_retention.csv
- MarketingToys.csv
- Sales.csv
- Top200.csv
- Twitter.csv
- Youtube.csv
See Applied Linear Regression for Business Analytics with Python for details regarding these datasets. Sample import example:
import ravix
# Load data from ravix
df = ravix.get_data("Betas.csv")
# Format the data (for later)
df.drop(columns = df.columns[0], inplace=True)
Model Fitting and Prediction
Ravix formula supports formula functionality similar to R. Fit a model with a formula:
# Fit model with formula
model = ravix.ols("SPY ~ .", df)
Summary types are specified using the out argument. Different summaries are available including:
- simple (default)
- statsmodels
- R
- ANOVA
- coefficients (coef)
# Generate a model summary
ravix.summary(model)
Making Predictions
A Statsmodels object is created by default. From this object, the predict function can be used. Since df is the dataframe used to fit the model, the following lines produce the same result.
# Make predictions
ravix.predict(model, df)
# Produce fitted values
ravix.predict(model)
General Plotting
Plotting code is streamlined and built on top of Seaborn and MatPlotLib. Samples provided below.
# Generate a boxplot
ravix.boxplot("SPY ~ .", df)
# Generate a histogram
ravix.hist(df.SPY)
# Multiple histograms
ravix.hists("SPY ~ .",data = df)
# Scatter plot
ravix.plot("MSFT ~ SPY", data = df)
# Multiple Scatter plots
ravix.plot("SPY ~ .", data = df)
# Correlation Plot
ravix.plot_cor(df)
Required Fixes
Based on current testing, the following fixes are required:
- Ensure global scope accessibility for variables.
- Adjust summary spacing.
- Provide compatibility with
scikit-learn. - Implement AI-generated summaries.
- Allow for additional plotting customization (using kwargs).
- Review and improve diagnostic plots.
- Provide support for logistic regression and other GLMs.
- Provide support for automatic dummy variable retrieval.
- Plots should work without formulas.
Contributing
We welcome contributions to Ravix! If you find a bug or have a feature request, please open an issue on GitHub. You can also contribute by:
- Forking the repository
- Creating a new branch (
git checkout -b feature-branch) - Committing your changes (
git commit -am 'Add some feature') - Pushing to the branch (
git push origin feature-branch) - Creating a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
We would like to thank all contributors and users of Ravix for their support and feedback.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ravix-0.1.1.tar.gz.
File metadata
- Download URL: ravix-0.1.1.tar.gz
- Upload date:
- Size: 310.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c3431749ea1b75952751fdab91dd03c655f5224e25d226950870806c10bd953
|
|
| MD5 |
3cb12290137161481d58f929a34074f2
|
|
| BLAKE2b-256 |
ed2ae49476017232e82ae84af83eb60107db0149c00e04fb73ac3f0499f09b16
|
File details
Details for the file ravix-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ravix-0.1.1-py3-none-any.whl
- Upload date:
- Size: 330.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cca97abd4808401e7af2329b16a8a0bc56f5265bcded68f2184a8ae6597872e2
|
|
| MD5 |
9d718e4b7f2ee0895da88b8c452e3652
|
|
| BLAKE2b-256 |
45fc15bd01a077c3ed29c98ef75440122d115f7e5d72cce61ee321d738bd706b
|