Installation

This section covers how to install Macrodata Refinement (MDR) in different environments.

Prerequisites

MDR requires Python 3.10 or newer. It also depends on the following key packages:

  • numpy

  • pandas

  • matplotlib

  • scikit-learn (optional, for advanced features)

From Source

To install from source, first clone the repository:

git clone https://github.com/muditbhargava66/macrodata-refinement.git
cd macrodata-refinement
pip install -e .

This installs MDR in development mode, so changes to the source code will be reflected immediately.

Using Docker

MDR provides a Docker image for easy deployment, especially for the API:

docker-compose up mdr-api

This will start the MDR API server on the default port. You can configure the port and other settings in the docker-compose.yml file.

Verifying Installation

To verify that MDR is installed correctly, you can run:

import mdr
print(mdr.__version__)

Or run a simple example:

from mdr.core.refinement import RefinementConfig

# Create a configuration object
config = RefinementConfig(
    smoothing_factor=0.2,
    outlier_threshold=2.5,
    imputation_method="linear",
    normalization_type="minmax"
)

print("MDR installed successfully!")

Troubleshooting

Common installation issues and their solutions:

  1. Missing dependencies: If you encounter a ModuleNotFoundError, make sure all required packages are installed.

    pip install -r requirements.txt
    
  2. Version conflicts: If you have version conflicts with existing packages, consider using a virtual environment:

    python -m venv mdr-env
    source mdr-env/bin/activate  # On Windows: mdr-env\Scripts\activate
    pip install macrodata-refinement
    
  3. Docker issues: If you encounter issues with Docker, ensure Docker and Docker Compose are installed and that the required ports are available.