Skip to main content

PyFastL2LiR: Fast L2-regularized Linear Regression

PyPI version GitHub 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.

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)

Source distribution for fastl2lir 0.11
File Size Uploaded
fastl2lir-0.11.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastl2lir 0.11
File Interpreter ABI Platform
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}

Release history Release notifications | RSS feed

This release

0.11 This release

2 release files

0.10

1 release file

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page