Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yescarpenter-0.1.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yescarpenter-0.1.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file yescarpenter-0.1.2.tar.gz.

File metadata

  • Download URL: yescarpenter-0.1.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for yescarpenter-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0ec62f458b734ab4b05b655098b23c5263a20747cbafcf3002aa500e8a24ee0c
MD5 425594bb98a65cb8eef7bc58821be19b
BLAKE2b-256 6c58d46ef97ed7027c98f3682fcf5d97d14da12349ee64484aaa4e4f3d4d374f

See more details on using hashes here.

File details

Details for the file yescarpenter-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: yescarpenter-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for yescarpenter-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9c1dc562df3dfdee26b1af7a874117bc10266814c4badb79154fcc7c29822f93
MD5 7998ce2e66dd73d3061085a06ab86eb1
BLAKE2b-256 514c376783037e3f6e98e3692c62476dcdd710191d837f75835c169a95bc6307

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page