[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XEBA2KR787Q5N6TCG74XZM":3,"skill-same:01M6XEBA2KR787Q5N6TCG74XZM":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},"01M6XEBA2KR787Q5N6TCG74XZM","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\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\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\u002Flake-warming-attribution\u002Fenvironment\u002Fskills\u002Fcontribution-analysis\u002FSKILL.md",true,[],[57,67,82,102,122,141],{"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":63,"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",[],[64,65,66],"data reconciliation","reconciliation","data",{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"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",[],[74,75,76,77,78,79,80,81],"speech","text","speech to text","transcribe video","whisper","model","Video","transcribe",{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"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",[],[80,89,90,91,92,93,29,94,95,96,97,27,98,99,100,24,101],"processor","video processor","batch","create","reels","parts","segments","process","videos","segment","filter","ffmpeg","remove",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"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",[],[109,110,111,112,29,27,113,114,115,116,117,95,118,119,80,18,120,121,24],"detector","silence detector","title","slides","time","energy","at","recordings","detect","find","Audio","start","setup",{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"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",[],[98,129,80,130,131,132,133,134,29,135,136,95,27,137,138,24,139,140],"segment combiner","detection","prepare","merge","video processing","for","outputs","combine","processing","consolidate","results","list",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"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",[],[148,149,150,98,29,134,27,151,137,152,153,154,24,133,155,80,156,157,92],"generator","report generator","report","with","statistics","structured","reports","json","compression","generate"]