Hello Codeforces,
I wanted to share this little project I made using ML to predict your ratings after the next 5 contests and recommend a few problems based on the predicted rating to help you grow based on your Top 3 weakest topics.
The project uses a Random Forest Regressor to learn patterns of different users in different rating ranges using factors like
Acceptance Ratio
Rating Trend
Tag Diversity
TagWise Success
Application Link: cf-rating-predictor
GitHub Repo: CFpredictor
This is my first time implementing something ML-based so please forgive me if I did something wrong ;)
Thanks if you have any suggestions do let me know :)








How accurate was it on your test set?
Amazing!
Thought it was funny that 952D - I'm Feeling Lucky! got recommended.
Out of the 10 tasks it gave me, I've solved 3 of them previously. It should check if I've solved it before.
It shouldn't recommend problems which have
*special problemtag.It recommended for me these problems: 530A, 130E, 130C.
That's a nice thing you did! I'm happy you decided to try something like that, and thanks for open-sourcing your project. I did some AI projects at a student camp in Serbia, so I would just like to add some constructive criticism.
First, it would be nice if you explained your methodology somewhere. I looked at your repository, and luckily, your code was quite easy to follow.
I would like to discuss the methodology of you giving problem predictions. You find the user's weak topics (where a topic is a CF tag) and randomly select 10 problems from those topics. And weak topics are those with a low accepted/submissions ratio. I see three problems with such an approach.
Now, your methodology for rating prediction is kinda unclear. I am interested in how you collected the data you have. How good is your model at predicting? What is the error? What are the errors of some simple solutions, such as predicting the current rating, or the average/ median of the past 3 ratings?
Though I will note that rating prediction is always just for fun, so it doesn't matter how correct it is. I just think that such data and methodology explanation would make it better.
Again, I do think it is good that you made such a project. Do not take this comment as discouragement from making similar projects in the future. I just wanted to provide some constructive criticism.
Thanks for your comment I would answer all your queries.
1. Yes actually the main idea of the project was to build a rating predictor so I didnt put much effort on the recommender and obviously as you mentioned getting the accepted / submissions was the best metric to identify weak topics. I too thought of time spent per problem but as you said we cant get that information from the API.
2. Actually If you carefully see the Code I fetch only the last 1000 submissions per user so that I dont get too much old data for a user to reflect on their latest trends.
3.I would definitely research on this one and see what i can do about this too
As for the Rating Predictor I sample data of around 1500 users of almost all the rating ranges from 900 to 4000 (obviously there is less data available for rating ranges such as yours and above so the model can be a bit off for these ranges).
In train.py you can see I have trained the model on 80/20 part with the testing results as followed:
Evaluation on test set:
MAE : 33.06
RMSE: 65.88
Avg % Error: 1.70%
Again this data isnt uniform but for the whole set it may vary for different ranges.
Thanks again for your comment and I wont take this as a discouragement ofc it was just a fun project.
Hope It cleared your queries Thanks :)
Thank you for your answers! I am wondering how exactly you picked the 1500 users to sample? From what I understood, you did not just randomly choose people from CF users, as that would result in a lot of grays and just a few reds. But how did you ensure that all ratings are represented?
At first I took a little big ranges of delta around 400 but this resulted in a lot of biasness towards the upper limit of the rating range so I just checked the underrepresented rating ranges by narrowing down the delta to fetch users of all rating ranges.
The exact implementation of the API calling and all is in the scraper.py script in the repo where I manually changed the ratings ranges to ensure fair representation.
These are the analysis of the training data-
Rating Stats:
Min Rating: 948
Max Rating: 3849
Average Rating: 1893.72
So this was my way any suggestions are welcome. Thanks!
lol ur going to lose 28 points on the next 5 contests. actually sounds like an ai-curse/-bless
The way my graph is going it sure feels like the prediction would be true >﹏<
try your best to break this prediction
idea is cool however I tested it on some accounts and the prediction has always been negative delta. a bit too pessimistic i believe
After the last contest I dont know why its predicting negative delta mostly I have no idea myself why its happening :(
ok now I'm a bit frightened :(
Hey! the model may not be this accurate for accounts such as yours which have exponential growth because it predicts ratings based on multiple factors with number of contests, questions solved, tag diversity etc. so just relax hoping you become red after the next 5 contests :)
Thank you for your assurance but I don't really think red is possible for me in the mean time :(
I don't think so seeing your graph you would be red in the next 2-3 contests only trust yourself :)
You might've forgotten additional rating delta ToT
According to Carrot my performance is about 2200 — 2300 but hardly higher
For tourist, it says:
What happened? For my handle, the machine just says:
But when I tried other handles, it works, so it may not be the problem of my computer, but why?
Has anyone tried tourist yet? Because it pointed out that he's gonna get -260 in the next 5 contests