Skip to main content

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.

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 pandas and statsmodels

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 can be found using the following:

import ravix
ravix.get_data()

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
model.summary()

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.hist(df)

# Scatter plot
ravix.plot("MSFT ~ SPY", data = df)

# Multiple Scatter plots
ravix.plot(df)

# Correlation Plot
ravix.plot_cor(df)

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:

  1. Forking the repository
  2. Creating a new branch (git checkout -b feature-branch)
  3. Committing your changes (git commit -am 'Add some feature')
  4. Pushing to the branch (git push origin feature-branch)
  5. 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ravix-1.0.1.tar.gz (336.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ravix-1.0.1-py3-none-any.whl (353.9 kB view details)

Uploaded Python 3

File details

Details for the file ravix-1.0.1.tar.gz.

File metadata

  • Download URL: ravix-1.0.1.tar.gz
  • Upload date:
  • Size: 336.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for ravix-1.0.1.tar.gz
Algorithm Hash digest
SHA256 bab101b8ff2d854fc2feb9d3795441191de6a22a31ca126ab5300db3eff566e1
MD5 f85deb983a61751a714f5e560193cdff
BLAKE2b-256 12e6388bf8343586bb82180d2f6c074d24cbb38252ca7a232e9b26ddcaee937c

See more details on using hashes here.

File details

Details for the file ravix-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: ravix-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 353.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for ravix-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff41a139089363457f8a5f421054083e119cdbf4a08daa77565b68866c0370d1
MD5 302925d39aa5c472ae17f0c8722cd1bb
BLAKE2b-256 6e55951fef98d45dd5b955e3db0e89987562ba8f4bca85dda13914d17283e680

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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