Multi class logistic regression performs bad on certain classes
$begingroup$
I'm trying to predict the day of the week for customers next visit from their previous visits (0 is they won't visit, 1 is Monday and so on). I have created some features like the visits days ratios, average duration between visits..etc.
My model performs really bad and i'm trying to diagnose it. I have used the classification report. How can interpret that some classes are completely misclassified?
precision recall f1-score support
0 0.45 0.98 0.62 26791
1 0.00 0.00 0.00 3771
2 0.00 0.00 0.00 2702
3 0.00 0.00 0.00 2744
4 0.00 0.00 0.00 2504
5 0.00 0.00 0.00 2735
6 0.35 0.06 0.10 9988
7 0.35 0.00 0.00 8765
avg / total 0.31 0.45 0.29 60000
logistic-regression performance
$endgroup$
add a comment |
$begingroup$
I'm trying to predict the day of the week for customers next visit from their previous visits (0 is they won't visit, 1 is Monday and so on). I have created some features like the visits days ratios, average duration between visits..etc.
My model performs really bad and i'm trying to diagnose it. I have used the classification report. How can interpret that some classes are completely misclassified?
precision recall f1-score support
0 0.45 0.98 0.62 26791
1 0.00 0.00 0.00 3771
2 0.00 0.00 0.00 2702
3 0.00 0.00 0.00 2744
4 0.00 0.00 0.00 2504
5 0.00 0.00 0.00 2735
6 0.35 0.06 0.10 9988
7 0.35 0.00 0.00 8765
avg / total 0.31 0.45 0.29 60000
logistic-regression performance
$endgroup$
$begingroup$
your features don't sound very predictive for the weekday of the visit... try predicting any visit (combining 1-7) and create additional features
$endgroup$
– oW_
Apr 24 '18 at 17:56
$begingroup$
If the goal is to predict the day not (any visit). How would i go from predicting any visit to predicting the day?
$endgroup$
– Iyad Al aqel
Apr 24 '18 at 18:28
add a comment |
$begingroup$
I'm trying to predict the day of the week for customers next visit from their previous visits (0 is they won't visit, 1 is Monday and so on). I have created some features like the visits days ratios, average duration between visits..etc.
My model performs really bad and i'm trying to diagnose it. I have used the classification report. How can interpret that some classes are completely misclassified?
precision recall f1-score support
0 0.45 0.98 0.62 26791
1 0.00 0.00 0.00 3771
2 0.00 0.00 0.00 2702
3 0.00 0.00 0.00 2744
4 0.00 0.00 0.00 2504
5 0.00 0.00 0.00 2735
6 0.35 0.06 0.10 9988
7 0.35 0.00 0.00 8765
avg / total 0.31 0.45 0.29 60000
logistic-regression performance
$endgroup$
I'm trying to predict the day of the week for customers next visit from their previous visits (0 is they won't visit, 1 is Monday and so on). I have created some features like the visits days ratios, average duration between visits..etc.
My model performs really bad and i'm trying to diagnose it. I have used the classification report. How can interpret that some classes are completely misclassified?
precision recall f1-score support
0 0.45 0.98 0.62 26791
1 0.00 0.00 0.00 3771
2 0.00 0.00 0.00 2702
3 0.00 0.00 0.00 2744
4 0.00 0.00 0.00 2504
5 0.00 0.00 0.00 2735
6 0.35 0.06 0.10 9988
7 0.35 0.00 0.00 8765
avg / total 0.31 0.45 0.29 60000
logistic-regression performance
logistic-regression performance
asked Apr 24 '18 at 17:50
Iyad Al aqelIyad Al aqel
1111
1111
$begingroup$
your features don't sound very predictive for the weekday of the visit... try predicting any visit (combining 1-7) and create additional features
$endgroup$
– oW_
Apr 24 '18 at 17:56
$begingroup$
If the goal is to predict the day not (any visit). How would i go from predicting any visit to predicting the day?
$endgroup$
– Iyad Al aqel
Apr 24 '18 at 18:28
add a comment |
$begingroup$
your features don't sound very predictive for the weekday of the visit... try predicting any visit (combining 1-7) and create additional features
$endgroup$
– oW_
Apr 24 '18 at 17:56
$begingroup$
If the goal is to predict the day not (any visit). How would i go from predicting any visit to predicting the day?
$endgroup$
– Iyad Al aqel
Apr 24 '18 at 18:28
$begingroup$
your features don't sound very predictive for the weekday of the visit... try predicting any visit (combining 1-7) and create additional features
$endgroup$
– oW_
Apr 24 '18 at 17:56
$begingroup$
your features don't sound very predictive for the weekday of the visit... try predicting any visit (combining 1-7) and create additional features
$endgroup$
– oW_
Apr 24 '18 at 17:56
$begingroup$
If the goal is to predict the day not (any visit). How would i go from predicting any visit to predicting the day?
$endgroup$
– Iyad Al aqel
Apr 24 '18 at 18:28
$begingroup$
If the goal is to predict the day not (any visit). How would i go from predicting any visit to predicting the day?
$endgroup$
– Iyad Al aqel
Apr 24 '18 at 18:28
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
You are not accounting for multiple visits within the same week. Say you have a customer visiting on a Monday and Wednesday of the same week, what will you have in your training set.
Multiple visits per week. I'm not sure if you have done some feature engineering like below along with visit ratios, frequency, and average duration per visit.
| customer_id | week | visit_day |
| 1 | 1 | 1 |
| 1 | 1 | 3 |
To account for non-visits, you need to have rows to mention 0 visits.
A couple of ways to look at the problem -
One, you have a customer and week level dataset and train a multinomial classifier.
Two, combine the results of eight binary classifiers, you can weight the proportions of the visit on a particular day to the probability of the predicted visit day.
Since you are doing extensive feature engineering here, I suggest a tree-based approach for your classifier(s).
New contributor
$endgroup$
add a comment |
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
});
}
});
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%2f30771%2fmulti-class-logistic-regression-performs-bad-on-certain-classes%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You are not accounting for multiple visits within the same week. Say you have a customer visiting on a Monday and Wednesday of the same week, what will you have in your training set.
Multiple visits per week. I'm not sure if you have done some feature engineering like below along with visit ratios, frequency, and average duration per visit.
| customer_id | week | visit_day |
| 1 | 1 | 1 |
| 1 | 1 | 3 |
To account for non-visits, you need to have rows to mention 0 visits.
A couple of ways to look at the problem -
One, you have a customer and week level dataset and train a multinomial classifier.
Two, combine the results of eight binary classifiers, you can weight the proportions of the visit on a particular day to the probability of the predicted visit day.
Since you are doing extensive feature engineering here, I suggest a tree-based approach for your classifier(s).
New contributor
$endgroup$
add a comment |
$begingroup$
You are not accounting for multiple visits within the same week. Say you have a customer visiting on a Monday and Wednesday of the same week, what will you have in your training set.
Multiple visits per week. I'm not sure if you have done some feature engineering like below along with visit ratios, frequency, and average duration per visit.
| customer_id | week | visit_day |
| 1 | 1 | 1 |
| 1 | 1 | 3 |
To account for non-visits, you need to have rows to mention 0 visits.
A couple of ways to look at the problem -
One, you have a customer and week level dataset and train a multinomial classifier.
Two, combine the results of eight binary classifiers, you can weight the proportions of the visit on a particular day to the probability of the predicted visit day.
Since you are doing extensive feature engineering here, I suggest a tree-based approach for your classifier(s).
New contributor
$endgroup$
add a comment |
$begingroup$
You are not accounting for multiple visits within the same week. Say you have a customer visiting on a Monday and Wednesday of the same week, what will you have in your training set.
Multiple visits per week. I'm not sure if you have done some feature engineering like below along with visit ratios, frequency, and average duration per visit.
| customer_id | week | visit_day |
| 1 | 1 | 1 |
| 1 | 1 | 3 |
To account for non-visits, you need to have rows to mention 0 visits.
A couple of ways to look at the problem -
One, you have a customer and week level dataset and train a multinomial classifier.
Two, combine the results of eight binary classifiers, you can weight the proportions of the visit on a particular day to the probability of the predicted visit day.
Since you are doing extensive feature engineering here, I suggest a tree-based approach for your classifier(s).
New contributor
$endgroup$
You are not accounting for multiple visits within the same week. Say you have a customer visiting on a Monday and Wednesday of the same week, what will you have in your training set.
Multiple visits per week. I'm not sure if you have done some feature engineering like below along with visit ratios, frequency, and average duration per visit.
| customer_id | week | visit_day |
| 1 | 1 | 1 |
| 1 | 1 | 3 |
To account for non-visits, you need to have rows to mention 0 visits.
A couple of ways to look at the problem -
One, you have a customer and week level dataset and train a multinomial classifier.
Two, combine the results of eight binary classifiers, you can weight the proportions of the visit on a particular day to the probability of the predicted visit day.
Since you are doing extensive feature engineering here, I suggest a tree-based approach for your classifier(s).
New contributor
New contributor
answered 18 hours ago
Next Door EngineerNext Door Engineer
1011
1011
New contributor
New contributor
add a comment |
add a comment |
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%2f30771%2fmulti-class-logistic-regression-performs-bad-on-certain-classes%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
$begingroup$
your features don't sound very predictive for the weekday of the visit... try predicting any visit (combining 1-7) and create additional features
$endgroup$
– oW_
Apr 24 '18 at 17:56
$begingroup$
If the goal is to predict the day not (any visit). How would i go from predicting any visit to predicting the day?
$endgroup$
– Iyad Al aqel
Apr 24 '18 at 18:28