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.
Version 0.1.0 is prepared for publication as the
aimllab33distribution. Until the public release is verified, install the local wheel below. The Python import and command remainaimllab. Licensing has not yet been selected.
Install locally
Requires Python 3.9 or newer on Windows, macOS, or Linux. The viewer has no third-party runtime dependencies.
From the project folder, install the built wheel:
python -m pip install --no-index --no-deps ./dist/aimllab33-0.1.0-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 |
Browse and search
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.0-py3-none-any.whl
python -m unittest discover -s tests -v
python tools/check_distribution.py dist/aimllab33-0.1.0-py3-none-any.whl dist/aimllab33-0.1.0.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 clean-environment checks, metadata validation, and the separate approval needed before publication.
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aimllab33-0.1.0.tar.gz | 77.7 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aimllab33-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 135.3 kB
Release files / aimllab33-0.1.0.tar.gz
| Download URL | aimllab33-0.1.0.tar.gz |
|---|---|
| Size | 77.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf49cfd1a3cd7b936a30b427cd19fb41344de3ed322725464b3c28184f1109ad
|
|
BLAKE2b-256 checksum How to use checksums |
103275668c8149316365c9f1d84b0e4355ab7a1532c5ca466858ad7853b636f2
|
| 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 logRelease files / aimllab33-0.1.0-py3-none-any.whl
| Download URL | aimllab33-0.1.0-py3-none-any.whl |
|---|---|
| Size | 57.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bcc146c31c1ac0f3c9da756ebd38125f6694be675e4f2b1e73412a1c4e72f803
|
|
BLAKE2b-256 checksum How to use checksums |
cee475238c179ca862409c1693be728ed0f8eef49ea33d7c9f9687851529969e
|
| 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 logSecurity for aimllab33 0.1.0
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.
Attestation for aimllab33-0.1.0.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 logA 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.