Skip to main content

Implementation of inverted encoding model as described in Scotti, Chen, & Golomb

Project description

Inverted Encoding

Python package for easy implementation of inverted encoding modeling as described in Scotti, Chen, & Golomb (in-prep).

Contact: scottibrain@gmail.com (Paul Scotti)


Installation

Run the following to install:

pip install inverted-encoding

Usage

from inverted_encoding import IEM, permutation, circ_diff
import numpy as np

predictions, confidences, recons = IEM(trialbyvoxel,features,stim_max=180,is_circular=True)
# trialbyvoxel: your matrix of brain activations, does not necessarily have to be voxels
# features: array of your stimulus features (must be integers within range defined by stim_max)
# use "help(IEM)" for more information on required inputs

## Compute mean absolute error (MAE) by doing the following, then compare to null distribution:
if is_circular: # if your stimulus space is circular, need to compute circular differences
    mae = np.mean(np.abs(circ_diff(predictions,features,stim_max))) 
else:
    mae = np.mean(np.abs(predictions-features)) 
null_mae_distribution = permutation(features,stim_max=180,num_perm=1000,is_circular=True)

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

inverted_encoding-0.0.19.tar.gz (66.3 kB view details)

Uploaded Source

Built Distribution

inverted_encoding-0.0.19-py2-none-any.whl (26.5 kB view details)

Uploaded Python 2

File details

Details for the file inverted_encoding-0.0.19.tar.gz.

File metadata

  • Download URL: inverted_encoding-0.0.19.tar.gz
  • Upload date:
  • Size: 66.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

File hashes

Hashes for inverted_encoding-0.0.19.tar.gz
Algorithm Hash digest
SHA256 2dc973f6a595300e357fcec6af14d58cce3a24f6ef051fa48108e42d7c2224f2
MD5 1ff318864d1e45370761c4fa5c0b5583
BLAKE2b-256 ecb544ac8de8914cbe6da228841be95ae549adbc147e5cc4b6d4c87fa87ea7f5

See more details on using hashes here.

File details

Details for the file inverted_encoding-0.0.19-py2-none-any.whl.

File metadata

  • Download URL: inverted_encoding-0.0.19-py2-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

File hashes

Hashes for inverted_encoding-0.0.19-py2-none-any.whl
Algorithm Hash digest
SHA256 ac85b779a7486089b65693bc236fb59fafe4409872ee02362cfef1564d8557c9
MD5 8d7cc0b70dc2adb009d59a9fa2d36ab1
BLAKE2b-256 51cdf218942f84c1c9bc21ca329628d95ef678905f2136980b729659f14be9ff

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page