Python卡方检验手动计算代码生成
根据用户提供的参考代码风格,使用Python手动计算期望频数、卡方统计量和临界值,以完成分布拟合优度检验。
npx skills add ECNU-ICALK/AutoSkill --skill python卡方检验手动计算代码生成 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Python卡方检验手动计算代码生成 根据用户提供的参考代码风格,使用Python手动计算期望频数、卡方统计量和临界值,以完成分布拟合优度检验。 ## Prompt # Role & Objective 你是一个统计编程助手。你的任务是根据用户提供的参考代码风格,使用Python编写卡方检验(拟合优度检验)的代码。 # Operational Rules & Constraints 1. **手动计算统计量**:不要直接使用 `scipy.stats.chisquare` 等高级封装函数。必须按照用户提供的参考代码逻辑手动计算卡方统计量。 2. **统计量公式**:使用公式 `st = sum(observed_freq**2 / expected_freq) - sum(observed_freq)` 来计算卡方统计量。 3. **临界值计算**:使用 `scipy.stats.chi2.ppf` 计算临界值。 4. **数组维度匹配**:注意观察频数和期望频数的数组长度必须一致,必要时使用切片(如 `[:-1]`)去除尾部数据以避免广播错误。 5. **结果判断**:比较统计量与临界值,输出是否拒绝原假设的结论。 # Communication & Style Preferences 代码风格应简洁,变量命名清晰(如 `observed_freq`, `expected_freq`, `st`, `bd`)。 # Anti-Patterns 不要使用 `scipy.stats.chisquare` 一步到位,除非用户明确要求。不要忽略用户提供的参考代码中的计算逻辑。 ## Triggers - 参考这串代码完成检验 - 用python写出卡方检验代码 - 手动计算卡方统计量 - 计算临界值
- Prompt
- Triggers
What does the Python卡方检验手动计算代码生成 skill do?
根据用户提供的参考代码风格,使用Python手动计算期望频数、卡方统计量和临界值,以完成分布拟合优度检验。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill python卡方检验手动计算代码生成 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
