Tools for online behavioral modeling
Project description
This project is licensed under the Apache License 2.0.
See LICENSE and NOTICE for details. © 2025 Noor Jamaludeen
Online-Behavioral-Modeling
This Python package enables the online discovery of behavioral patterns in trial-by-trial experiments. In trial-by-trial experiments, a participant (human/animal) is exposed to a series of stimuli and is expected to respond. The behavioral pattern is defined as the quantification of the contributions of stimulus features to the prediction of the response, taking into account the effects from prior trials.
Format of input data
The behavioral data should be formatted as a pandas dataframe where the trials are chronologically ordered. Each trial/row consists of a stimulus described by a set of features and a corresponding response.
An Example of usage:
Input arguments: par: Name/ID of participant, effect_var: response parent_cause_vars: stimulus features lags: list of numbers of prior trials simulator_types: list of simulator types to be employed [0='NP',1='OP',2='UP'] output_file: path of file to output the results of hyperparameter tuning default_missing_value: value to be used to refer to missing <stimulus feature value, response value> pairs. dt_runs: number of runs for the decision tree model to account for non-determinism, eval_method: evaluation method used to evaluate the performance of the simulator [Leave_one_out,KFold,StratifiedKFold,RepeatedStratifiedKFold], eval_method_model_selection: evaluation method used to select the best machine learning algorithm [Leave_one_out,KFold,StratifiedKFold,RepeatedStratifiedKFold], svm_model: Support vector machine classifier for categorical response and Support Vector machine Regressor for numeric response, dt_model: Decision Tree classifier for categorical response and Decision Tree Regressor for numeric response num_processes: Number of processes k: number of folds for evaluation r: number of repetitions for evaluation
behavioral_pattern_object = behaviour_constructor.behaviourConstructor(par, effect_var, parent_cause_vars, [lag], simulator_types=[simulator], output_file=directory, default_missing_value=0, dt_runs=runs, eval_method=LeaveOneOut(), category=None, eval_method_model_selection=RepeatedStratifiedKFold( n_splits=k, n_repeats=r), svm_model=svm.SVC, dt_model=tree.DecisionTreeClassifier , num_processes=processors, k=k, r=r,max_lag_var=max_lag)
behavioral_pattern,,,_=behavioral_pattern_object.generate_behavioural_pattern(data_window[parent_cause_vars+[effect_var]]) The object behavioral_pattern contains the quantification of the stimulus features to the response. Each value ranges from 0 to 1 with higher values indicating stronger contributions.
Project details
Release history Release notifications | RSS feed
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 online_behavioral_modeling-0.1.2.tar.gz.
File metadata
- Download URL: online_behavioral_modeling-0.1.2.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b818a19bb45f14cd3fc58716a9a89203ccdc8f0a702c4af9f4f316c9b75c1585
|
|
| MD5 |
23ed9da2584d8a36177dff3f3aceb012
|
|
| BLAKE2b-256 |
138b1b60795009f7390543e92c94e4a9297066a9fb4ba97b8b7524bebc561699
|
File details
Details for the file online_behavioral_modeling-0.1.2-py3-none-any.whl.
File metadata
- Download URL: online_behavioral_modeling-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
830a8aee1a12678cb4e28f9d76697075c9c0cdf9634fb8b3f1b595255447b2dc
|
|
| MD5 |
8038bfe78029afa75520e64f363c15ef
|
|
| BLAKE2b-256 |
8d62eb0a1081eb2724dc735aecaa1d02b4b8f1baf782bd22ba019cd1b4b4bfae
|