A flexible mixed integer toll for automatic test assembly (ATA) in Python.
Project description
FlexATA
FlexATA is a Python package designed for automated test assembly (ATA). It provides a flexible and efficient way to assemble test forms from an item pool while satisfying various constraints, such as content balancing, information targets, item usage, and more. The package leverages linear programming to solve the test assembly problem and supports multiple solvers, including CBC and CPLEX.
Features
- Content Constraints: Control the distribution of items based on attributes like domain, difficulty, etc.
- Information Constraints: Ensure forms meet specific information targets at given theta points.
- Enemy Constraints: Prevent specific pairs of items from appearing together in the same form.
- Set Constraints: Handle item sets and ensure a fixed number of items from each set are included.
- Form Pair Constraints: Control the overlap of items between forms.
- Item Usage Constraints: Limit the number of times an item can be used across forms.
Installation
To install the package, clone the repository and install the dependencies:
git clone https://github.com/frankyanfu/FlexATA.git
cd FlexATA
pip install -r requirements.txt
Getting Started
Example Usage Here is a basic example of how to use the FlexATA package:
import pandas as pd
from FlexATA.form_builder import FormBuilder
from FlexATA.utility import read_in_data
# Load the item pool
item_pool = read_in_data(data_name="pool")
# Initialize the FormBuilder
sp = FormBuilder()
sp.pool = item_pool
sp.number_of_forms = 3
sp.number_of_items_per_form = 10
sp.create_item_by_form_variables()
# Add content constraints
domain_constraints = {"Domain_A": [4, 4], "Domain_B": [6, 6]}
sp.add_content_constraints_by_column(column_name="Domain", values_range=domain_constraints)
# Add information constraints
sp.add_information_based_on_theta_points(
theta_points=[-0.6, -0.4, 0.2, 0.4],
info_targets=[2.7, 4, 4, 2.7]
)
# Solve the problem
sp.solve_problem(timeLimit=120, solver="CBC")
# Check the solution status
print("Solution Status:", sp.status)
Examples
The package includes several example scripts to demonstrate its functionality:
- example_form_pair.py: Demonstrates form pair constraints.
- example_information.py: Shows how to add information constraints.
- example_enemy.py: Illustrates enemy constraints.
- example_set.py: Handles set constraints.
- example_content.py: Demonstrates content balancing.
You can find these examples in the examples directory.
API Reference
Core Classes
FormBuilder
The main class for defining and solving the test assembly problem.
Attributes:
- number_of_forms: Number of forms to assemble.
- number_of_items_per_form: Number of items per form.
- pool: The item pool as a pandas DataFrame.
- item_id_column: Column name for item IDs.
- irt_a_column, irt_b_column, irt_c_column: Columns for IRT parameters.
Methods:
- create_item_by_form_variables(): Creates decision variables for item selection.
- add_content_constraints_by_column(column_name, values_range): Adds content constraints.
- add_information_based_on_theta_points(theta_points, info_targets): Adds information constraints.
- add_enemy_constraints(enemy_pairs, itemid_column, enemyid_column): Adds enemy constraints.
- solve_problem(timeLimit, solver): Solves the problem using the specified solver.
Data Requirements
Item Pool
The item pool should be a pandas DataFrame with the following columns:
- ItemID: Unique identifier for each item.
- Domain: Content domain of the item.
- IRT_a, IRT_b, IRT_c: IRT parameters for the item.
- SetID (optional): Identifier for item sets.
- Difficulty (optional): Difficulty level of the item.
Enemy Pairs
A pandas DataFrame with two columns:
- ItemID: The first item in the enemy pair.
- EnemyID: The second item in the enemy pair.
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a detailed description of your changes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flexata-0.0.8.tar.gz.
File metadata
- Download URL: flexata-0.0.8.tar.gz
- Upload date:
- Size: 298.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffcd9a784f6e9b23898c7285fbd02822a7bbf74d4db4a93a07adf2af637132e0
|
|
| MD5 |
0992b7c5eb9887a6dd8d7499b1d48c1a
|
|
| BLAKE2b-256 |
0b7974760f9752ac4f509960f3274bc2ee5c5ed7a7533d18a81c4a098d48cfbd
|
File details
Details for the file flexata-0.0.8-py3-none-any.whl.
File metadata
- Download URL: flexata-0.0.8-py3-none-any.whl
- Upload date:
- Size: 270.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f87ac42893fa78dd895fffdfe8431773bd43b04862e1506c47c6f73a83e5b456
|
|
| MD5 |
f96f8a5fde67b0f2a038788e4d74d7d1
|
|
| BLAKE2b-256 |
a7a21057c07798fff85af2e0115d687edd58045f6e6f8e3143319b620105a158
|