Random Forest Classifier - KFold CV Tunes Very Deep Trees --> Overfitting? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Moderator Election Q&A - Questionnaire 2019 Community Moderator Election ResultsHow to avoid overfitting in random forest?Minimum number of trees for Random Forest classifierPossible Reason for low Test accuracy and high AUCXGBoost Classification Probabilities higher than RF or SVM?Threshold Value for Random Forest ClassifierRandom Forest Classifier ProbabilitiesRandom Forest - Explanation ParameterEvaluating the performance of a random forest classifierUsing deep learning or random forestvery low recall value using random forest
An adverb for when you're not exaggerating
Do I really need to have a message in a novel to appeal to readers?
Antipodal Land Area Calculation
Why weren't discrete x86 CPUs ever used in game hardware?
Why can't I install Tomboy in Ubuntu Mate 19.04?
Should a wizard buy fine inks every time he want to copy spells into his spellbook?
What is the home of the drow in Flanaess?
What does it mean that physics no longer uses mechanical models to describe phenomena?
A term for a woman complaining about things/begging in a cute/childish way
Is CEO the "profession" with the most psychopaths?
Did any compiler fully use 80-bit floating point?
How to pronounce 伝統色
Significance of Cersei's obsession with elephants?
What is "gratricide"?
Why are my pictures showing a dark band on one edge?
What is the meaning of 'breadth' in breadth first search?
Flash light on something
Trademark violation for app?
Did Mueller's report provide an evidentiary basis for the claim of Russian govt election interference via social media?
What would you call this weird metallic apparatus that allows you to lift people?
How many morphisms from 1 to 1+1 can there be?
How can I prevent/balance waiting and turtling as a response to cooldown mechanics
Where is the Data Import Wizard Error Log
Can a Beast Master ranger change beast companions?
Random Forest Classifier - KFold CV Tunes Very Deep Trees --> Overfitting?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Moderator Election Q&A - Questionnaire
2019 Community Moderator Election ResultsHow to avoid overfitting in random forest?Minimum number of trees for Random Forest classifierPossible Reason for low Test accuracy and high AUCXGBoost Classification Probabilities higher than RF or SVM?Threshold Value for Random Forest ClassifierRandom Forest Classifier ProbabilitiesRandom Forest - Explanation ParameterEvaluating the performance of a random forest classifierUsing deep learning or random forestvery low recall value using random forest
$begingroup$
I'm tuning a random forest in python and am wondering if/why my model is overfit. The dataset is described below:
- 1700 Positive Cases / 54000 total cases ~ 3.2% (unbalanced)
- 50 Numerical Features,~450 label/hot encoded features (post data
reduction) - 10Fold CV using 85% of data, with 15% hold out for final test
- Classification Metrics = AUC or F1 (as data is imbalanced)
The results I get tend to suggest using very deep trees i.e depth 18 with no restriction on number of samples per split = 2(default). In this case, Train AUC was 99.9% , Max Test AUC was 84%. My scores are also almost monotonically increasing in max depth of trees. Given the results and how deep the trees are - I suspect the model is overfit? If this is the case then why would I not observe some sort of out of sample reduction in AUC as depth and min_samples_split typically constrain the random forest? Or have I overlooked anything in tuning?
My ranges in CV Grid Search are more or less:
- n_estimates : range(100,1000,by=100)
- max_features : sqrt(p),0.3,0.4,0.5
- max_depth : range(2,20,by=1)
- min_samples_split : range(2,50,by=1)
- class_weights : balanced,None
Thanks
machine-learning random-forest cross-validation unbalanced-classes
$endgroup$
bumped to the homepage by Community♦ 27 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
$begingroup$
I'm tuning a random forest in python and am wondering if/why my model is overfit. The dataset is described below:
- 1700 Positive Cases / 54000 total cases ~ 3.2% (unbalanced)
- 50 Numerical Features,~450 label/hot encoded features (post data
reduction) - 10Fold CV using 85% of data, with 15% hold out for final test
- Classification Metrics = AUC or F1 (as data is imbalanced)
The results I get tend to suggest using very deep trees i.e depth 18 with no restriction on number of samples per split = 2(default). In this case, Train AUC was 99.9% , Max Test AUC was 84%. My scores are also almost monotonically increasing in max depth of trees. Given the results and how deep the trees are - I suspect the model is overfit? If this is the case then why would I not observe some sort of out of sample reduction in AUC as depth and min_samples_split typically constrain the random forest? Or have I overlooked anything in tuning?
My ranges in CV Grid Search are more or less:
- n_estimates : range(100,1000,by=100)
- max_features : sqrt(p),0.3,0.4,0.5
- max_depth : range(2,20,by=1)
- min_samples_split : range(2,50,by=1)
- class_weights : balanced,None
Thanks
machine-learning random-forest cross-validation unbalanced-classes
$endgroup$
bumped to the homepage by Community♦ 27 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
$begingroup$
I'm tuning a random forest in python and am wondering if/why my model is overfit. The dataset is described below:
- 1700 Positive Cases / 54000 total cases ~ 3.2% (unbalanced)
- 50 Numerical Features,~450 label/hot encoded features (post data
reduction) - 10Fold CV using 85% of data, with 15% hold out for final test
- Classification Metrics = AUC or F1 (as data is imbalanced)
The results I get tend to suggest using very deep trees i.e depth 18 with no restriction on number of samples per split = 2(default). In this case, Train AUC was 99.9% , Max Test AUC was 84%. My scores are also almost monotonically increasing in max depth of trees. Given the results and how deep the trees are - I suspect the model is overfit? If this is the case then why would I not observe some sort of out of sample reduction in AUC as depth and min_samples_split typically constrain the random forest? Or have I overlooked anything in tuning?
My ranges in CV Grid Search are more or less:
- n_estimates : range(100,1000,by=100)
- max_features : sqrt(p),0.3,0.4,0.5
- max_depth : range(2,20,by=1)
- min_samples_split : range(2,50,by=1)
- class_weights : balanced,None
Thanks
machine-learning random-forest cross-validation unbalanced-classes
$endgroup$
I'm tuning a random forest in python and am wondering if/why my model is overfit. The dataset is described below:
- 1700 Positive Cases / 54000 total cases ~ 3.2% (unbalanced)
- 50 Numerical Features,~450 label/hot encoded features (post data
reduction) - 10Fold CV using 85% of data, with 15% hold out for final test
- Classification Metrics = AUC or F1 (as data is imbalanced)
The results I get tend to suggest using very deep trees i.e depth 18 with no restriction on number of samples per split = 2(default). In this case, Train AUC was 99.9% , Max Test AUC was 84%. My scores are also almost monotonically increasing in max depth of trees. Given the results and how deep the trees are - I suspect the model is overfit? If this is the case then why would I not observe some sort of out of sample reduction in AUC as depth and min_samples_split typically constrain the random forest? Or have I overlooked anything in tuning?
My ranges in CV Grid Search are more or less:
- n_estimates : range(100,1000,by=100)
- max_features : sqrt(p),0.3,0.4,0.5
- max_depth : range(2,20,by=1)
- min_samples_split : range(2,50,by=1)
- class_weights : balanced,None
Thanks
machine-learning random-forest cross-validation unbalanced-classes
machine-learning random-forest cross-validation unbalanced-classes
asked Jun 19 '18 at 22:32
NahyyzNahyyz
61
61
bumped to the homepage by Community♦ 27 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 27 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
A drop in performance between train and test datasets is a sign of overfitting.
Given the extremely unbalanced data, passing sample_weight argument to RandomForest().fit() to rebalance the classes should help.
$endgroup$
$begingroup$
I'm using class_weights = "balanced" to take into account imbalances in the dataset and penalize the cost function. It seems the two are related per stackoverflow.com/questions/32492550/…
$endgroup$
– Nahyyz
Jun 20 '18 at 3:15
add a comment |
$begingroup$
Random Forests don't overfit, the more depth you add, the more accuracy and less performance you will get.
$endgroup$
$begingroup$
Using deep trees is the problem, you have to increase the depth of your forest instead. Random Forests use very simple trees but thousands or 10th of thousands of them for that they can't overfit: Read the paper instead of downvoting.. projecteuclid.org/download/pdf_1/euclid.aos/1032181157
$endgroup$
– Eugen
Jun 20 '18 at 1:48
add a comment |
Your Answer
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%2f33398%2frandom-forest-classifier-kfold-cv-tunes-very-deep-trees-overfitting%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
A drop in performance between train and test datasets is a sign of overfitting.
Given the extremely unbalanced data, passing sample_weight argument to RandomForest().fit() to rebalance the classes should help.
$endgroup$
$begingroup$
I'm using class_weights = "balanced" to take into account imbalances in the dataset and penalize the cost function. It seems the two are related per stackoverflow.com/questions/32492550/…
$endgroup$
– Nahyyz
Jun 20 '18 at 3:15
add a comment |
$begingroup$
A drop in performance between train and test datasets is a sign of overfitting.
Given the extremely unbalanced data, passing sample_weight argument to RandomForest().fit() to rebalance the classes should help.
$endgroup$
$begingroup$
I'm using class_weights = "balanced" to take into account imbalances in the dataset and penalize the cost function. It seems the two are related per stackoverflow.com/questions/32492550/…
$endgroup$
– Nahyyz
Jun 20 '18 at 3:15
add a comment |
$begingroup$
A drop in performance between train and test datasets is a sign of overfitting.
Given the extremely unbalanced data, passing sample_weight argument to RandomForest().fit() to rebalance the classes should help.
$endgroup$
A drop in performance between train and test datasets is a sign of overfitting.
Given the extremely unbalanced data, passing sample_weight argument to RandomForest().fit() to rebalance the classes should help.
edited Jun 20 '18 at 14:12
answered Jun 20 '18 at 0:20
Brian SpieringBrian Spiering
4,2881129
4,2881129
$begingroup$
I'm using class_weights = "balanced" to take into account imbalances in the dataset and penalize the cost function. It seems the two are related per stackoverflow.com/questions/32492550/…
$endgroup$
– Nahyyz
Jun 20 '18 at 3:15
add a comment |
$begingroup$
I'm using class_weights = "balanced" to take into account imbalances in the dataset and penalize the cost function. It seems the two are related per stackoverflow.com/questions/32492550/…
$endgroup$
– Nahyyz
Jun 20 '18 at 3:15
$begingroup$
I'm using class_weights = "balanced" to take into account imbalances in the dataset and penalize the cost function. It seems the two are related per stackoverflow.com/questions/32492550/…
$endgroup$
– Nahyyz
Jun 20 '18 at 3:15
$begingroup$
I'm using class_weights = "balanced" to take into account imbalances in the dataset and penalize the cost function. It seems the two are related per stackoverflow.com/questions/32492550/…
$endgroup$
– Nahyyz
Jun 20 '18 at 3:15
add a comment |
$begingroup$
Random Forests don't overfit, the more depth you add, the more accuracy and less performance you will get.
$endgroup$
$begingroup$
Using deep trees is the problem, you have to increase the depth of your forest instead. Random Forests use very simple trees but thousands or 10th of thousands of them for that they can't overfit: Read the paper instead of downvoting.. projecteuclid.org/download/pdf_1/euclid.aos/1032181157
$endgroup$
– Eugen
Jun 20 '18 at 1:48
add a comment |
$begingroup$
Random Forests don't overfit, the more depth you add, the more accuracy and less performance you will get.
$endgroup$
$begingroup$
Using deep trees is the problem, you have to increase the depth of your forest instead. Random Forests use very simple trees but thousands or 10th of thousands of them for that they can't overfit: Read the paper instead of downvoting.. projecteuclid.org/download/pdf_1/euclid.aos/1032181157
$endgroup$
– Eugen
Jun 20 '18 at 1:48
add a comment |
$begingroup$
Random Forests don't overfit, the more depth you add, the more accuracy and less performance you will get.
$endgroup$
Random Forests don't overfit, the more depth you add, the more accuracy and less performance you will get.
answered Jun 20 '18 at 0:03
EugenEugen
795
795
$begingroup$
Using deep trees is the problem, you have to increase the depth of your forest instead. Random Forests use very simple trees but thousands or 10th of thousands of them for that they can't overfit: Read the paper instead of downvoting.. projecteuclid.org/download/pdf_1/euclid.aos/1032181157
$endgroup$
– Eugen
Jun 20 '18 at 1:48
add a comment |
$begingroup$
Using deep trees is the problem, you have to increase the depth of your forest instead. Random Forests use very simple trees but thousands or 10th of thousands of them for that they can't overfit: Read the paper instead of downvoting.. projecteuclid.org/download/pdf_1/euclid.aos/1032181157
$endgroup$
– Eugen
Jun 20 '18 at 1:48
$begingroup$
Using deep trees is the problem, you have to increase the depth of your forest instead. Random Forests use very simple trees but thousands or 10th of thousands of them for that they can't overfit: Read the paper instead of downvoting.. projecteuclid.org/download/pdf_1/euclid.aos/1032181157
$endgroup$
– Eugen
Jun 20 '18 at 1:48
$begingroup$
Using deep trees is the problem, you have to increase the depth of your forest instead. Random Forests use very simple trees but thousands or 10th of thousands of them for that they can't overfit: Read the paper instead of downvoting.. projecteuclid.org/download/pdf_1/euclid.aos/1032181157
$endgroup$
– Eugen
Jun 20 '18 at 1:48
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%2f33398%2frandom-forest-classifier-kfold-cv-tunes-very-deep-trees-overfitting%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