Metadata-Version: 2.3
Name: fastl2lir
Version: 0.11
Summary: Fast L2-reguralized linear regression
Author: Kei Majima
Author-email: Kei Majima <kamitanilab@gmail.com>
License: MIT License
         
         Copyright (c) 2019 Kamitani Lab
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Requires-Dist: numpy>=1.16.6
Requires-Dist: threadpoolctl>=2.1.0 ; python_full_version >= '3.5'
Requires-Dist: tqdm>=4.64.1
Maintainer: Shuntaro C. Aoki, Yoshihiro Nagano
Maintainer-email: Shuntaro C. Aoki <kamitanilab@gmail.com>, Yoshihiro Nagano <kamitanilab@gmail.com>
Requires-Python: >=3.1
Project-URL: Bug Tracker, https://github.com/KamitaniLab/PyFastL2LiR/issues
Project-URL: Homepage, https://github.com/KamitaniLab/PyFastL2LiR
Project-URL: Repository, https://github.com/KamitaniLab/PyFastL2LiR
Description-Content-Type: text/markdown

# PyFastL2LiR: Fast L2-regularized Linear Regression

[![PyPI version](https://badge.fury.io/py/fastl2lir.svg)](https://badge.fury.io/py/fastl2lir)
[![GitHub license](https://img.shields.io/github/license/KamitaniLab/PyFastL2LiR)](https://github.com/KamitaniLab/PyFastL2LiR/blob/master/LICENSE)

PyFastL2LR is fast implementation of ridge regression (regression with L2 normalization) that is developed for predicting neural netowrk unit activities from fMRI data. This method is five times faster than ordinary implementations of ridge regression, and can be used with feature selection.

## Installation

```
$ pip install fastl2lir
```

When installing on Python >= 3.5, `threadpoolctl` are required.

## Usage

```
import fastl2lir


model = fastl2lir.FastL2LiR()
model.fit(X, Y, alpha, n_feat)
Y_predicted = model.predict(X)
```

Here,

* `X`: A matrix (# of training samples x # of voxels).
* `Y`: A vector including label information (# of training samples x # of cnn features).
* `alpha`: Regularization term of L2 normalization.
* `n_feat`: # of features to be selected (feature selection is based on correlation coefficient).

See `demo.py` for more examples.

## Notice

* You don't need to add bias term in `X`; `FastL2LiR` automatically adds the bias term in the input data.
* `FastL2LiR.fit()` automatically performs feature selection. You don't need to select features by yourself.
* `X` and `Y` should be z-scored with mean and standard deviation of training data.
