[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XDAZN5N3NW0W3SCXX8CPY0":3,"skill-same:01M6XDAZN5N3NW0W3SCXX8CPY0":55},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":29,"linkOnly":30,"markdownContent":31,"markdownBody":32,"frontMatter":33,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":13,"repositoryHtmlUrl":37,"repositoryHomepageUrl":6,"ownerHtmlUrl":38,"ownerBlogUrl":6,"ownerDescription":39,"updatedAt":40,"install":41,"resources":54},"01M6XDAZN5N3NW0W3SCXX8CPY0","pca-decomposition",null,"Reduce dimensionality of multivariate data using PCA with varimax rotation. Use when you have many correlated variables and need to identify underlying factors or reduce collinearity.","Waaaalnut\u002Fskillsbench","Waaaalnut","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F103995656?v=4","01M6XCS9K1V51EY3JMB7DGMX24","01M6XCS9Q4WPW88W62C55G1H44",0,"MIT","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks-no-skills\u002Flake-warming-attribution\u002Fenvironment\u002Fskills\u002Fpca-decomposition\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28],"decomposition","PCA","pca decomposition","data","use","with","Variables","you","rotation","reduce","when","2026-11-10 10:12:30",false,"---\nname: pca-decomposition\ndescription: Reduce dimensionality of multivariate data using PCA with varimax rotation. Use when you have many correlated variables and need to identify underlying factors or reduce collinearity.\nlicense: MIT\n---\n\n# PCA Decomposition Guide\n\n## Overview\n\nPrincipal Component Analysis (PCA) reduces many correlated variables into fewer uncorrelated components. Varimax rotation makes components more interpretable by maximizing variance.\n\n## When to Use PCA\n\n- Many correlated predictor variables\n- Need to identify underlying factor groups\n- Reduce multicollinearity before regression\n- Exploratory data analysis\n\n## Basic PCA with Varimax Rotation\n```python\nfrom sklearn.preprocessing import StandardScaler\nfrom factor_analyzer import FactorAnalyzer\n\n# Standardize data first\nscaler = StandardScaler()\nX_scaled = scaler.fit_transform(X)\n\n# PCA with varimax rotation\nfa = FactorAnalyzer(n_factors=4, rotation='varimax')\nfa.fit(X_scaled)\n\n# Get factor loadings\nloadings = fa.loadings_\n\n# Get component scores for each observation\nscores = fa.transform(X_scaled)\n```\n\n## Workflow for Attribution Analysis\n\nWhen using PCA for contribution analysis with predefined categories:\n\n1. **Combine ALL variables first**, then do PCA together:\n```python\n# Include all variables from all categories in one matrix\nall_vars = ['AirTemp', 'NetRadiation', 'Precip', 'Inflow', 'Outflow',\n            'WindSpeed', 'DevelopedArea', 'AgricultureArea']\nX = df[all_vars].values\n\nscaler = StandardScaler()\nX_scaled = scaler.fit_transform(X)\n\n# PCA on ALL variables together\nfa = FactorAnalyzer(n_factors=4, rotation='varimax')\nfa.fit(X_scaled)\nscores = fa.transform(X_scaled)\n```\n\n2. **Interpret loadings** to map factors to categories (optional for understanding)\n\n3. **Use factor scores directly** for R² decomposition\n\n**Important**: Do NOT run separate PCA for each category. Run one global PCA on all variables, then use the resulting factor scores for contribution analysis.\n\n## Interpreting Factor Loadings\n\nLoadings show correlation between original variables and components:\n\n| Loading | Interpretation |\n|---------|----------------|\n| > 0.7 | Strong association |\n| 0.4 - 0.7 | Moderate association |\n| \u003C 0.4 | Weak association |\n\n## Example: Economic Indicators\n```python\nimport pandas as pd\nfrom sklearn.preprocessing import StandardScaler\nfrom factor_analyzer import FactorAnalyzer\n\n# Variables: gdp, unemployment, inflation, interest_rate, exports, imports\ndf = pd.read_csv('economic_data.csv')\nvariables = ['gdp', 'unemployment', 'inflation',\n             'interest_rate', 'exports', 'imports']\n\nX = df[variables].values\nscaler = StandardScaler()\nX_scaled = scaler.fit_transform(X)\n\nfa = FactorAnalyzer(n_factors=3, rotation='varimax')\nfa.fit(X_scaled)\n\n# View loadings\nloadings_df = pd.DataFrame(\n    fa.loadings_,\n    index=variables,\n    columns=['RC1', 'RC2', 'RC3']\n)\nprint(loadings_df.round(2))\n```\n\n## Choosing Number of Factors\n\n### Option 1: Kaiser Criterion\n```python\n# Check eigenvalues\neigenvalues, _ = fa.get_eigenvalues()\n\n# Keep factors with eigenvalue > 1\nn_factors = sum(eigenvalues > 1)\n```\n\n### Option 2: Domain Knowledge\n\nIf you know how many categories your variables should group into, specify directly:\n```python\n# Example: health data with 3 expected categories (lifestyle, genetics, environment)\nfa = FactorAnalyzer(n_factors=3, rotation='varimax')\n```\n\n## Common Issues\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Loadings all similar | Too few factors | Increase n_factors |\n| Negative loadings | Inverse relationship | Normal, interpret direction |\n| Low variance explained | Data not suitable for PCA | Check correlations first |\n\n## Best Practices\n\n- Always standardize data before PCA\n- Use varimax rotation for interpretability\n- Check factor loadings to name components\n- Use Kaiser criterion or domain knowledge for n_factors\n- For attribution analysis, run ONE global PCA on all variables\n","# PCA Decomposition Guide\n\n## Overview\n\nPrincipal Component Analysis (PCA) reduces many correlated variables into fewer uncorrelated components. Varimax rotation makes components more interpretable by maximizing variance.\n\n## When to Use PCA\n\n- Many correlated predictor variables\n- Need to identify underlying factor groups\n- Reduce multicollinearity before regression\n- Exploratory data analysis\n\n## Basic PCA with Varimax Rotation\n```python\nfrom sklearn.preprocessing import StandardScaler\nfrom factor_analyzer import FactorAnalyzer\n\n# Standardize data first\nscaler = StandardScaler()\nX_scaled = scaler.fit_transform(X)\n\n# PCA with varimax rotation\nfa = FactorAnalyzer(n_factors=4, rotation='varimax')\nfa.fit(X_scaled)\n\n# Get factor loadings\nloadings = fa.loadings_\n\n# Get component scores for each observation\nscores = fa.transform(X_scaled)\n```\n\n## Workflow for Attribution Analysis\n\nWhen using PCA for contribution analysis with predefined categories:\n\n1. **Combine ALL variables first**, then do PCA together:\n```python\n# Include all variables from all categories in one matrix\nall_vars = ['AirTemp', 'NetRadiation', 'Precip', 'Inflow', 'Outflow',\n            'WindSpeed', 'DevelopedArea', 'AgricultureArea']\nX = df[all_vars].values\n\nscaler = StandardScaler()\nX_scaled = scaler.fit_transform(X)\n\n# PCA on ALL variables together\nfa = FactorAnalyzer(n_factors=4, rotation='varimax')\nfa.fit(X_scaled)\nscores = fa.transform(X_scaled)\n```\n\n2. **Interpret loadings** to map factors to categories (optional for understanding)\n\n3. **Use factor scores directly** for R² decomposition\n\n**Important**: Do NOT run separate PCA for each category. Run one global PCA on all variables, then use the resulting factor scores for contribution analysis.\n\n## Interpreting Factor Loadings\n\nLoadings show correlation between original variables and components:\n\n| Loading | Interpretation |\n|---------|----------------|\n| > 0.7 | Strong association |\n| 0.4 - 0.7 | Moderate association |\n| \u003C 0.4 | Weak association |\n\n## Example: Economic Indicators\n```python\nimport pandas as pd\nfrom sklearn.preprocessing import StandardScaler\nfrom factor_analyzer import FactorAnalyzer\n\n# Variables: gdp, unemployment, inflation, interest_rate, exports, imports\ndf = pd.read_csv('economic_data.csv')\nvariables = ['gdp', 'unemployment', 'inflation',\n             'interest_rate', 'exports', 'imports']\n\nX = df[variables].values\nscaler = StandardScaler()\nX_scaled = scaler.fit_transform(X)\n\nfa = FactorAnalyzer(n_factors=3, rotation='varimax')\nfa.fit(X_scaled)\n\n# View loadings\nloadings_df = pd.DataFrame(\n    fa.loadings_,\n    index=variables,\n    columns=['RC1', 'RC2', 'RC3']\n)\nprint(loadings_df.round(2))\n```\n\n## Choosing Number of Factors\n\n### Option 1: Kaiser Criterion\n```python\n# Check eigenvalues\neigenvalues, _ = fa.get_eigenvalues()\n\n# Keep factors with eigenvalue > 1\nn_factors = sum(eigenvalues > 1)\n```\n\n### Option 2: Domain Knowledge\n\nIf you know how many categories your variables should group into, specify directly:\n```python\n# Example: health data with 3 expected categories (lifestyle, genetics, environment)\nfa = FactorAnalyzer(n_factors=3, rotation='varimax')\n```\n\n## Common Issues\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Loadings all similar | Too few factors | Increase n_factors |\n| Negative loadings | Inverse relationship | Normal, interpret direction |\n| Low variance explained | Data not suitable for PCA | Check correlations first |\n\n## Best Practices\n\n- Always standardize data before PCA\n- Use varimax rotation for interpretability\n- Check factor loadings to name components\n- Use Kaiser criterion or domain knowledge for n_factors\n- For attribution analysis, run ONE global PCA on all variables\n",{"name":5,"license":14,"description":7},"main","7eeb258ada72b7f58119b0e7a2c00ea89d9beedd","tasks-no-skills\u002Flake-warming-attribution\u002Fenvironment\u002Fskills\u002Fpca-decomposition","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench","https:\u002F\u002Fgithub.com\u002FWaaaalnut","student of Zhejiang University","2026-04-21 23:16:23",{"source":8,"skillName":5,"commands":42,"prompt":52,"zipAvailable":53},[43,46,49],{"tool":44,"command":45},"npx","npx skills add Waaaalnut\u002Fskillsbench --skill pca-decomposition",{"tool":47,"command":48},"bunx","bunx skills add Waaaalnut\u002Fskillsbench --skill pca-decomposition",{"tool":50,"command":51},"pnpm","pnpm dlx skills add Waaaalnut\u002Fskillsbench --skill pca-decomposition","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks-no-skills\u002Flake-warming-attribution\u002Fenvironment\u002Fskills\u002Fpca-decomposition\u002FSKILL.md",true,[],[56,65,80,100,121,140],{"skillNo":57,"name":58,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":29},"01M6XEWMJ6VY3ZC53MPDCPG3GH","data-reconciliation","Apache-2.0","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fxlsx-recover-data\u002Fenvironment\u002Fskills\u002Fdata-reconciliation\u002FSKILL.md",[],[63,64,21],"data reconciliation","reconciliation",{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":29},"01M6XEW8MNPMF1KRXV6ATGFRQF","speech-to-text","Transcribe video to timestamped text using Whisper tiny model (pre-installed).","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-tutorial-indexer\u002Fenvironment\u002Fskills\u002Fspeech-to-text\u002FSKILL.md",[],[72,73,74,75,76,77,78,79],"speech","text","speech to text","transcribe video","whisper","model","Video","transcribe",{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":29},"01M6XEW3FQZP0T1RKQQJFXVY9T","video-processor","Process videos by removing segments and concatenating remaining parts. Use when you need to remove detected pauses\u002Fopenings from videos, create highlight reels, or batch process segment removals using ffmpeg filter_complex.","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Fvideo-processor\u002FSKILL.md",[],[78,87,88,89,90,91,28,92,93,94,95,25,96,97,98,22,99],"processor","video processor","batch","create","reels","parts","segments","process","videos","segment","filter","ffmpeg","remove",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":29},"01M6XEVXJ5KZ0NTY3XZKRY4AS1","silence-detector","Detect initial silence segments in audio\u002Fvideo using energy-based analysis. Use when you need to find low-energy periods at the start of recordings (title slides, setup time, pre-roll silence).","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Fsilence-detector\u002FSKILL.md",[],[107,108,109,110,28,25,111,112,113,114,115,93,116,117,78,118,119,120,22],"detector","silence detector","title","slides","time","energy","at","recordings","detect","find","Audio","analysis","start","setup",{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":29},"01M6XEVT3NGRN1FT7JPMAPXS6M","segment-combiner","Combine multiple segment detection results into a unified list. Use when you need to merge segments from different detectors, prepare removal lists for video processing, or consolidate detection outputs.","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Fsegment-combiner\u002FSKILL.md",[],[96,128,78,129,130,131,132,133,28,134,135,93,25,136,137,22,138,139],"segment combiner","detection","prepare","merge","video processing","for","outputs","combine","processing","consolidate","results","list",{"skillNo":141,"name":142,"nameZh":6,"description":143,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":144,"categories":145,"keywords":146,"publishedAt":29},"01M6XEVMPVASGS2KX86QK4FMT7","report-generator","Generate compression reports for video processing. Use when you need to create structured JSON reports with duration statistics, compression ratios, and segment details after video processing.","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Freport-generator\u002FSKILL.md",[],[147,148,149,96,28,133,25,23,136,150,151,152,22,132,153,78,154,155,90],"generator","report generator","report","statistics","structured","reports","json","compression","generate"]