PyFastL2LiR: Fast L2-regularized Linear Regression
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;FastL2LiRautomatically adds the bias term in the input data. FastL2LiR.fit()automatically performs feature selection. You don't need to select features by yourself.XandYshould be z-scored with mean and standard deviation of training data.
Release files for fastl2lir 0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fastl2lir-0.11.tar.gz | 6.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastl2lir-0.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.2 kB
Release files / fastl2lir-0.11.tar.gz
| Download URL | fastl2lir-0.11.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7930d6c5c0886392a2236f08e637199b965d4167afef0632da678737f8c7cd62
|
|
BLAKE2b-256 checksum How to use checksums |
01670094fbe23ad1cba35f5b70dad8c4d6bacf3b93956a103c02f9d7fda8d875
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / fastl2lir-0.11-py3-none-any.whl
| Download URL | fastl2lir-0.11-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4d831fc1d9ab0bad20301f9495e91b9f16677ebcac68296a8906acbd9dfc3f89
|
|
BLAKE2b-256 checksum How to use checksums |
40949508edf9642dca84d57c35cd9b0dfce52fafcfcb708cee46fd580f518029
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|