bad regression performance on imbalanced dataset The 2019 Stack Overflow Developer Survey Results Are In Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara 2019 Moderator Election Q&A - Questionnaire 2019 Community Moderator Election ResultsImprove a regression model and feature selectionOptimizing CNN networkHow does one fine-tune parameters and weights at the same time?Is removing poorly predicted data points a valid approach?Regression model performance with noisy dependent variableHow to model & predict user activity/presence time in a websiteDuring a regression task, I am getting low R^2 values, but elementwise difference between test set and prediction values is hugeClassifying on imbalanced datasetimbalanced dataset in text classififactionML regression poor performance

What is the padding with red substance inside of steak packaging?

What do I do when my TA workload is more than expected?

How did the crowd guess the pentatonic scale in Bobby McFerrin's presentation?

Identify 80s or 90s comics with ripped creatures (not dwarves)

Student Loan from years ago pops up and is taking my salary

"is" operation returns false even though two objects have same id

Nested ellipses in tikzpicture: Chomsky hierarchy

Why can I use a list index as an indexing variable in a for loop?

Didn't get enough time to take a Coding Test - what to do now?

Is 'stolen' appropriate word?

Can I visit the Trinity College (Cambridge) library and see some of their rare books

Can withdrawing asylum be illegal?

Did the new image of black hole confirm the general theory of relativity?

What can I do to 'burn' a journal?

What was the last x86 CPU that did not have the x87 floating-point unit built in?

Is every episode of "Where are my Pants?" identical?

Can the DM override racial traits?

Can each chord in a progression create its own key?

Why can't devices on different VLANs, but on the same subnet, communicate?

Would an alien lifeform be able to achieve space travel if lacking in vision?

Why doesn't shell automatically fix "useless use of cat"?

How to support a colleague who finds meetings extremely tiring?

How to make Illustrator type tool selection automatically adapt with text length

Accepted by European university, rejected by all American ones I applied to? Possible reasons?



bad regression performance on imbalanced dataset



The 2019 Stack Overflow Developer Survey Results Are In
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
2019 Moderator Election Q&A - Questionnaire
2019 Community Moderator Election ResultsImprove a regression model and feature selectionOptimizing CNN networkHow does one fine-tune parameters and weights at the same time?Is removing poorly predicted data points a valid approach?Regression model performance with noisy dependent variableHow to model & predict user activity/presence time in a websiteDuring a regression task, I am getting low R^2 values, but elementwise difference between test set and prediction values is hugeClassifying on imbalanced datasetimbalanced dataset in text classififactionML regression poor performance










1












$begingroup$


My current dataset has a shape of 5300 rows by 160 columns with a numeric target variable range=[641, 3001].
distribution of y_true

That’s no big dataset, but should in general be enough for decent regression quality. The columns are features from different consecutive process steps.



The project goal is to predict the numerical variable, with the satisfactory object to be very precise in the area up too 1200, which are 115 rows (2,1%). For target variables above 1200 the precision can be lower than in the area [640, 1200]. The target-variable is normally distributed with its mean ~1780 (25%: 1620, 75%: 1950) and variance of 267.5.



prediction vs actual:
prediction vs actual

residual plot:
residual-plot

My problem is (see plots above), that no matter what I try, the range of predictions (y_hat) is very limited and rather random (Training RMSE ~300, Test RMSE ~450), best test-mean-abs-error for y-values <= 1200 ~= 120.



I’ve already tried:



  • feature cleaning

  • process step wise addition of features to compare model performance/information gain

  • feature generation

  • derive new features (by business logic)

  • generate features

    • cross-product of features

    • differences to previous rows

    • differences between features

    • differences per feature to mean

    • durations based on timestamps


  • normalizing, scaling

  • log-transformation of target variable

  • Over- &/ Under-Sampling

  • various algorithms (using GridSearchCV for hyper-parameter tuning):

  • sklearn [SVR, RandomForrestRegressor, LinearRegression, Lasso, ElasticNet]

  • xgboost

  • (mxnet.gluon.Dense)

What would be your approach? Do you have any advice what technique I could try or what I've probably missed? Or if it's more likely that the training data simply doesn't fit well on the target variable?










share|improve this question











$endgroup$




bumped to the homepage by Community 41 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • $begingroup$
    There's something wrong. Almost all your y_hat is < 1500 (see your plot). But more than three quarters of your y_true are >1500. So how can the residuals be centred at 0? It should be that the majority of your predictions are smaller than true values. Aren't your plots inconsistent?
    $endgroup$
    – f.g.
    Oct 14 '18 at 9:44











  • $begingroup$
    For the model training I've used different loss functions. The loss function that resulted in the plot penailzes higher values, trying to be better in the lower value area.
    $endgroup$
    – Michael_S
    Nov 4 '18 at 15:27










  • $begingroup$
    Regardless... The plots are inconsistent. I don't think they can both be correct. If you y_hat and y_true relationship is as depicted in plot 1, then plot 2 shouldn't be possible.
    $endgroup$
    – f.g.
    Nov 5 '18 at 16:22















1












$begingroup$


My current dataset has a shape of 5300 rows by 160 columns with a numeric target variable range=[641, 3001].
distribution of y_true

That’s no big dataset, but should in general be enough for decent regression quality. The columns are features from different consecutive process steps.



The project goal is to predict the numerical variable, with the satisfactory object to be very precise in the area up too 1200, which are 115 rows (2,1%). For target variables above 1200 the precision can be lower than in the area [640, 1200]. The target-variable is normally distributed with its mean ~1780 (25%: 1620, 75%: 1950) and variance of 267.5.



prediction vs actual:
prediction vs actual

residual plot:
residual-plot

My problem is (see plots above), that no matter what I try, the range of predictions (y_hat) is very limited and rather random (Training RMSE ~300, Test RMSE ~450), best test-mean-abs-error for y-values <= 1200 ~= 120.



I’ve already tried:



  • feature cleaning

  • process step wise addition of features to compare model performance/information gain

  • feature generation

  • derive new features (by business logic)

  • generate features

    • cross-product of features

    • differences to previous rows

    • differences between features

    • differences per feature to mean

    • durations based on timestamps


  • normalizing, scaling

  • log-transformation of target variable

  • Over- &/ Under-Sampling

  • various algorithms (using GridSearchCV for hyper-parameter tuning):

  • sklearn [SVR, RandomForrestRegressor, LinearRegression, Lasso, ElasticNet]

  • xgboost

  • (mxnet.gluon.Dense)

What would be your approach? Do you have any advice what technique I could try or what I've probably missed? Or if it's more likely that the training data simply doesn't fit well on the target variable?










share|improve this question











$endgroup$




bumped to the homepage by Community 41 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • $begingroup$
    There's something wrong. Almost all your y_hat is < 1500 (see your plot). But more than three quarters of your y_true are >1500. So how can the residuals be centred at 0? It should be that the majority of your predictions are smaller than true values. Aren't your plots inconsistent?
    $endgroup$
    – f.g.
    Oct 14 '18 at 9:44











  • $begingroup$
    For the model training I've used different loss functions. The loss function that resulted in the plot penailzes higher values, trying to be better in the lower value area.
    $endgroup$
    – Michael_S
    Nov 4 '18 at 15:27










  • $begingroup$
    Regardless... The plots are inconsistent. I don't think they can both be correct. If you y_hat and y_true relationship is as depicted in plot 1, then plot 2 shouldn't be possible.
    $endgroup$
    – f.g.
    Nov 5 '18 at 16:22













1












1








1


1



$begingroup$


My current dataset has a shape of 5300 rows by 160 columns with a numeric target variable range=[641, 3001].
distribution of y_true

That’s no big dataset, but should in general be enough for decent regression quality. The columns are features from different consecutive process steps.



The project goal is to predict the numerical variable, with the satisfactory object to be very precise in the area up too 1200, which are 115 rows (2,1%). For target variables above 1200 the precision can be lower than in the area [640, 1200]. The target-variable is normally distributed with its mean ~1780 (25%: 1620, 75%: 1950) and variance of 267.5.



prediction vs actual:
prediction vs actual

residual plot:
residual-plot

My problem is (see plots above), that no matter what I try, the range of predictions (y_hat) is very limited and rather random (Training RMSE ~300, Test RMSE ~450), best test-mean-abs-error for y-values <= 1200 ~= 120.



I’ve already tried:



  • feature cleaning

  • process step wise addition of features to compare model performance/information gain

  • feature generation

  • derive new features (by business logic)

  • generate features

    • cross-product of features

    • differences to previous rows

    • differences between features

    • differences per feature to mean

    • durations based on timestamps


  • normalizing, scaling

  • log-transformation of target variable

  • Over- &/ Under-Sampling

  • various algorithms (using GridSearchCV for hyper-parameter tuning):

  • sklearn [SVR, RandomForrestRegressor, LinearRegression, Lasso, ElasticNet]

  • xgboost

  • (mxnet.gluon.Dense)

What would be your approach? Do you have any advice what technique I could try or what I've probably missed? Or if it's more likely that the training data simply doesn't fit well on the target variable?










share|improve this question











$endgroup$




My current dataset has a shape of 5300 rows by 160 columns with a numeric target variable range=[641, 3001].
distribution of y_true

That’s no big dataset, but should in general be enough for decent regression quality. The columns are features from different consecutive process steps.



The project goal is to predict the numerical variable, with the satisfactory object to be very precise in the area up too 1200, which are 115 rows (2,1%). For target variables above 1200 the precision can be lower than in the area [640, 1200]. The target-variable is normally distributed with its mean ~1780 (25%: 1620, 75%: 1950) and variance of 267.5.



prediction vs actual:
prediction vs actual

residual plot:
residual-plot

My problem is (see plots above), that no matter what I try, the range of predictions (y_hat) is very limited and rather random (Training RMSE ~300, Test RMSE ~450), best test-mean-abs-error for y-values <= 1200 ~= 120.



I’ve already tried:



  • feature cleaning

  • process step wise addition of features to compare model performance/information gain

  • feature generation

  • derive new features (by business logic)

  • generate features

    • cross-product of features

    • differences to previous rows

    • differences between features

    • differences per feature to mean

    • durations based on timestamps


  • normalizing, scaling

  • log-transformation of target variable

  • Over- &/ Under-Sampling

  • various algorithms (using GridSearchCV for hyper-parameter tuning):

  • sklearn [SVR, RandomForrestRegressor, LinearRegression, Lasso, ElasticNet]

  • xgboost

  • (mxnet.gluon.Dense)

What would be your approach? Do you have any advice what technique I could try or what I've probably missed? Or if it's more likely that the training data simply doesn't fit well on the target variable?







regression supervised-learning performance class-imbalance






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 5 '18 at 7:46







Michael_S

















asked Sep 5 '18 at 7:26









Michael_SMichael_S

112




112





bumped to the homepage by Community 41 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 41 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.













  • $begingroup$
    There's something wrong. Almost all your y_hat is < 1500 (see your plot). But more than three quarters of your y_true are >1500. So how can the residuals be centred at 0? It should be that the majority of your predictions are smaller than true values. Aren't your plots inconsistent?
    $endgroup$
    – f.g.
    Oct 14 '18 at 9:44











  • $begingroup$
    For the model training I've used different loss functions. The loss function that resulted in the plot penailzes higher values, trying to be better in the lower value area.
    $endgroup$
    – Michael_S
    Nov 4 '18 at 15:27










  • $begingroup$
    Regardless... The plots are inconsistent. I don't think they can both be correct. If you y_hat and y_true relationship is as depicted in plot 1, then plot 2 shouldn't be possible.
    $endgroup$
    – f.g.
    Nov 5 '18 at 16:22
















  • $begingroup$
    There's something wrong. Almost all your y_hat is < 1500 (see your plot). But more than three quarters of your y_true are >1500. So how can the residuals be centred at 0? It should be that the majority of your predictions are smaller than true values. Aren't your plots inconsistent?
    $endgroup$
    – f.g.
    Oct 14 '18 at 9:44











  • $begingroup$
    For the model training I've used different loss functions. The loss function that resulted in the plot penailzes higher values, trying to be better in the lower value area.
    $endgroup$
    – Michael_S
    Nov 4 '18 at 15:27










  • $begingroup$
    Regardless... The plots are inconsistent. I don't think they can both be correct. If you y_hat and y_true relationship is as depicted in plot 1, then plot 2 shouldn't be possible.
    $endgroup$
    – f.g.
    Nov 5 '18 at 16:22















$begingroup$
There's something wrong. Almost all your y_hat is < 1500 (see your plot). But more than three quarters of your y_true are >1500. So how can the residuals be centred at 0? It should be that the majority of your predictions are smaller than true values. Aren't your plots inconsistent?
$endgroup$
– f.g.
Oct 14 '18 at 9:44





$begingroup$
There's something wrong. Almost all your y_hat is < 1500 (see your plot). But more than three quarters of your y_true are >1500. So how can the residuals be centred at 0? It should be that the majority of your predictions are smaller than true values. Aren't your plots inconsistent?
$endgroup$
– f.g.
Oct 14 '18 at 9:44













$begingroup$
For the model training I've used different loss functions. The loss function that resulted in the plot penailzes higher values, trying to be better in the lower value area.
$endgroup$
– Michael_S
Nov 4 '18 at 15:27




$begingroup$
For the model training I've used different loss functions. The loss function that resulted in the plot penailzes higher values, trying to be better in the lower value area.
$endgroup$
– Michael_S
Nov 4 '18 at 15:27












$begingroup$
Regardless... The plots are inconsistent. I don't think they can both be correct. If you y_hat and y_true relationship is as depicted in plot 1, then plot 2 shouldn't be possible.
$endgroup$
– f.g.
Nov 5 '18 at 16:22




$begingroup$
Regardless... The plots are inconsistent. I don't think they can both be correct. If you y_hat and y_true relationship is as depicted in plot 1, then plot 2 shouldn't be possible.
$endgroup$
– f.g.
Nov 5 '18 at 16:22










1 Answer
1






active

oldest

votes


















0












$begingroup$

Your residuals are huge, which is not surprising, given that your data is very variable, a linear model may not be the best choice for this task. You could try transforming your data (log, sqrt) depending on the nature of your data to reduce the variability, but as I said, your variability is huge.



Alternatively you could try modeling the variance with a mixed model if it makes sense for your data, given some additional knowledge of some variable.



Other then that you could try a different algorithm for this task.






share|improve this answer









$endgroup$












  • $begingroup$
    I don't think you read his post. He tried your suggestions already.
    $endgroup$
    – f.g.
    Oct 14 '18 at 9:47











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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f37823%2fbad-regression-performance-on-imbalanced-dataset%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









0












$begingroup$

Your residuals are huge, which is not surprising, given that your data is very variable, a linear model may not be the best choice for this task. You could try transforming your data (log, sqrt) depending on the nature of your data to reduce the variability, but as I said, your variability is huge.



Alternatively you could try modeling the variance with a mixed model if it makes sense for your data, given some additional knowledge of some variable.



Other then that you could try a different algorithm for this task.






share|improve this answer









$endgroup$












  • $begingroup$
    I don't think you read his post. He tried your suggestions already.
    $endgroup$
    – f.g.
    Oct 14 '18 at 9:47















0












$begingroup$

Your residuals are huge, which is not surprising, given that your data is very variable, a linear model may not be the best choice for this task. You could try transforming your data (log, sqrt) depending on the nature of your data to reduce the variability, but as I said, your variability is huge.



Alternatively you could try modeling the variance with a mixed model if it makes sense for your data, given some additional knowledge of some variable.



Other then that you could try a different algorithm for this task.






share|improve this answer









$endgroup$












  • $begingroup$
    I don't think you read his post. He tried your suggestions already.
    $endgroup$
    – f.g.
    Oct 14 '18 at 9:47













0












0








0





$begingroup$

Your residuals are huge, which is not surprising, given that your data is very variable, a linear model may not be the best choice for this task. You could try transforming your data (log, sqrt) depending on the nature of your data to reduce the variability, but as I said, your variability is huge.



Alternatively you could try modeling the variance with a mixed model if it makes sense for your data, given some additional knowledge of some variable.



Other then that you could try a different algorithm for this task.






share|improve this answer









$endgroup$



Your residuals are huge, which is not surprising, given that your data is very variable, a linear model may not be the best choice for this task. You could try transforming your data (log, sqrt) depending on the nature of your data to reduce the variability, but as I said, your variability is huge.



Alternatively you could try modeling the variance with a mixed model if it makes sense for your data, given some additional knowledge of some variable.



Other then that you could try a different algorithm for this task.







share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 14 '18 at 8:49









user2974951user2974951

2355




2355











  • $begingroup$
    I don't think you read his post. He tried your suggestions already.
    $endgroup$
    – f.g.
    Oct 14 '18 at 9:47
















  • $begingroup$
    I don't think you read his post. He tried your suggestions already.
    $endgroup$
    – f.g.
    Oct 14 '18 at 9:47















$begingroup$
I don't think you read his post. He tried your suggestions already.
$endgroup$
– f.g.
Oct 14 '18 at 9:47




$begingroup$
I don't think you read his post. He tried your suggestions already.
$endgroup$
– f.g.
Oct 14 '18 at 9:47

















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f37823%2fbad-regression-performance-on-imbalanced-dataset%23new-answer', 'question_page');

);

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







Popular posts from this blog

Францішак Багушэвіч Змест Сям'я | Біяграфія | Творчасць | Мова Багушэвіча | Ацэнкі дзейнасці | Цікавыя факты | Спадчына | Выбраная бібліяграфія | Ушанаванне памяці | У філатэліі | Зноскі | Літаратура | Спасылкі | НавігацыяЛяхоўскі У. Рупіўся дзеля Бога і людзей: Жыццёвы шлях Лявона Вітан-Дубейкаўскага // Вольскі і Памідораў з песняй пра немца Адвакат, паэт, народны заступнік Ашмянскі веснікВ Минске появится площадь Богушевича и улица Сырокомли, Белорусская деловая газета, 19 июля 2001 г.Айцец беларускай нацыянальнай ідэі паўстаў у бронзе Сяргей Аляксандравіч Адашкевіч (1918, Мінск). 80-я гады. Бюст «Францішак Багушэвіч».Яўген Мікалаевіч Ціхановіч. «Партрэт Францішка Багушэвіча»Мікола Мікалаевіч Купава. «Партрэт зачынальніка новай беларускай літаратуры Францішка Багушэвіча»Уладзімір Іванавіч Мелехаў. На помніку «Змагарам за родную мову» Барэльеф «Францішак Багушэвіч»Памяць пра Багушэвіча на Віленшчыне Страчаная сталіца. Беларускія шыльды на вуліцах Вільні«Krynica». Ideologia i przywódcy białoruskiego katolicyzmuФранцішак БагушэвічТворы на knihi.comТворы Францішка Багушэвіча на bellib.byСодаль Уладзімір. Францішак Багушэвіч на Лідчыне;Луцкевіч Антон. Жыцьцё і творчасьць Фр. Багушэвіча ў успамінах ягоных сучасьнікаў // Запісы Беларускага Навуковага таварыства. Вільня, 1938. Сшытак 1. С. 16-34.Большая российская1188761710000 0000 5537 633Xn9209310021619551927869394п

Partai Komunis Tiongkok Daftar isi Kepemimpinan | Pranala luar | Referensi | Menu navigasidiperiksa1 perubahan tertundacpc.people.com.cnSitus resmiSurat kabar resmi"Why the Communist Party is alive, well and flourishing in China"0307-1235"Full text of Constitution of Communist Party of China"smengembangkannyas

ValueError: Expected n_neighbors <= n_samples, but n_samples = 1, n_neighbors = 6 (SMOTE) The 2019 Stack Overflow Developer Survey Results Are InCan SMOTE be applied over sequence of words (sentences)?ValueError when doing validation with random forestsSMOTE and multi class oversamplingLogic behind SMOTE-NC?ValueError: Error when checking target: expected dense_1 to have shape (7,) but got array with shape (1,)SmoteBoost: Should SMOTE be ran individually for each iteration/tree in the boosting?solving multi-class imbalance classification using smote and OSSUsing SMOTE for Synthetic Data generation to improve performance on unbalanced dataproblem of entry format for a simple model in KerasSVM SMOTE fit_resample() function runs forever with no result