sekupy


Namesekupy JSON
Version 0.0.1 PyPI version JSON
download
home_pageNone
SummaryDetergent for your dirty neuroimaging pipelines
upload_time2024-07-26 15:33:33
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseLicense for sekupy ================== New BSD License Copyright (c) The sekupy developers. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: a. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. b. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. c. Neither the name of the sekupy developers nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords eeg meg mvpa brain fmri machine learning neuroimaging neuroscience
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # sekupy

![example workflow](https://github.com/robbisg/sekupy/actions/workflows/test.yaml/badge.svg)
[![codecov](https://codecov.io/gh/robbisg/sekupy/branch/master/graph/badge.svg)](https://codecov.io/gh/robbisg/sekupy)
[![Documentation Status](https://readthedocs.org/projects/sekupy/badge/?version=latest)](https://sekupy.readthedocs.io/en/latest/?badge=latest)
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![CodeFactor](https://www.codefactor.io/repository/github/robbisg/sekupy/badge)](https://www.codefactor.io/repository/github/robbisg/sekupy)

`sekupy` is a python-package created for deterging your (dirty) (and) (multivariate) neuroimaging analyses. The package has been thought for
decoding analyses but it includes also basic univariate analyses.

It has some utilities to vary sets of parameters of the analyses without struggling with `for` and `if` statements.

It deterges your results, by saving them in a safe manner, by also keeping in mind BIDS.

`sekupy` is the deterged version of `pyitab`.

# Documentation

The documention can be found [here](https://sekupy.readthedocs.io/).

# Install
The package isn't yet on `pip`.
You can install it by using:
```
python setup.py install
```

# Example
The main idea is to use a dictionary to configure all parameters of your analysis, feed the configuration into an ```AnalysisPipeline``` object, call ```fit``` to obtain results, then ```save``` to store in a ```BIDS```-ish way.

For example if we want to perform a ```RoiDecoding``` analysis using some preprocessing steps we will have a script like this (this is not a complete example):
```python
from sekupy.analysis.configurator import AnalysisConfigurator
from sekupy.analysis.pipeline import AnalysisPipeline
from sekupy.analysis.decoding.roi_decoding import RoiDecoding

_default_config = {
                    # Here we specifiy that we have to transform the dataset labels
                    # then select samples and then balance data
                    'prepro': ['target_transformer', 'sample_slicer', 'balancer'],
                    
                    # Here we set which attribute to choose (dataset is a pymvpa dataset)
                    'target_transformer__attr': "image_type",
                    # Here we select samples with a image_type equal to I or O and evidence equal to 1
                    'sample_slicer__attr': {'image_type':["I", "O"], 'evidence':[1]},
                    # Then we say that we want to balance image_type at subject-level
                    "balancer__attr": 'subject',

                    # We setup the estimator in a sklearn way
                    'estimator': [
                        ('fsel', SelectKBest(k=50)),
                        ('clf', SVC(C=1, kernel='linear'))],
                    'estimator__clf__C': 1,
                    'estimator__clf__kernel': 'linear',
                    
                    # Then the cross-validation object (also sklearn)
                    'cv': LeaveOneGroupOut,
                    
                    'scores': ['accuracy'],
                    
                    # Then the analysis
                    'analysis': RoiDecoding,
                    'analysis__n_jobs': -1,
                    
                    'analysis__permutation': 0,
                    
                    'analysis__verbose': 0,
                    
                    # Here we say that we want use the region with value 1 in image+type mask
                    'kwargs__roi_values': [('image+type', [1]), ('image+type', [2]), ('image+type', [3]),
                                            ('image+type', [4]), ('image+type', [5])],
                    
                    # We want to use subject for our cross-validation
                    'kwargs__cv_attr': 'subject'
                    }

configuration = AnalysisConfigurator(**_default_config), 
                                     kind='configuration') 
kwargs = configuration._get_kwargs() 
a = AnalysisPipeline(conf, name="roi_decoding_across_full").fit(ds, **kwargs) 
a.save() 
```
Surf the code, starting from classes used here!!

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sekupy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "EEG, MEG, MVPA, brain, fMRI, machine learning, neuroimaging, neuroscience",
    "author": null,
    "author_email": "Roberto Guidotti <roberto.guidotti@unich.it>",
    "download_url": "https://files.pythonhosted.org/packages/e9/71/9c0b3dbeb812df714cff55ee9811f2ff50eeea04f73fba9a5292eaa18b85/sekupy-0.0.1.tar.gz",
    "platform": null,
    "description": "# sekupy\n\n![example workflow](https://github.com/robbisg/sekupy/actions/workflows/test.yaml/badge.svg)\n[![codecov](https://codecov.io/gh/robbisg/sekupy/branch/master/graph/badge.svg)](https://codecov.io/gh/robbisg/sekupy)\n[![Documentation Status](https://readthedocs.org/projects/sekupy/badge/?version=latest)](https://sekupy.readthedocs.io/en/latest/?badge=latest)\n[![Project Status: WIP \u2013 Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)\n[![CodeFactor](https://www.codefactor.io/repository/github/robbisg/sekupy/badge)](https://www.codefactor.io/repository/github/robbisg/sekupy)\n\n`sekupy` is a python-package created for deterging your (dirty) (and) (multivariate) neuroimaging analyses. The package has been thought for\ndecoding analyses but it includes also basic univariate analyses.\n\nIt has some utilities to vary sets of parameters of the analyses without struggling with `for` and `if` statements.\n\nIt deterges your results, by saving them in a safe manner, by also keeping in mind BIDS.\n\n`sekupy` is the deterged version of `pyitab`.\n\n# Documentation\n\nThe documention can be found [here](https://sekupy.readthedocs.io/).\n\n# Install\nThe package isn't yet on `pip`.\nYou can install it by using:\n```\npython setup.py install\n```\n\n# Example\nThe main idea is to use a dictionary to configure all parameters of your analysis, feed the configuration into an ```AnalysisPipeline``` object, call ```fit``` to obtain results, then ```save``` to store in a ```BIDS```-ish way.\n\nFor example if we want to perform a ```RoiDecoding``` analysis using some preprocessing steps we will have a script like this (this is not a complete example):\n```python\nfrom sekupy.analysis.configurator import AnalysisConfigurator\nfrom sekupy.analysis.pipeline import AnalysisPipeline\nfrom sekupy.analysis.decoding.roi_decoding import RoiDecoding\n\n_default_config = {\n                    # Here we specifiy that we have to transform the dataset labels\n                    # then select samples and then balance data\n                    'prepro': ['target_transformer', 'sample_slicer', 'balancer'],\n                    \n                    # Here we set which attribute to choose (dataset is a pymvpa dataset)\n                    'target_transformer__attr': \"image_type\",\n                    # Here we select samples with a image_type equal to I or O and evidence equal to 1\n                    'sample_slicer__attr': {'image_type':[\"I\", \"O\"], 'evidence':[1]},\n                    # Then we say that we want to balance image_type at subject-level\n                    \"balancer__attr\": 'subject',\n\n                    # We setup the estimator in a sklearn way\n                    'estimator': [\n                        ('fsel', SelectKBest(k=50)),\n                        ('clf', SVC(C=1, kernel='linear'))],\n                    'estimator__clf__C': 1,\n                    'estimator__clf__kernel': 'linear',\n                    \n                    # Then the cross-validation object (also sklearn)\n                    'cv': LeaveOneGroupOut,\n                    \n                    'scores': ['accuracy'],\n                    \n                    # Then the analysis\n                    'analysis': RoiDecoding,\n                    'analysis__n_jobs': -1,\n                    \n                    'analysis__permutation': 0,\n                    \n                    'analysis__verbose': 0,\n                    \n                    # Here we say that we want use the region with value 1 in image+type mask\n                    'kwargs__roi_values': [('image+type', [1]), ('image+type', [2]), ('image+type', [3]),\n                                            ('image+type', [4]), ('image+type', [5])],\n                    \n                    # We want to use subject for our cross-validation\n                    'kwargs__cv_attr': 'subject'\n                    }\n\nconfiguration = AnalysisConfigurator(**_default_config), \n                                     kind='configuration') \nkwargs = configuration._get_kwargs() \na = AnalysisPipeline(conf, name=\"roi_decoding_across_full\").fit(ds, **kwargs) \na.save() \n```\nSurf the code, starting from classes used here!!\n",
    "bugtrack_url": null,
    "license": "License for sekupy ==================  New BSD License  Copyright (c) The sekupy developers. All rights reserved.   Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  a. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. b. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. c. Neither the name of the sekupy developers nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
    "summary": "Detergent for your dirty neuroimaging pipelines",
    "version": "0.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/robbisg/sekupy/issues/",
        "Documentation": "https://sekupy.readthedocs.io/",
        "Homepage": "https://github.com/robbisg/sekupy",
        "Source Code": "https://github.com/robbisg/sekupy"
    },
    "split_keywords": [
        "eeg",
        " meg",
        " mvpa",
        " brain",
        " fmri",
        " machine learning",
        " neuroimaging",
        " neuroscience"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "072b0d9cdde258aea7e8a0dc27ec235aae89425180b8a054a7bb2ad06ff99361",
                "md5": "9047febb873d99e37464e851cb47d6ed",
                "sha256": "54b4c9e7d5d0929602e3e13adaabfd176843220eb6e259586e1503f05fd7622e"
            },
            "downloads": -1,
            "filename": "sekupy-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9047febb873d99e37464e851cb47d6ed",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 236192,
            "upload_time": "2024-07-26T15:33:29",
            "upload_time_iso_8601": "2024-07-26T15:33:29.443301Z",
            "url": "https://files.pythonhosted.org/packages/07/2b/0d9cdde258aea7e8a0dc27ec235aae89425180b8a054a7bb2ad06ff99361/sekupy-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e9719c0b3dbeb812df714cff55ee9811f2ff50eeea04f73fba9a5292eaa18b85",
                "md5": "32a180dd0f6d5fd3181d32cd401551f7",
                "sha256": "c22727006392b25e6edfd8891aa28c85a4f78c44ec46986090cdcf359eaa9e56"
            },
            "downloads": -1,
            "filename": "sekupy-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "32a180dd0f6d5fd3181d32cd401551f7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 197504,
            "upload_time": "2024-07-26T15:33:33",
            "upload_time_iso_8601": "2024-07-26T15:33:33.201452Z",
            "url": "https://files.pythonhosted.org/packages/e9/71/9c0b3dbeb812df714cff55ee9811f2ff50eeea04f73fba9a5292eaa18b85/sekupy-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-26 15:33:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "robbisg",
    "github_project": "sekupy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "sekupy"
}
        
Elapsed time: 4.54761s