How to structure a scikit-learn machine learning project for predicting sports outcomes?
$begingroup$
I'm a beginner in machine learning so please bear with what seem like uninformed questions.
I'm trying to create a model that can predict the outcomes of sporting events. My approach to training and testing the model is as follows:
- train the model on last X seasons worth of data
- for the current season, iterate through each game in chronological order (to prevent data leakage):
- predict the outcome of the game (so I can evaluate whether the model gets things right)
- feed that game's data back into the model via the
partial_fit
(https://scikit-learn.org/stable/glossary.html#term-partial-fit) method
If I wanted to train/test the model more, I was thinking I could select different seasons as the "test season", but in all situations, I would feed the game data for the tests season in chronological order.
As far as I can tell, the demands of this particular type of problem don't adhere to the typical "train-test" split that I see in all the "intro to machine learning" types of tutorials.
From what I've read, this is an online learning problem because the "test set" data needs to predicted to evaluate the model's accuracy, but it also needs to be fed back into the model so that the model can adjust to trends over the current season.
I'm a bit concerned, though, because there are only two regressors in the entire scikit learn library that support online-learning via the partial_fit
method (and they are both linear only models).
Could anyone provide feedback on whether I am approaching this problem properly? If so, is there a workflow I should use within scikit-learn that would allow me to use some more complex models (e.g, random forest or bayes) that would support this type of prediction problem? Thanks!
machine-learning scikit-learn online-learning sports
New contributor
$endgroup$
add a comment |
$begingroup$
I'm a beginner in machine learning so please bear with what seem like uninformed questions.
I'm trying to create a model that can predict the outcomes of sporting events. My approach to training and testing the model is as follows:
- train the model on last X seasons worth of data
- for the current season, iterate through each game in chronological order (to prevent data leakage):
- predict the outcome of the game (so I can evaluate whether the model gets things right)
- feed that game's data back into the model via the
partial_fit
(https://scikit-learn.org/stable/glossary.html#term-partial-fit) method
If I wanted to train/test the model more, I was thinking I could select different seasons as the "test season", but in all situations, I would feed the game data for the tests season in chronological order.
As far as I can tell, the demands of this particular type of problem don't adhere to the typical "train-test" split that I see in all the "intro to machine learning" types of tutorials.
From what I've read, this is an online learning problem because the "test set" data needs to predicted to evaluate the model's accuracy, but it also needs to be fed back into the model so that the model can adjust to trends over the current season.
I'm a bit concerned, though, because there are only two regressors in the entire scikit learn library that support online-learning via the partial_fit
method (and they are both linear only models).
Could anyone provide feedback on whether I am approaching this problem properly? If so, is there a workflow I should use within scikit-learn that would allow me to use some more complex models (e.g, random forest or bayes) that would support this type of prediction problem? Thanks!
machine-learning scikit-learn online-learning sports
New contributor
$endgroup$
add a comment |
$begingroup$
I'm a beginner in machine learning so please bear with what seem like uninformed questions.
I'm trying to create a model that can predict the outcomes of sporting events. My approach to training and testing the model is as follows:
- train the model on last X seasons worth of data
- for the current season, iterate through each game in chronological order (to prevent data leakage):
- predict the outcome of the game (so I can evaluate whether the model gets things right)
- feed that game's data back into the model via the
partial_fit
(https://scikit-learn.org/stable/glossary.html#term-partial-fit) method
If I wanted to train/test the model more, I was thinking I could select different seasons as the "test season", but in all situations, I would feed the game data for the tests season in chronological order.
As far as I can tell, the demands of this particular type of problem don't adhere to the typical "train-test" split that I see in all the "intro to machine learning" types of tutorials.
From what I've read, this is an online learning problem because the "test set" data needs to predicted to evaluate the model's accuracy, but it also needs to be fed back into the model so that the model can adjust to trends over the current season.
I'm a bit concerned, though, because there are only two regressors in the entire scikit learn library that support online-learning via the partial_fit
method (and they are both linear only models).
Could anyone provide feedback on whether I am approaching this problem properly? If so, is there a workflow I should use within scikit-learn that would allow me to use some more complex models (e.g, random forest or bayes) that would support this type of prediction problem? Thanks!
machine-learning scikit-learn online-learning sports
New contributor
$endgroup$
I'm a beginner in machine learning so please bear with what seem like uninformed questions.
I'm trying to create a model that can predict the outcomes of sporting events. My approach to training and testing the model is as follows:
- train the model on last X seasons worth of data
- for the current season, iterate through each game in chronological order (to prevent data leakage):
- predict the outcome of the game (so I can evaluate whether the model gets things right)
- feed that game's data back into the model via the
partial_fit
(https://scikit-learn.org/stable/glossary.html#term-partial-fit) method
If I wanted to train/test the model more, I was thinking I could select different seasons as the "test season", but in all situations, I would feed the game data for the tests season in chronological order.
As far as I can tell, the demands of this particular type of problem don't adhere to the typical "train-test" split that I see in all the "intro to machine learning" types of tutorials.
From what I've read, this is an online learning problem because the "test set" data needs to predicted to evaluate the model's accuracy, but it also needs to be fed back into the model so that the model can adjust to trends over the current season.
I'm a bit concerned, though, because there are only two regressors in the entire scikit learn library that support online-learning via the partial_fit
method (and they are both linear only models).
Could anyone provide feedback on whether I am approaching this problem properly? If so, is there a workflow I should use within scikit-learn that would allow me to use some more complex models (e.g, random forest or bayes) that would support this type of prediction problem? Thanks!
machine-learning scikit-learn online-learning sports
machine-learning scikit-learn online-learning sports
New contributor
New contributor
New contributor
asked 1 hour ago
Josh RebackJosh Reback
1
1
New contributor
New contributor
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "557"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Josh Reback is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f44353%2fhow-to-structure-a-scikit-learn-machine-learning-project-for-predicting-sports-o%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Josh Reback is a new contributor. Be nice, and check out our Code of Conduct.
Josh Reback is a new contributor. Be nice, and check out our Code of Conduct.
Josh Reback is a new contributor. Be nice, and check out our Code of Conduct.
Josh Reback is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Data Science Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f44353%2fhow-to-structure-a-scikit-learn-machine-learning-project-for-predicting-sports-o%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown