[Python] Why is my R² score negative on a test set even though it’s near 1 on training?...

Discussão em 'Python' iniciado por Stack, Julho 7, 2025.

  1. Stack

    Stack Membro Participativo

    I'm working on a linear regression model to predict the average number of daily commits to a GitHub repository based on Stack Overflow activity metrics (like views, questions tagged, etc.).

    My dataset includes features like:

    monthly_views (number of times the tag is viewed)

    questions_asked (number of new questions tagged)

    questions_answered (number of answered questions)

    tag_followers (number of users following the tag)

    I split the dataset like this:

    X_train, X_test, y_train, y_test = train_test_split(X, y, shuffle=False, test_size=0.2)

    Continue reading...

Compartilhe esta Página