Skip to main content

AIMLLab

All 33 AI and ML lab practicals, available as complete Python source—offline.

AIMLLab is a lightweight Python library and command-line code viewer. Look up a question number, an algorithm, or a topic to print the complete, copyable solution. The installed package contains the source; it does not contact a website, download snippets, or execute a lab program when imported.

Q1–Q8 contain the existing user-input versions. Q9–Q33 retain the existing solutions, including three separate Apriori implementations. All 35 bundled source resources covering 33 questions match their authoritative originals byte for byte. Existing source limitations are recorded in the source review.

Install AIMLLab from PyPI as aimllab33. The Python import and command remain aimllab. Licensing has not yet been selected.

Version 0.1.1 adds 25 separate, opt-in enhanced programs. All 35 originals and their normal lookups remain unchanged. Read the enhancement guide, 33-question assignment audit, and validation results.

Install

Requires Python 3.9 or newer on Windows, macOS, or Linux. The viewer has no third-party runtime dependencies.

In a terminal:

python -m pip install --upgrade aimllab33

In a Jupyter notebook:

%pip install --upgrade aimllab33
import aimllab
aimllab.show(9)

To install from a local wheel without a package index:

python -m pip install --no-index --no-deps ./dist/aimllab33-0.1.1-py3-none-any.whl

Alternatively, install directly from the source folder:

python -m pip install .

To share a ready-to-install file, send the wheel and the short installation instructions. Building or installing from source can require build tools or network access; an installed viewer works offline.

Quick start

import aimllab

aimllab.show(9)          # Question number, actual title, and complete source
aimllab.show("q9")       # Also accepts "Q09" and "9"
aimllab.show("knn")      # Complete Q18, Q19, Q20, and Q32 solutions
aimllab.show("pca")      # Complete Q9 and Q13 solutions
aimllab.show("kmeans")   # Complete Q25–Q28 solutions
aimllab.show("pipeline") # Complete Q33 solution
aimllab.show("compare") # All designated comparison practicals

show() prints full source, with a separate heading for each matching question. It never runs the displayed program. Topic lookups show every matching question, rather than selecting just one.

For source without any printed headings:

code = aimllab.get(18)
print(code)

matches = aimllab.get_many("knn")  # Structured results for a group

get() retrieves a single question as a raw string. Use get_many() for a topic or group. Invalid lookups print helpful guidance; an invalid get() returns an empty string, and an invalid show() returns an empty list.

Apriori: three complete versions

The Groceries CSV implementation is primary. Both show(29) and show("apriori") print all available variants, in this order:

Variant Source
groceries Existing CSV-based implementation: groups grocery purchases into transactions, encodes the basket, and prints itemsets and rules
basic Existing basic/PDF implementation with predefined transactions
basic2 Second existing basic implementation with ten predefined transactions
aimllab.show("apriori")
aimllab.show(29, variant="groceries")
aimllab.show(29, variant="basic")
aimllab.show(29, variant="basic2")

code = aimllab.get(29)                    # Primary Groceries CSV source
other_code = aimllab.get(29, variant="basic2")

The variants remain separate programs; the viewer does not combine their datasets or run them.

Topic lookups

Lookups are case-insensitive and tolerate spaces, hyphens, and underscores. A question can appear in several groups.

Topic Questions
astar 1, 3, 8
search 1, 2, 3, 8
greedy 2
csp 4, 5, 6
minimax 7
puzzle 5, 8
regression 9, 10, 11, 12, 13
pca 9, 13
decisiontree 14, 15, 16, 17, 22, 23, 32
knn 18, 19, 20, 32
naivebayes 21, 22, 32
randomforest 23, 24
kmeans 25, 26, 27, 28
apriori 29
ann 30, 31
pipeline 33
compare 9, 13, 17, 18, 19, 20, 22, 23, 28, 32

Additional groups include classification, clustering, neuralnetwork, optimization, and eda. See the complete topic reference, or run aimllab.list_topics() to inspect the installed registry.

Also accepted Canonical topic
dt, decision tree, decision_tree decisiontree
rf, random forest, random_forest randomforest
nb, naive bayes, naïve bayes naivebayes
k-means, k_means kmeans
linear regression, lr regression
neural network, tensorflow ann
aimllab.list_questions()          # All question numbers and titles
aimllab.list_topics()             # Available topic groups
aimllab.search("classification") # Search titles, topics, and keywords
aimllab.info(9)                   # Title, algorithm, dataset, and topics
aimllab.help()                    # Usage examples

These helpers print readable output; the listing, search, and information helpers also return structured data. All metadata lives in a central registry; the source is stored separately as package data.

Command-line use

aimllab show 9
aimllab show knn
aimllab show pca
aimllab show compare
aimllab show apriori
aimllab show 29 --variant groceries
aimllab show 29 --variant basic
aimllab show 29 --variant basic2
aimllab list
aimllab topics
aimllab search regression
aimllab info 29
aimllab --help

If your shell cannot find the aimllab command, use the same interpreter that installed the wheel:

python -m aimllab show knn
python -m aimllab --help

Viewing code and running code

Viewing: Python's standard library is sufficient. Code is loaded from resources inside the installed package. No dataset, ML framework, account, website, or internet connection is required.

Running: Copy the requested program into a Python file or notebook, then install the libraries it imports and supply the dataset it expects. Depending on the practical, these can include pandas, NumPy, scikit-learn, Matplotlib, mlxtend, or TensorFlow. Relative CSV filenames are resolved from the working directory of the program you run. Dataset files are not supplied by the viewer.

Q1–Q8 ask for input when the copied programs are executed. The viewer itself does not prompt for city graphs, grids, boards, or other lab inputs.

Source preservation is documented in the question inventory. Read the source and requirements review for limitations or differences from the assignment; bundling a solution does not claim that every external dataset or dependency has been runtime-validated.

Build and test

From the project folder:

python -m pip install --upgrade build
python -m build
python -m pip install --force-reinstall --no-deps ./dist/aimllab33-0.1.1-py3-none-any.whl
python -m unittest discover -s tests -v
python tools/check_distribution.py dist/aimllab33-0.1.1-py3-none-any.whl dist/aimllab33-0.1.1.tar.gz --smoke

The build creates a wheel and source distribution in dist/. The distribution checker inspects both archives; --smoke also installs the local wheel without an index into a fresh temporary environment outside the repository and runs the tests there. The validation report records completed checks. The publishing guide explains Trusted Publishing and public-install verification.

Optional, separate from the dependency-free viewer tests: with NumPy, pandas, scikit-learn, Matplotlib, and mlxtend installed, run python tools/check_ml_examples.py. This executes Q16, Q17, Q18, Q22, Q23, and Q32 using built-in datasets, plus all three Q29 variants; the Groceries CSV check uses a clearly synthetic ten-transaction fixture. It covers nine source programs, rather than all 33 practicals or every external dataset.

The source tree describes the package layout. The package is a separate project from the website. Installing or importing it does not modify the website or require its deployment.

Metadata

Release files for aimllab33 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aimllab33 0.1.1
File Size Uploaded Provenance
aimllab33-0.1.1.tar.gz 123.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aimllab33 0.1.1
File Interpreter ABI Platform
aimllab33-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 216.8 kB

Release files / aimllab33-0.1.1.tar.gz

Download URL aimllab33-0.1.1.tar.gz
Size 123.4 kB
Tags Source
SHA-256 checksum
How to use checksums
008b6ed1a6e96d32cfe92e745869dc1467e2037fe6ffc6e2ca6cce30ca1f6860
BLAKE2b-256 checksum
How to use checksums
c44b4a5b19b90a1e67caed21796f68bda6bc6edc84bd57852d1ea5d743944752
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / aimllab33-0.1.1-py3-none-any.whl

Download URL aimllab33-0.1.1-py3-none-any.whl
Size 93.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b712d3834716b685a5a253571629ad236c8605db10cf1137a7aae0b35db58b7f
BLAKE2b-256 checksum
How to use checksums
9885f16e498cf4f089c74036bce2bd44598db7cc06d106d6cc7f87fa5d151c43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for aimllab33 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aimllab33-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page