PyFastL2LiR
Fast L2-normalized linear regression
Install / Use
/learn @KamitaniLab/PyFastL2LiRREADME
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.
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
