Giter Site home page Giter Site logo

baoliay2008 / lccn_predictor Goto Github PK

View Code? Open in Web Editor NEW
631.0 631.0 22.0 945 KB

LeetCode Contest Rating Prediction

Home Page: https://lccn.lbao.site

License: MIT License

Python 62.06% CSS 1.25% HTML 10.80% JavaScript 25.41% Dockerfile 0.49%
beanie competitive-programming contest-programming daisyui elo fastapi fft leetcode mongodb prediciton pydantic python3 react

lccn_predictor's People

Contributors

baoliay2008 avatar imsachin49 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

lccn_predictor's Issues

Site is Still down.

The Site has been down again. When i try to open it, it gets stuck on loading the page

Add tab to show the current performance.

As we are displaying the new rating, old rating and delta, we can show the performance tab also. We can take the reference from Codeforces extensions. (From Current performance I mean, In that particular contest you performed like how much ratings)

We can see the Delta as well as its current performance.

image

Premature Rating Predictions on lccn.lbao.site

The results of leetcode contests typically require over 15 minutes to account for every participant. However, https://lccn.lbao.site/ consistently predicts ratings before all participants' results are collected. For instance, during today's bi-weekly contest (4/29/2023), the prediction occurred at 11:11:43 AM CDT, but the final participant count was only completed around 11:20 AM. Consequently, the last page of https://lccn.lbao.site/predicted/biweekly-contest-103 displays 12,498 participants, while the actual total was 17,137. This incomplete data leads to inaccurate rating predictions.

Username history is lost

When I click the username textbox
I used to get a popup of previous searched usernames

Today it didn't come up
image

Even after I searched for a username, it does not show up popup of recently searched usernames
image

It is good to show last 50 or so searched usernames, in a drop down with a scroll bar ( previously it used to show only 5 or so )
thank you for your efforts & time.

not able to start the front end by following read me instructions

I am not able to run the front end of the application. On running the command npm start, I get below error:

  Line 22:   'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 23:   'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 24:   'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 25:   'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 26:  'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 27:  'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 28:  'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 34:  'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 40:  'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 41:  'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 42:  'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 42:  'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 43:  'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 45:  'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 49:   'React' must be in scope when using JSX  react/react-in-jsx-scope
  Line 50:   'React' must be in scope when using JSX  react/react-in-jsx-scope

Use Cooley-Tukey FFT to accelerate prediction.

During the Elo rating system, calculating $f(x) = \sum \dfrac{1}{1 + 10^{x - R_i}}$ each time in linear complexity is actually a waste of time. By using FFT, we can calculate $f(x)$ for all $x \in \mathbb{Z}$ and $x \in [0, 8000]$.

You can check out here to learn how python make it done. In short, set $g(x)$ as the count of people with a rating $x$, and $h(x) = \dfrac{1}{1 + 10^{x}}$. By computing $g(x)$ and $h(x)\ \ (x \in [-8000,8000])$, we can use a FFT to convolve these two functions, thus calculates $f(x)$.

In Leetcode, I think we can multiply each rating by 10 and round them to integers. The lengths of arrays will be bigger than usual, but the complexity of this algorithm is still perfect. $O(10M \log (10M) + n \log M)$ is way smaller than $O(N^2 \log M)$.

Edge case in prediction algorithm

Today I gave LeetCode biweekly contest, I submitted the last question 30 seconds prior to the end, and the algorithm is most probably not considering my submission for the last question while predicting the delta and the combined rank.

image
image

Navigating to different page numbers is difficult

On the leetcode contests website, the URL is formatted like weekly-contest-367/ranking/<page_number>. This allows users to skip to a page number they want. On the prediction page, the URL is formatted like /weekly-contest-367/, which gives no page number skipping capabilities.

The only way to navigate through pages on the current site is with the buttons below the ratings, which only allows you to move two pages back or forward (Shown below).
image

This is very inconvenient, as there are hundreds of pages per contest. Could we change the URL routing system or add a button on the page navigator that allows the user to specify which page they would like to navigate to? I would be happy to work on this issue.

Improve Theme Selection Process

  • Currently, accessing available themes requires scrolling through the home page. To streamline this process, we can implement a scrollbar specifically for browsing available themes on the theme section only. This will offer users a more efficient and organized way to explore our selection of themes.

  • Additionally, I suggest enhancing the user experience by implementing the feature where clicking the theme button toggles the visibility of the theme list. This way, users can easily open and close the theme list without having to navigate away.

  • I've created a video demonstrating the issue. You can watch it here.

  • I'm interested in working on this issue and would like to contribute to the project. Could this issue be assigned to me? I believe I can effectively implement these improvements and ensure a better user experience. Looking forward to collaborating with the team on this.

    Thank you!

Feature Request: Custom Toast Message for Invalid Username

Description

Add a custom toast message when a user searches for an incorrect or non-participant LeetCode username for a contest.

  • We can show text "Rating for xyz not available for this contest."

  • It will just Improve the user experience.

  • A simple toast Error like this will work!

image

Select and deselect question on graph

Please add option to select or deselect a question in the graph such that it zooms in ontothe selected questions.
This way we look at the individual graphs, because usually the q4 has less AC's so we cant look at its graph in detail.
For example, If we deselect the q1,q2,q3 the contest graph will be focused on q4 and set the scale of the graph to give a more clarity.

Q3 and Q4 of "biweekly contest 97" are on backwards

Problem Description

Currently, Q1-Q4 are sorted by credit at first and then by question_id.

But for "biweekly contest 97", Q3's question_id is bigger than Q4's question_id

db.getCollection('Question').find(
    {"contest_name" : "biweekly-contest-97"}, 
    {title:1, title_slug:1, credit:1, question_id:1, _id:0}
).sort({credit:1, question_id:1})

↩️

/* 1 */
{
    "question_id" : 2639,
    "credit" : 3,
    "title" : "Separate the Digits in an Array",
    "title_slug" : "separate-the-digits-in-an-array"
}

/* 2 */
{
    "question_id" : 2640,
    "credit" : 4,
    "title" : "Maximum Number of Integers to Choose From a Range I",
    "title_slug" : "maximum-number-of-integers-to-choose-from-a-range-i"
}

/* 3 */
{
    "question_id" : 2641,
    "credit" : 5,
    "title" : "Disconnect Path in a Binary Matrix by at Most One Flip",
    "title_slug" : "disconnect-path-in-a-binary-matrix-by-at-most-one-flip"
}

/* 4 */
{
    "question_id" : 2673,
    "credit" : 5,
    "title" : "Maximize Win From Two Segments",
    "title_slug" : "maximize-win-from-two-segments"
}

So, Q3 and Q4 are misplaced.

Screen Shot 2023-02-05 at 00.53.13.png

Observed Time

Sun Feb 5 00:51:31 UTC+8, 2023

Possible Solution

  • 🤔️

failed to start mongodb

getting this error while executing step number 8 from this..
| ERROR | app.db.mongodb:start_async_mongodb:100 - Failed to start mongodb. error=Authentication failed., full error: {'ok': 0.0, 'errmsg': 'Authentication failed.', 'code': 18, 'codeName': 'AuthenticationFailed'}
pls help
`1-git clone [email protected]:baoliay2008/lccn_predictor.git
2-cd lccn_predictor

write your mongodb environment config

3-cp config.yaml.template config.yaml
4-vi config.yaml

5-python3.10 -m virtualenv venv/
6-source venv/bin/activate

7-pip3 install -r requirements.txt

8-python main.py
9-uvicorn api.entry:app --host 0.0.0.0 --port 55555`

Color in Rank Change (Delta) should be reversed

On the main website change of each rating (delta) has red color shade for positive rating and Green color for negative rating change.
This seems so off , an Improvement should be represented by Green color and decrement in rating with Red.

image

If this seems to be an Issue. Kindly assign this to me.

Plag checker

Every code that has been written by a user, together with the submission time, is stored in our database.
If this website provides a feature that allows us to determine how many times a specific code has been sent, or if that number surpasses a predetermined threshold, we may label it red to indicate that the code has been copied.

We can simply use Plagiarism detection techniques-

  1. Text-Based Plagiarism Detection - Some popular tools include Turnitin, Copyscape, and MOSS (Measure Of Software Similarity).
  2. Code Similarity Algorithms - Libraries like Simian and JPlag are examples.

ML Integration : Train machine learning models to identify code plagiarism. You can use techniques like natural language processing (NLP) and deep learning to analyze and compare code submissions.

biweekly-contest-116 ratings not up yet

biweekly-contest-116 ratings not up yet at https://lccn.lbao.site/predicted/biweekly-contest-116
it's been about 2 & 1/2 hours post contest

===

ideally,

1 https://lccn.lbao.site/ should show Biweekly Contest 116 after contest is completed

Currently shows below:
image

2 https://lccn.lbao.site/predicted/biweekly-contest-116
should show proper message of why there is delay
For example: "US Data not present. Check back after few hours", etc.

Currently shows below:
image

===

thanks for your hard work @baoliay2008

api 提供的时间问题?

https://lccn.lbao.site/api/v1/contest-records/user?contest_name=weekly-contest-338&username=tian-tang-6 为例

其中 finish_time, insert_time, predict_time 分别代表什么及对应时区是什么?

我大概试了一下时区没对的上

我是需要该竞赛对应的用户开始时间,用户结束时间的数据

[
    {
        "_id": "641fcb550455ebb2feb3c666",
        "contest_name": "weekly-contest-338",
        "contest_id": 843,
        "username": "tian-tang-6",
        "user_slug": "tian-tang-6",
        "country_code": "CN",
        "country_name": "**",
        "rank": 1,
        "score": 18,
        "finish_time": "2023-03-26T02:59:06",
        "data_region": "CN",
        "insert_time": "2023-03-26T04:34:28.298000",
        "attendedContestsCount": 116,
        "old_rating": 3065.1544669116574,
        "new_rating": 3174.170162632678,
        "delta_rating": 109.01569572102062,
        "predict_time": "2023-03-26T04:38:28.557000"
    }
]

Loading slow.

The website loads very late and slow, like it takes more than 5-10 minutes to load.

Can I know the underlying issue, if it is with only me or with every one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.