Skip to content

This project implements cubic regularization optimization algorithms and related methods for machine learning, with a focus on robust and efficient training. It includes modular Python code for data handling, experiment management, and various optimizers, along with scripts and visualizations for benchmarking on standard datasets.

Notifications You must be signed in to change notification settings

VictorChibueze-stud/cubic_regularization_optimization

Repository files navigation

Cubic Regularization: Modular Python Implementation

This project implements advanced optimization algorithms for regularized logistic regression, including Gradient Descent, Conjugate Gradient, BFGS, ARC, and Cubic Newton, in a modular, production-grade Python package.

Features

  • Modular, extensible codebase
  • Robust error handling and logging
  • Statistical analysis and plotting utilities
  • Ready for research and enterprise use

Project Structure

cubic_regularization/
│
├── src/
│   ├── cubic_regularization/
│   │   ├── __init__.py
│   │   ├── data.py
│   │   ├── optimizers/
│   │   │   ├── __init__.py
│   │   │   ├── base.py
│   │   │   ├── gradient_descent.py
│   │   │   ├── conjugate_gradient.py
│   │   │   ├── bfgs.py
│   │   │   ├── arc.py
│   │   │   └── cubic_newton.py
│   │   ├── experiment.py
│   │   ├── utils.py
│   │   └── logging_config.py
│   └── main.py
│
├── tests/
│   ├── __init__.py
│   ├── test_data.py
│   ├── test_optimizers.py
│   └── test_experiment.py
│
├── requirements.txt
├── .gitignore
├── README.md
└── setup.py

Setup

  1. Create and activate a virtual environment:
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  2. Install dependencies:
    pip install -r requirements.txt

Usage

  • Run experiments:
    python -m src.main
  • Add your data files (e.g., a9a, a9a.t) to the project root.

Testing

  • Run tests with pytest or unittest:
    pytest tests/

Running from the Project Root

If you want to run the experiment from the project root (not inside src/), set the PYTHONPATH so Python can find the package:

On Windows PowerShell:

$env:PYTHONPATH = ".\src"; python -m src.main

On Linux/macOS:

PYTHONPATH=./src python -m src.main

License

MIT

About

This project implements cubic regularization optimization algorithms and related methods for machine learning, with a focus on robust and efficient training. It includes modular Python code for data handling, experiment management, and various optimizers, along with scripts and visualizations for benchmarking on standard datasets.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages