NLSQ API Reference

Complete API reference for all NLSQ modules. For most use cases, start with:

Core API

Main interface for curve fitting:

Pre-Built Functions

Library of common fit functions with automatic parameter estimation:

Large Dataset Support

Tools for fitting very large datasets (10M+ points):

Adaptive Hybrid Streaming (v0.3.0+)

Four-phase hybrid optimizer with parameter normalization, L-BFGS warmup, streaming Gauss-Newton, and exact covariance computation:

Global Optimization (v0.3.3+)

Multi-start optimization with Latin Hypercube Sampling (LHS) for finding global optima in problems with multiple local minima:

Core Factories (v0.4.3+)

Factory functions for creating optimizers and configurations:

Orchestration Components (v0.6.4+)

Decomposed curve fitting components for modular testing and customization:

Facades (v0.6.4+)

Lazy-loading facades for breaking circular dependencies:

Workflow System (v0.5.5+)

Memory-based workflow system with automatic strategy selection based on available memory and dataset characteristics:

Command-Line Interface (v0.4.1+)

YAML-based workflow execution from the command line:

Qt Desktop GUI (v0.5.0+)

Native desktop application with PySide6 and pyqtgraph:

Enhanced Features (v0.1.1)

New features added in version 0.1.1:

Interfaces & Protocols (v0.4.2+)

Protocol definitions for dependency injection:

Algorithms & Optimization

Low-level optimization algorithms:

Utilities & Infrastructure

Support modules for configuration, caching, and diagnostics:

Performance & Profiling

Performance analysis, profiling, and benchmarking tools (NEW in v0.3.0-beta.2+):

Module Index

Complete Module Listing

Core Modules: - nlsq.minpack module - Main curve_fit() API - nlsq.least_squares module - least_squares() solver - nlsq.trf module - Trust Region Reflective algorithm - nlsq.core.trf_jit - JIT-compiled TRF functions (NEW in v0.4.2) - nlsq.core.profiler - TRF performance profiling (NEW in v0.4.2)

Feature Modules: - nlsq.functions module - Pre-built fit functions (NEW in v0.1.1) - nlsq.callbacks module - Progress monitoring & early stopping (NEW in v0.1.1) - nlsq.stability module - Numerical stability analysis (NEW in v0.1.1) - nlsq.stability.guard module - Stability guard, condition estimation, collinearity detection - nlsq.fallback module - Automatic retry strategies (NEW in v0.1.1) - nlsq.recovery module - Optimization failure recovery (NEW in v0.1.1) - nlsq.bound_inference module - Smart parameter bounds (NEW in v0.1.1) - nlsq.parameter_estimation module - Initial parameter estimation (NEW in v0.3.0-beta.2) - nlsq.algorithm_selector module - Automatic algorithm selection (NEW in v0.3.0-beta.2)

Large Dataset Modules: - nlsq.large_dataset module - Chunked fitting for large data - nlsq.memory_manager module - Intelligent memory management (NEW in v0.1.1) - nlsq.memory_pool module - Memory pool allocation (NEW in v0.3.0-beta.2) - Large Dataset API Reference - Comprehensive large dataset guide

Adaptive Hybrid Streaming Modules (NEW in v0.3.0+): - nlsq.adaptive_hybrid_streaming module - Four-phase hybrid optimizer - nlsq.hybrid_streaming_config module - Configuration with presets - nlsq.parameter_normalizer module - Parameter normalization for gradient balance - nlsq.streaming.telemetry - Defense layer telemetry (NEW in v0.4.2) - nlsq.streaming.validators - Configuration validators (NEW in v0.4.2) - nlsq.streaming.phases - Phase classes (WarmupPhase, GaussNewtonPhase, etc.) (NEW in v0.4.3)

Interfaces & Protocols (NEW in v0.4.2): - nlsq.interfaces - Protocol definitions for dependency injection - nlsq.core.adapters - Protocol adapters (CurveFitAdapter) (NEW in v0.4.3)

Orchestration Components (NEW in v0.6.4): - nlsq.core.orchestration - DataPreprocessor, OptimizationSelector, CovarianceComputer, StreamingCoordinator

Facades (NEW in v0.6.4): - nlsq.facades - OptimizationFacade, StabilityFacade, DiagnosticsFacade

Global Optimization Modules (NEW in v0.3.3+): - nlsq.global_optimization - Multi-start with LHS, Sobol, Halton samplers

Workflow System Modules (NEW in v0.3.4+): - nlsq.workflow - Unified fit() with auto-selection, presets, YAML config

Command-Line Interface Modules (NEW in v0.4.1+): - nlsq.cli - CLI commands: nlsq fit, nlsq batch, nlsq info, nlsq gui

Qt Desktop GUI (NEW in v0.5.0+): - Qt Desktop GUI (nlsq.gui_qt) - Native desktop application with PySide6 and pyqtgraph

Utility Modules: - nlsq.config module - Configuration management - nlsq.device module - GPU detection and warnings (NEW in v0.1.6) - nlsq.validators module - Input validation (NEW in v0.1.1) - nlsq.diagnostics package - Model Health Diagnostics System (identifiability, gradient health, parameter sensitivity) - nlsq.utils.diagnostics module - Convergence monitoring (ConvergenceMonitor, OptimizationDiagnostics) - nlsq.caching module - JIT and result caching - nlsq.unified_cache module - Unified compilation cache (NEW in v0.3.0-beta.2) - nlsq.compilation_cache module - Legacy compilation cache - nlsq.smart_cache module - Smart adaptive caching - nlsq.logging module - Logging and debugging - nlsq.error_messages module - Standardized error messages (NEW in v0.3.0-beta.2) - nlsq.constants module - Numerical constants (NEW in v0.3.0-beta.2) - nlsq.types module - Type definitions (NEW in v0.3.0-beta.2) - nlsq.result module - Result containers (NEW in v0.3.0-beta.2) - nlsq.loss_functions module - Robust loss functions - nlsq.optimizer_base module - Base optimizer classes - nlsq.robust_decomposition module - Robust matrix decomposition (NEW in v0.3.0-beta.2) - nlsq.svd_fallback module - SVD fallback strategies (NEW in v0.3.0-beta.2) - nlsq.sparse_jacobian module - Sparse Jacobian support (NEW in v0.3.0-beta.2) - nlsq.common_jax module - JAX utilities - nlsq.common_scipy module - SciPy compatibility layer

Performance & Profiling: - nlsq.async_logger module - Async logging infrastructure (NEW in v0.3.0-beta.3) - nlsq.profiling module - JAX profiler integration and static analysis (v0.3.0-beta.2+) - nlsq.profiler module - Performance profiler (NEW in v0.3.0-beta.2) - nlsq.profiler_visualization module - Profiling visualization (NEW in v0.3.0-beta.2) - Performance Benchmarks - Performance analysis tools