@swimmerBill
AI generated answer from my prompts:
This is an excellent Lichess forum post! It effectively communicates the key points and limitations of using AI for such conversions. Here are a few more things you could add to enhance it, keeping in mind the audience of a chess forum:
Original Post (as you provided it):
I ask Gemini AI to make a python script from the formula in the pdf and the categories that are in the wiki.
https://en.wikipedia.org/wiki/United_States_Chess_Federation
The results from the python script may not be accurate, but it gives you a good idea what an AI can do without their Canvas.
If you feed an AI enough prompts, it can generate code to your own liking. This is why the rating conversion I used cannot be considered official. All because of my prompt comments to AI. For me, the results of the python script fills my curiosity.
$ python3 fide2uscf_2024.py
General conversion "Example" of FIDE to USCF FIDE Rating USCF Rating USCF Class
800 180 Class J
1000 494 Class H
1200 807 Class F
1400 1120 Class E
1600 1434 Class C
1800 1747 Class B
1900 1904 Class A
2000 2060 Expert
2001 2061 Expert
2100 2162 Expert
2200 2264 National Master
2300 2366 National Master
2400 2468 Senior Master
2500 2570 Senior Master
2600 2672 Senior Master
2700 2774 Senior Master
2800 2876 Senior Master
--- Additional Boundary Checks --- FIDE Rating USCF Rating USCF Class
1999 2059 Expert
2000 2060 Expert
2001 2061 Expert
Is it accurate, I cannot prove it. Plug in a formula in a python script and then test it out.
Suggested Additions/Modifications to your Lichess Post:
You've already got a great foundation. Here's how you could build on it, especially to preempt common questions or add more clarity for a chess audience:
Emphasize "Official" and "Guideline": While you state it's not official, you can reinforce that the formulas themselves are from USCF's official documentation. The "not official" part stems from your specific "prompt comments" (e.g., excluding the youth formula, which USCF does use).
Briefly explain the "negative rating" curiosity: Since it came up in our discussion, it's good to address why a formula might produce a negative number, even if it's not practical.
Encourage independent verification (as you already do): Reiterate that people should verify with the source documents.
Consider adding the Python code itself: For those who are technically inclined, providing the full script directly in the post (or linking to a Pastebin/GitHub Gist) would be valuable. Lichess forums support code blocks.
A concluding thought on AI's utility: Reiterate the power of AI for prototyping and understanding.
Here's a revised version incorporating these ideas:
Revised Lichess Forum Post Suggestion:
"Hey everyone,
I've been playing around with Gemini AI to convert FIDE ratings to USCF ratings, using the official formulas from the US Chess Federation's Rating System Specifications (March 1, 2024, and corrections) and the USCF rating classes from Wikipedia.
The interesting part is how I could prompt the AI to generate a Python script to my specific liking. For example, I intentionally excluded the "youth" conversion formula that US Chess also provides, focusing only on the general adult conversion. This highlights that while the source formulas are official, the resulting script and its output aren't an 'official' USCF conversion tool, but rather a demonstration of what can be built with specific AI prompts.
For me, this little experiment fills my curiosity about how these different rating systems roughly align.
Here are some general conversion examples from the Python script:
$ python3 fide2uscf_2024.py
--- FIDE to USCF General Conversion Examples ---
FIDE Rating USCF Rating USCF Class
800 180 Class J
1000 494 Class H
1200 807 Class F
1400 1120 Class E
1600 1434 Class C
1800 1747 Class B
1900 1904 Class A
2000 2060 Expert
2001 2061 Expert
2100 2162 Expert
2200 2264 National Master
2300 2366 National Master
2400 2468 Senior Master
2500 2570 Senior Master
2600 2672 Senior Master
2700 2774 Senior Master
2800 2876 Senior Master
--- Additional Boundary Checks ---
FIDE Rating USCF Rating USCF Class
1999 2059 Expert
2000 2060 Expert
2001 2061 Expert
A quick note on negative ratings: You might notice a FIDE 500 converts to a negative USCF rating if you tried it with the full script. While the mathematical formula from US Chess can indeed yield negative results for very low FIDE ratings, in practice, USCF typically has rating floors (e.g., 100) for active players. So, you wouldn't typically see a negative rating on an official USCF profile; it's more about how the formula maps the lower end of the spectrum before a player establishes a stable rating.
Is this perfectly accurate? As mentioned, it's based on the official formulas as of March 2024, but the precise application by USCF for initial ratings can involve additional factors (like provisional ratings, minimum game requirements, or youth conversions, which I excluded here). The main takeaway for me is the power of AI to quickly prototype and derive insights from published data.
Feel free to plug the formulas yourself into your own Python script or spreadsheet to verify and play around with it!
For anyone interested in the Python code:
# The Python code for convert_fide_to_uscf_general and get_uscf_class would go here.
# (Paste the full script I provided earlier, starting from 'def convert_fide_to_uscf_general...')
# You might want to remove the 'print' statements inside the loop if the table format is directly copied above.
def convert_fide_to_uscf_general(fide_rating):
"""
Converts a FIDE rating to an estimated US Chess rating based on USCF 2024 specifications
for general players (excluding the youth formula).
Args:
fide_rating (int or float): The FIDE rating to convert.
Returns:
float: The estimated US Chess rating, rounded to the nearest whole number.
"""
if fide_rating <= 2000:
uscf_rating = -1073 + 1.5667 * fide_rating
else:
uscf_rating = 20 + 1.02 * fide_rating
return round(uscf_rating, 0) # Round to the nearest whole number as ratings are typically integers
# Define US Chess rating classes and their ranges
uscf_classes = {
"Senior Master": (2400, float('inf')),
"National Master": (2200, 2399),
"Expert": (2000, 2199),
"Class A": (1800, 1999),
"Class B": (1600, 1799),
"Class C": (1400, 1599),
"Class D": (1200, 1399),
"Class E": (1000, 1199),
"Class F": (800, 999),
"Class G": (600, 799),
"Class H": (400, 599),
"Class I": (200, 399),
"Class J": (100, 199),
"Below Class J (or Provisional)": (0, 99),
"Negative (Provisional)": (float('-inf'), -1)
}
def get_uscf_class(uscf_rating):
for uscf_class, (lower, upper) in uscf_classes.items():
if lower <= uscf_rating <= upper:
return uscf_class
return "N/A" # Should not happen with well-defined ranges
# The part below (with print statements) is for demonstration and can be used to generate the table:
# fide_ratings_to_test = [500, 800, 1000, 1200, 1400, 1600, 1800, 1900, 2000, 2001, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800]
# for fide_r in fide_ratings_to_test:
# uscf_r = convert_fide_to_uscf_general(fide_r)
# uscf_class = get_uscf_class(uscf_r)
# print(f"{fide_r:<10} {uscf_r:<15.0f} {uscf_class:<30}")
@swimmerBill
AI generated answer from my prompts:
This is an excellent Lichess forum post! It effectively communicates the key points and limitations of using AI for such conversions. Here are a few more things you could add to enhance it, keeping in mind the audience of a chess forum:
Original Post (as you provided it):
I ask Gemini AI to make a python script from the formula in the pdf and the categories that are in the wiki.
https://en.wikipedia.org/wiki/United_States_Chess_Federation
The results from the python script may not be accurate, but it gives you a good idea what an AI can do without their Canvas.
If you feed an AI enough prompts, it can generate code to your own liking. This is why the rating conversion I used cannot be considered official. All because of my prompt comments to AI. For me, the results of the python script fills my curiosity.
$ python3 fide2uscf_2024.py
General conversion "Example" of FIDE to USCF FIDE Rating USCF Rating USCF Class
800 180 Class J
1000 494 Class H
1200 807 Class F
1400 1120 Class E
1600 1434 Class C
1800 1747 Class B
1900 1904 Class A
2000 2060 Expert
2001 2061 Expert
2100 2162 Expert
2200 2264 National Master
2300 2366 National Master
2400 2468 Senior Master
2500 2570 Senior Master
2600 2672 Senior Master
2700 2774 Senior Master
2800 2876 Senior Master
--- Additional Boundary Checks --- FIDE Rating USCF Rating USCF Class
1999 2059 Expert
2000 2060 Expert
2001 2061 Expert
Is it accurate, I cannot prove it. Plug in a formula in a python script and then test it out.
Suggested Additions/Modifications to your Lichess Post:
You've already got a great foundation. Here's how you could build on it, especially to preempt common questions or add more clarity for a chess audience:
Emphasize "Official" and "Guideline": While you state it's not official, you can reinforce that the formulas themselves are from USCF's official documentation. The "not official" part stems from your specific "prompt comments" (e.g., excluding the youth formula, which USCF does use).
Briefly explain the "negative rating" curiosity: Since it came up in our discussion, it's good to address why a formula might produce a negative number, even if it's not practical.
Encourage independent verification (as you already do): Reiterate that people should verify with the source documents.
Consider adding the Python code itself: For those who are technically inclined, providing the full script directly in the post (or linking to a Pastebin/GitHub Gist) would be valuable. Lichess forums support code blocks.
A concluding thought on AI's utility: Reiterate the power of AI for prototyping and understanding.
Here's a revised version incorporating these ideas:
Revised Lichess Forum Post Suggestion:
"Hey everyone,
I've been playing around with Gemini AI to convert FIDE ratings to USCF ratings, using the official formulas from the US Chess Federation's Rating System Specifications (March 1, 2024, and corrections) and the USCF rating classes from Wikipedia.
The interesting part is how I could prompt the AI to generate a Python script to my specific liking. For example, I intentionally excluded the "youth" conversion formula that US Chess also provides, focusing only on the general adult conversion. This highlights that while the source formulas are official, the resulting script and its output aren't an 'official' USCF conversion tool, but rather a demonstration of what can be built with specific AI prompts.
For me, this little experiment fills my curiosity about how these different rating systems roughly align.
Here are some general conversion examples from the Python script:
$ python3 fide2uscf_2024.py
--- FIDE to USCF General Conversion Examples ---
FIDE Rating USCF Rating USCF Class
-------------------------------------------------------
800 180 Class J
1000 494 Class H
1200 807 Class F
1400 1120 Class E
1600 1434 Class C
1800 1747 Class B
1900 1904 Class A
2000 2060 Expert
2001 2061 Expert
2100 2162 Expert
2200 2264 National Master
2300 2366 National Master
2400 2468 Senior Master
2500 2570 Senior Master
2600 2672 Senior Master
2700 2774 Senior Master
2800 2876 Senior Master
--- Additional Boundary Checks ---
FIDE Rating USCF Rating USCF Class
-------------------------------------------------------
1999 2059 Expert
2000 2060 Expert
2001 2061 Expert
A quick note on negative ratings: You might notice a FIDE 500 converts to a negative USCF rating if you tried it with the full script. While the mathematical formula from US Chess can indeed yield negative results for very low FIDE ratings, in practice, USCF typically has rating floors (e.g., 100) for active players. So, you wouldn't typically see a negative rating on an official USCF profile; it's more about how the formula maps the lower end of the spectrum before a player establishes a stable rating.
Is this perfectly accurate? As mentioned, it's based on the official formulas as of March 2024, but the precise application by USCF for initial ratings can involve additional factors (like provisional ratings, minimum game requirements, or youth conversions, which I excluded here). The main takeaway for me is the power of AI to quickly prototype and derive insights from published data.
Feel free to plug the formulas yourself into your own Python script or spreadsheet to verify and play around with it!
For anyone interested in the Python code:
------------------------------------------------------------
# The Python code for convert_fide_to_uscf_general and get_uscf_class would go here.
# (Paste the full script I provided earlier, starting from 'def convert_fide_to_uscf_general...')
# You might want to remove the 'print' statements inside the loop if the table format is directly copied above.
def convert_fide_to_uscf_general(fide_rating):
"""
Converts a FIDE rating to an estimated US Chess rating based on USCF 2024 specifications
for general players (excluding the youth formula).
Args:
fide_rating (int or float): The FIDE rating to convert.
Returns:
float: The estimated US Chess rating, rounded to the nearest whole number.
"""
if fide_rating <= 2000:
uscf_rating = -1073 + 1.5667 * fide_rating
else:
uscf_rating = 20 + 1.02 * fide_rating
return round(uscf_rating, 0) # Round to the nearest whole number as ratings are typically integers
# Define US Chess rating classes and their ranges
uscf_classes = {
"Senior Master": (2400, float('inf')),
"National Master": (2200, 2399),
"Expert": (2000, 2199),
"Class A": (1800, 1999),
"Class B": (1600, 1799),
"Class C": (1400, 1599),
"Class D": (1200, 1399),
"Class E": (1000, 1199),
"Class F": (800, 999),
"Class G": (600, 799),
"Class H": (400, 599),
"Class I": (200, 399),
"Class J": (100, 199),
"Below Class J (or Provisional)": (0, 99),
"Negative (Provisional)": (float('-inf'), -1)
}
def get_uscf_class(uscf_rating):
for uscf_class, (lower, upper) in uscf_classes.items():
if lower <= uscf_rating <= upper:
return uscf_class
return "N/A" # Should not happen with well-defined ranges
# The part below (with print statements) is for demonstration and can be used to generate the table:
# fide_ratings_to_test = [500, 800, 1000, 1200, 1400, 1600, 1800, 1900, 2000, 2001, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800]
# for fide_r in fide_ratings_to_test:
# uscf_r = convert_fide_to_uscf_general(fide_r)
# uscf_class = get_uscf_class(uscf_r)
# print(f"{fide_r:<10} {uscf_r:<15.0f} {uscf_class:<30}")