[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XDAMTNWS0AYGTVA8N65V94":3,"skill-same:01M6XDAMTNWS0AYGTVA8N65V94":56},{"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":30,"linkOnly":31,"markdownContent":32,"markdownBody":33,"frontMatter":34,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":13,"repositoryHtmlUrl":38,"repositoryHomepageUrl":6,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":40,"updatedAt":41,"install":42,"resources":55},"01M6XDAMTNWS0AYGTVA8N65V94","contribution-analysis",null,"Calculate the relative contribution of different factors to a response variable using R² decomposition. Use when you need to quantify how much each factor explains the variance of an outcome.","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\u002Fcontribution-analysis\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29],"analysis","contribution","contribution analysis","how","calculate","outcome","use","decomposition","factor","you","r2","when","2026-11-10 10:12:30",false,"---\nname: contribution-analysis\ndescription: Calculate the relative contribution of different factors to a response variable using R² decomposition. Use when you need to quantify how much each factor explains the variance of an outcome.\nlicense: MIT\n---\n\n# Contribution Analysis Guide\n\n## Overview\n\nContribution analysis quantifies how much each factor contributes to explaining the variance of a response variable. This skill focuses on R² decomposition method.\n\n## Complete Workflow\n\nWhen you have multiple correlated variables that belong to different categories:\n```python\nimport pandas as pd\nimport numpy as np\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.linear_model import LinearRegression\nfrom factor_analyzer import FactorAnalyzer\n\n# Step 1: Combine ALL variables into one matrix\npca_vars = ['Var1', 'Var2', 'Var3', 'Var4', 'Var5', 'Var6', 'Var7', 'Var8']\nX = df[pca_vars].values\ny = df['ResponseVariable'].values\n\n# Step 2: Standardize\nscaler = StandardScaler()\nX_scaled = scaler.fit_transform(X)\n\n# Step 3: Run ONE global PCA on all variables together\nfa = FactorAnalyzer(n_factors=4, rotation='varimax')\nfa.fit(X_scaled)\nscores = fa.transform(X_scaled)\n\n# Step 4: R² decomposition on factor scores\ndef calc_r2(X, y):\n    model = LinearRegression()\n    model.fit(X, y)\n    y_pred = model.predict(X)\n    ss_res = np.sum((y - y_pred) ** 2)\n    ss_tot = np.sum((y - np.mean(y)) ** 2)\n    return 1 - (ss_res \u002F ss_tot)\n\nfull_r2 = calc_r2(scores, y)\n\n# Step 5: Calculate contribution of each factor\ncontrib_0 = full_r2 - calc_r2(scores[:, [1, 2, 3]], y)\ncontrib_1 = full_r2 - calc_r2(scores[:, [0, 2, 3]], y)\ncontrib_2 = full_r2 - calc_r2(scores[:, [0, 1, 3]], y)\ncontrib_3 = full_r2 - calc_r2(scores[:, [0, 1, 2]], y)\n```\n\n## R² Decomposition Method\n\nThe contribution of each factor is calculated by comparing the full model R² with the R² when that factor is removed:\n```\nContribution_i = R²_full - R²_without_i\n```\n\n## Output Format\n```python\ncontributions = {\n    'Category1': contrib_0 * 100,\n    'Category2': contrib_1 * 100,\n    'Category3': contrib_2 * 100,\n    'Category4': contrib_3 * 100\n}\n\ndominant = max(contributions, key=contributions.get)\ndominant_pct = round(contributions[dominant])\n\nwith open('output.csv', 'w') as f:\n    f.write('variable,contribution\\n')\n    f.write(f'{dominant},{dominant_pct}\\n')\n```\n\n## Common Issues\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Negative contribution | Suppressor effect | Check for multicollinearity |\n| Contributions don't sum to R² | Normal behavior | R² decomposition is approximate |\n| Very small contributions | Factor not important | May be negligible driver |\n\n## Best Practices\n\n- Run ONE global PCA on all variables together, not separate PCA per category\n- Use factor_analyzer with varimax rotation\n- Map factors to category names based on loadings interpretation\n- Report contribution as percentage\n- Identify the dominant (largest) factor\n","# Contribution Analysis Guide\n\n## Overview\n\nContribution analysis quantifies how much each factor contributes to explaining the variance of a response variable. This skill focuses on R² decomposition method.\n\n## Complete Workflow\n\nWhen you have multiple correlated variables that belong to different categories:\n```python\nimport pandas as pd\nimport numpy as np\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.linear_model import LinearRegression\nfrom factor_analyzer import FactorAnalyzer\n\n# Step 1: Combine ALL variables into one matrix\npca_vars = ['Var1', 'Var2', 'Var3', 'Var4', 'Var5', 'Var6', 'Var7', 'Var8']\nX = df[pca_vars].values\ny = df['ResponseVariable'].values\n\n# Step 2: Standardize\nscaler = StandardScaler()\nX_scaled = scaler.fit_transform(X)\n\n# Step 3: Run ONE global PCA on all variables together\nfa = FactorAnalyzer(n_factors=4, rotation='varimax')\nfa.fit(X_scaled)\nscores = fa.transform(X_scaled)\n\n# Step 4: R² decomposition on factor scores\ndef calc_r2(X, y):\n    model = LinearRegression()\n    model.fit(X, y)\n    y_pred = model.predict(X)\n    ss_res = np.sum((y - y_pred) ** 2)\n    ss_tot = np.sum((y - np.mean(y)) ** 2)\n    return 1 - (ss_res \u002F ss_tot)\n\nfull_r2 = calc_r2(scores, y)\n\n# Step 5: Calculate contribution of each factor\ncontrib_0 = full_r2 - calc_r2(scores[:, [1, 2, 3]], y)\ncontrib_1 = full_r2 - calc_r2(scores[:, [0, 2, 3]], y)\ncontrib_2 = full_r2 - calc_r2(scores[:, [0, 1, 3]], y)\ncontrib_3 = full_r2 - calc_r2(scores[:, [0, 1, 2]], y)\n```\n\n## R² Decomposition Method\n\nThe contribution of each factor is calculated by comparing the full model R² with the R² when that factor is removed:\n```\nContribution_i = R²_full - R²_without_i\n```\n\n## Output Format\n```python\ncontributions = {\n    'Category1': contrib_0 * 100,\n    'Category2': contrib_1 * 100,\n    'Category3': contrib_2 * 100,\n    'Category4': contrib_3 * 100\n}\n\ndominant = max(contributions, key=contributions.get)\ndominant_pct = round(contributions[dominant])\n\nwith open('output.csv', 'w') as f:\n    f.write('variable,contribution\\n')\n    f.write(f'{dominant},{dominant_pct}\\n')\n```\n\n## Common Issues\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Negative contribution | Suppressor effect | Check for multicollinearity |\n| Contributions don't sum to R² | Normal behavior | R² decomposition is approximate |\n| Very small contributions | Factor not important | May be negligible driver |\n\n## Best Practices\n\n- Run ONE global PCA on all variables together, not separate PCA per category\n- Use factor_analyzer with varimax rotation\n- Map factors to category names based on loadings interpretation\n- Report contribution as percentage\n- Identify the dominant (largest) factor\n",{"name":5,"license":14,"description":7},"main","7eeb258ada72b7f58119b0e7a2c00ea89d9beedd","tasks-no-skills\u002Flake-warming-attribution\u002Fenvironment\u002Fskills\u002Fcontribution-analysis","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":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add Waaaalnut\u002Fskillsbench --skill contribution-analysis",{"tool":48,"command":49},"bunx","bunx skills add Waaaalnut\u002Fskillsbench --skill contribution-analysis",{"tool":51,"command":52},"pnpm","pnpm dlx skills add Waaaalnut\u002Fskillsbench --skill contribution-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks-no-skills\u002Flake-warming-attribution\u002Fenvironment\u002Fskills\u002Fcontribution-analysis\u002FSKILL.md",true,[],[57,72,87,112,133,152],{"skillNo":58,"name":59,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":68,"publishedAt":30},"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],{"categoryNo":64,"categoryName":65,"taxonomyType":66,"taxonomyTypeDesc":67},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[69,70,71],"data reconciliation","reconciliation","data",{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":30},"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",[],[79,80,81,82,83,84,85,86],"speech","text","speech to text","transcribe video","whisper","model","Video","transcribe",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":98,"publishedAt":30},"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",[93],{"categoryNo":94,"categoryName":95,"taxonomyType":96,"taxonomyTypeDesc":97},"01JBSEEDCAT000000000000016","图像与多媒体","SCENARIO","使用场景",[85,99,100,101,102,103,29,104,105,106,107,27,108,109,110,24,111],"processor","video processor","batch","create","reels","parts","segments","process","videos","segment","filter","ffmpeg","remove",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":119,"publishedAt":30},"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",[118],{"categoryNo":94,"categoryName":95,"taxonomyType":96,"taxonomyTypeDesc":97},[120,121,122,123,29,27,124,125,126,127,128,105,129,130,85,18,131,132,24],"detector","silence detector","title","slides","time","energy","at","recordings","detect","find","Audio","start","setup",{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":30},"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",[],[108,140,85,141,142,143,144,145,29,146,147,105,27,148,149,24,150,151],"segment combiner","detection","prepare","merge","video processing","for","outputs","combine","processing","consolidate","results","list",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":161,"publishedAt":30},"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",[158],{"categoryNo":159,"categoryName":160,"taxonomyType":66,"taxonomyTypeDesc":67},"01JBSEEDCAT000000000000034","行政与办公人员",[162,163,164,108,29,145,27,165,148,166,167,168,24,144,169,85,170,171,102],"generator","report generator","report","with","statistics","structured","reports","json","compression","generate"]