A library providing frequently used functions in data analysis for YESlab members and other researchers
Project description
yescarpenter
This library provides some frequent used functions for YESlab members and other researchers, including data processing and analyses
Installation
From PyPI
Once the package is uploaded to PyPI, users can install it using pip:
pip install yescarpenter
Functions
perform_pca
This function leverages scikit-learn along with other popular data science libraries.
Usage:
import pandas as pd
from yescarpenter import perform_pca
# Create a sample DataFrame
data = pd.DataFrame({
'feature1': [1, 2, 3, 4],
'feature2': [2, 3, 4, 5],
'feature3': [3, 4, 5, 6]
})
# Perform PCA with 2 components
loadings, explained_variance, components = perform_pca(data, n_components=2)
print("Loadings:\n", loadings)
print("Explained Variance:\n", explained_variance)
print("Components:\n", components)
create_scree_plot
This function creates a scree plot to visualize the explained variance of each principal component.
scree_plot(explained_variance, n_components)
pc_plot
Create a plot to visualize the PCA loadings.
pc_plot(loadings, df)
construct_RDM
For IS-RSA. Construct the Representational Dissimilarity Matrix(RDM) from the data.
Usage:
construct_RDM(data, n_target, method = "cityblock")
do_rsa
Calculate the Spearman correlation between two RDMs(lower triangle) and do permutation
Usage:
do_RSA(rdm1, rdm2, n_perm=1000)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yescarpenter-0.1.4.tar.gz.
File metadata
- Download URL: yescarpenter-0.1.4.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbf1107e835712e9944a0bc6110a97f3cfeff198babe70ff75f403ede24ba0ca
|
|
| MD5 |
83a3ca287b6646ea619ce1f21167692d
|
|
| BLAKE2b-256 |
f849385caf0b24f4afc2fbbeae4db8d42be35b0c591296abebb2e0e749911067
|
File details
Details for the file yescarpenter-0.1.4-py3-none-any.whl.
File metadata
- Download URL: yescarpenter-0.1.4-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a7f6f9b8172a33a9c4077841272056ef778111e3b7711b2860c04401e58eff7
|
|
| MD5 |
b9ec79db79b118ffd887fcc853a1de8a
|
|
| BLAKE2b-256 |
ae72bb46e5ede2e9eda52d0fdfe8a4745dd5f070006c0bb1614afb71d86266db
|