Rolling your own estimator, scikit-learn developers, 2024 - Official guide on how to implement custom estimators and transformers conforming to the scikit-learn API, covering required base classes and method signatures.
Pipelines and composite estimators, scikit-learn developers, 2023 - Explains how scikit-learn uses composition through Pipelines and FeatureUnions, providing concrete examples of building complex ML workflows from simpler components.
Design Patterns: Elements of Reusable Object-Oriented Software, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides, 1994 (Addison-Wesley) - A seminal work introducing fundamental object-oriented design patterns, including the principles of inheritance and composition and the recommendation to favor composition.
Fluent Python: Clear, Concise, and Effective Programming, 2nd Edition, Luciano Ramalho, 2022 (O'Reilly Media) - Offers a comprehensive look at Python's data model and object-oriented features, providing practical guidance on structuring Python code effectively, which implicitly supports principles of inheritance and composition.