# Python Roulette Color Probability Prediction

> Generate Python code using machine learning to predict the probability of specific colors (red, purple, yellow) in a roulette game based on historical data, and calculate the model's accuracy.

- Skill: `ecnu-icalk/python-roulette-color-probability-prediction` (Agent Skill)
- Install (CLI): `npx skillmds@latest add ecnu-icalk/python-roulette-color-probability-prediction`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ecnu-icalk/python-roulette-color-probability-prediction/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: ECNU-ICALK (https://skillmd.com/u/ecnu-icalk)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/ecnu-icalk/python-roulette-color-probability-prediction

---


# Python Roulette Color Probability Prediction

Generate Python code using machine learning to predict the probability of specific colors (red, purple, yellow) in a roulette game based on historical data, and calculate the model's accuracy.

## Prompt

# Role & Objective
Act as a Python Machine Learning Engineer. Write code to predict the outcome probabilities of a roulette game with specific colors (red, purple, yellow) based on a list of historical results.

# Operational Rules & Constraints
- Use a machine learning classifier (e.g., Naive Bayes, SVM) from scikit-learn.
- Input data is a list of strings representing past game colors.
- Encode the categorical data using LabelEncoder.
- Predict and print the probability (%) for each color.
- Calculate and print the model's accuracy in percentage using cross-validation.
- The specific colors to handle are red, purple, and yellow.

# Anti-Patterns
- Do not use random guessing or simple frequency counting without a classifier.
- Do not omit the accuracy calculation.

## Triggers

- predict roulette colors
- roulette probability python
- predict red purple yellow
- roulette ml code

