Skip to content

aneeb02/python-ai-ml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python for AI/ML

A structured, hands-on reference repository covering core Python concepts and foundational AI/ML topics. This repository is intended to serve as a learning resource for developers who want to strengthen their Python fundamentals with clear, well-commented examples in both interactive notebooks and standalone scripts.


Table of Contents


Overview

This repository is organized into two primary components:

  • notebooks/ — Interactive Jupyter notebooks grouped by topic, ideal for step-by-step exploration.
  • src/ — Standalone Python scripts demonstrating concepts in a production-style format.

Each topic is self-contained and can be studied independently.


Prerequisites

  • Python 3.10 or higher
  • pip (Python package manager)
  • JupyterLab (installed via requirements.txt)

Getting Started

1. Clone the Repository

git clone https://github.com/aneeb02/python-ai-ml.git
cd python-ai-ml

2. Create and Activate a Virtual Environment

Linux / macOS:

python3 -m venv venv
source venv/bin/activate

Windows:

python -m venv venv
venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

Repository Structure

python-ai-ml/
│
├── notebooks/                  # Interactive Jupyter notebooks
│   ├── 01_python_basics/       # Core syntax, functions, scope, operators
│   ├── 02_data_structures/     # Lists, comprehensions, built-in structures
│   ├── 03_advanced_python/     # OOP, decorators, generators, memory management
│   ├── 04_concurrency/         # Async, multithreading, multiprocessing
│   ├── 05_design_patterns/     # Dependency injection, generator pipelines
│   └── 06_ai-ml-intro/         # NumPy, introductory ML concepts
│
├── src/                        # Standalone Python scripts
│   ├── advanced_python/        # Context managers, descriptors, monkey patching
│   ├── design_patterns/        # Factory pattern, dependency injection
│   ├── ipc/                    # Inter-process communication (pipes, queues, shared memory)
│   └── mini_projects/          # Small self-contained programs (Mastermind, Password Generator)
│
├── data/                       # Sample datasets and input files
├── docs/                       # Reference documents and supplementary reading
├── logs/                       # Runtime log output (not tracked by git)
│
├── requirements.txt            # Python dependencies
├── .gitignore                  # Git ignore rules
└── README.md                   # Project documentation

Topics Covered

Python Basics

  • Variables, operators, and control flow
  • Functions, scope, and closures
  • Exception handling and file I/O

Data Structures

  • Lists, tuples, sets, and dictionaries
  • List and dictionary comprehensions
  • Stacks, queues, and linked list implementations

Advanced Python

  • Object-Oriented Programming: inheritance, dunder methods, descriptors
  • Decorators (function and class-based)
  • Generators and iterators
  • Memory management and garbage collection
  • Copy mechanisms: assignment, shallow, and deep copy
  • Regular expressions

Concurrency

  • asyncio and asynchronous programming
  • Multithreading with the threading module
  • Multiprocessing with the multiprocessing module
  • Inter-Process Communication (IPC): pipes, queues, shared memory

Design Patterns

  • Factory Pattern
  • Dependency Injection
  • Generator Pipelines

AI/ML Introduction

  • NumPy arrays and operations
  • Introductory machine learning concepts with scikit-learn

Running the Notebooks

Start JupyterLab from the project root:

jupyter lab

Navigate to the notebooks/ directory in the JupyterLab file browser and open any .ipynb file.

Note: Notebooks that read from files (e.g., file_handling.ipynb, generator_pipeline.ipynb) use relative paths that assume JupyterLab is launched from the project root directory.


Running the Scripts

Scripts are standalone and can be run directly from the project root:

python3 src/mini_projects/password_gen.py
python3 src/mini_projects/mastermind.py
python3 src/ipc/ipc_shared_memory.py

Contribute

If you feel anything is missing or some concept can be added or further explained, feel free to contribute!


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages