category
stringclasses
107 values
title
stringlengths
15
179
question_link
stringlengths
59
147
question_body
stringlengths
53
33.8k
answer_html
stringlengths
0
28.8k
__index_level_0__
int64
0
1.58k
boosting
Boosting algorithms only built with decision trees? why?
https://datascience.stackexchange.com/questions/101891/boosting-algorithms-only-built-with-decision-trees-why
<p>My understanding of boosting is just training models sequentially and learning from its previous mistakes.</p> <p>Can boosting algorithms be built with bunch of logistic regression? or logistic regression + decision trees?</p> <p>If yes, I would like to know some papers or books that covers this topic in-depth.</p>
<p>Boosting is not limited to tree-based models. Find some more information here:</p> <blockquote> <p>P. Bühlmann, T. Hothorn (2007), &quot;<a href="https://arxiv.org/pdf/0804.2752.pdf" rel="nofollow noreferrer">Boosting Algorithms: Regularization, Prediction and Model Fitting</a>&quot;, Statistical Science 22(4), p. 4...
362
boosting
Gradient boosting algorithm example
https://datascience.stackexchange.com/questions/9134/gradient-boosting-algorithm-example
<p>I'm trying to fully understand the gradient boosting (GB) method. I've read some wiki pages and papers about it, but it would really help me to see a full simple example carried out step-by-step. Can anyone provide one for me, or give me a link to such an example? Straightforward source code without tricky optimizat...
<p>I tried to construct the following simple example (mostly for my self-understanding) which I hope could be useful for you. If someone else notices any mistake please let me know. This is somehow based on the following nice explanation of gradient boosting <a href="http://blog.kaggle.com/2017/01/23/a-kaggle-master-ex...
363
boosting
Gradient boosting, where did the constant go?
https://datascience.stackexchange.com/questions/56041/gradient-boosting-where-did-the-constant-go
<p>In the very early papers on gradient boosting, the ensemble would include a constant and a sum of base learners i.e.</p> <p><span class="math-container">$F(X) = a_0 + \sum\limits_{i} a_i f_i(X)$</span></p> <p>The constant is fitted first (i.e. if the loss is squared error, the <span class="math-container">$a_0$</s...
364
boosting
On gradient boosting and types of encodings
https://datascience.stackexchange.com/questions/78092/on-gradient-boosting-and-types-of-encodings
<p>I am having a look at this <a href="https://github.com/lesteve/euroscipy-2019-scikit-learn-tutorial/blob/master/notebooks/02_basic_preprocessing.ipynb" rel="noreferrer">material</a> and I have found the following statement:</p> <blockquote> <p>For this class of models [Gradient Boosting Machine algorithms] [...] it ...
<p>This is actually a feature of tree-based models in general, not just gradient boosting trees.</p> <p>Not exactly a reference, but <a href="https://towardsdatascience.com/one-hot-encoding-is-making-your-tree-based-ensembles-worse-heres-why-d64b282b5769" rel="noreferrer">this Medium article</a> explains why ordinal en...
365
boosting
Why gradient boosting uses sampling without replacement?
https://datascience.stackexchange.com/questions/67674/why-gradient-boosting-uses-sampling-without-replacement
<p>In Random Forest each tree is built selecting a sample with replacement (bootstrap). And I assumed that Gradient Boosting's trees were selected with the same sampling technique. (@BenReiniger corrected me). <a href="https://catboost.ai/docs/concepts/algorithm-main-stages_bootstrap-options.html" rel="noreferrer">Her...
<p><strong>Why is Gradient Boosting sampling done without replacement?</strong></p> <p>Your first question seems to suggest that the base classifier will always have a subsampling mechanism but this is not necessarily true.</p> <p>Notice that in the Catboost documentation it is mentioned "Stochastic Gradient Boosting...
366
boosting
Averaging CNN perform worse than boosting
https://datascience.stackexchange.com/questions/31026/averaging-cnn-perform-worse-than-boosting
<p>I'm trying to solve <a href="https://www.kaggle.com/c/quora-question-pairs" rel="nofollow noreferrer">Quora Question Pairs</a> with model stacking.</p> <p>My first layers are:</p> <ul> <li>CNN trained to predict the same target as whole model should</li> <li>&quot;Magic features&quot; like question frequency in whol...
367
boosting
Purpose of gamma multiplier in gradient boosting
https://datascience.stackexchange.com/questions/60965/purpose-of-gamma-multiplier-in-gradient-boosting
<p>looking through the mathematics of gradient boosting on the relevant <a href="https://en.wikipedia.org/wiki/Gradient_boosting" rel="nofollow noreferrer">wikipedia page</a>, intuitively what is the purpose of the multiplier <span class="math-container">$\gamma_i$</span>?</p> <p><a href="https://i.sstatic.net/mWkBn.p...
368
boosting
Chossing between gradient boosting algorithms
https://datascience.stackexchange.com/questions/92717/chossing-between-gradient-boosting-algorithms
<p>I just stepped in machine learning competitions and it looks like most of the mid-sized dataset competitions are won by Gradient boosting based models. However I came accross case where <a href="https://lightgbm.readthedocs.io/en/latest/" rel="nofollow noreferrer">LightGBM</a>,<a href="https://catboost.ai/" rel="nof...
<p>I would say <code>Catboost</code> and <code>lightgbm</code> perform similarly and its purely a matter of choice. Some of my colleagues prefered <code>Catboost</code> when dataset has lots of categorical columns, but I rarely saw any advantage over <code>lightgbm</code>.</p> <p>there is a great article comparing <cod...
369
boosting
How to do boosting in model-ensembling?
https://datascience.stackexchange.com/questions/17147/how-to-do-boosting-in-model-ensembling
<p>Boosting is a sequential technique in which, the first algorithm is trained on the entire dataset and the subsequent algorithms are built by fitting the residuals of the first algorithm, thus giving higher weight to those observations that were poorly predicted by the previous model. Examples are adaboost and GBM, e...
<p>You can use any base learner for boosting (Adaboost requires sample weighting though). Keep in mind however that the original idea is to use weak learners with strong bias and reducing that bias through boosting.</p> <p>If it is a classification problem, usually logarithmic loss is used to calculating the residual/...
370
boosting
Can Boosting and Bagging be applied to heterogeneous algorithms?
https://datascience.stackexchange.com/questions/92847/can-boosting-and-bagging-be-applied-to-heterogeneous-algorithms
<p>Stacking can be achieved with heterogeneous algorithms such as RF, SVM and KNN. However, can such heterogeneously be achieved in Bagging or Boosting? For example, in Boosting, instead of using RF in all the iterations, could we use different algorithms?</p>
<p>The short answer is <strong>yes</strong>. Both boosting and bagging meta-algorithms do not assume specific weak learners, thus any learner can do, no matter if uses same algorithm or different one.</p> <p>The way the meta-algorithms are defined, they use the weak learners as <strong>black-box models, without referen...
371
boosting
Bagging vs Boosting, Bias vs Variance, Depth of trees
https://datascience.stackexchange.com/questions/61771/bagging-vs-boosting-bias-vs-variance-depth-of-trees
<p>I understand the main principle of bagging and boosting for classification and regression trees. My doubts are about the optimization of the hyperparameters, especially the depth of the trees</p> <p><strong>First question</strong>: why we are supposed to use weak learners for boosting (high bias) whereas we have t...
<blockquote> <p>why we are supposed to use weak learners for boosting (high bias) whereas we have to use deep trees for bagging (very high variance)</p> </blockquote> <p>Clearly it wouldn't make sense to bag a bunch of shallow trees/weak learners. The average of many bad predictions will still be pretty bad. For man...
372
boosting
How to interpret gradient descent in boosting ensembles?
https://datascience.stackexchange.com/questions/86492/how-to-interpret-gradient-descent-in-boosting-ensembles
<p>I struggle to grasp the role of gradient based optimization in boosting ensembles. As far as I understand boosting means combining a bunch of estimators (of the same types, usually decision trees) sequentially -- each subsequent one is learning from the errors of the previous ones (by upweighting the misclassified e...
373
boosting
Importance of feature selection for boosting methods
https://datascience.stackexchange.com/questions/11081/importance-of-feature-selection-for-boosting-methods
<p>While it is obviously clear that features can be ranked on basis of importance and many machine learning books give examples of random forests on how to do so, its not very clear on which occasions one should do so.</p> <p>In particular, for boosting methods, is there any reason why one should do feature selection....
<p>There is a difference between boosting and features selection. It is very important to understand that the original boosting algorithm or bagging algorithm have been modified and augmented with many features selection and/or data sampling ( over/ down/ synthetic) to improve the accuracy. Let us talk about the diff...
374
boosting
Gradient boosting Regression with zero-inflated outcome
https://datascience.stackexchange.com/questions/69949/gradient-boosting-regression-with-zero-inflated-outcome
<p>I am trying to tune a Regression gradient boosting model where my target variable is zero inflated (80% zero) and the rest of the values are distributed as positive and negative values (not necessary symmetrically). What are good practices when training a model like this? </p> <p>Any specific issues which I should ...
<p>I have been dealing with exactly the same situation but with even more rare non-zero events from marketing conversions. I have a few tips, but I don't feel I have really settled the best practices so I look forward to other people adding their observations! For the record I'm using Catboost. From what I have seen:</...
375
boosting
When does boosting overfit more than bagging?
https://datascience.stackexchange.com/questions/28299/when-does-boosting-overfit-more-than-bagging
<p>If we consider two conditions:</p> <ol> <li>Number of data is huge </li> <li>Number of data is low</li> </ol> <p>For what condition does boosting or bagging overfit more compared to the other one?</p>
<p>I read your question as: 'Is boosting more vulnerable to overfitting than bagging?'</p> <p>Firstly, you need to understand that <strong>bagging decreases variance</strong>, while <strong>boosting decreases bias</strong>. </p> <p>Also, to be noted that under-fitting means that the model has low variance and high bi...
376
boosting
Feature Selection before modeling with Boosting Trees
https://datascience.stackexchange.com/questions/84624/feature-selection-before-modeling-with-boosting-trees
<p>I have read in some papers that the subset of features chosen for a boosting tree algorithm will make a big difference on the performance<br />so I've been trying RFE, Boruta, Clustering variables, correlation, WOE &amp; IV and Chi-square</p> <p>Let's say I have a classification problem with over 40 variables, best ...
377
boosting
Does Gradient Boosting detect non-linear relationships?
https://datascience.stackexchange.com/questions/45371/does-gradient-boosting-detect-non-linear-relationships
<p>I wish to train some data using the <a href="https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingRegressor.html#sklearn-ensemble-gradientboostingregressor" rel="nofollow noreferrer">the Gradient Boosting Regressor of Scikit-Learn</a>.</p> <p>My questions are:</p> <p>1) Is the algorit...
<p>GB method works by minimizing a loss function and by splitting each node in a fashion that produces high pure leaves. there is no population formula being estimated and therefore you can estimate all types of relations between the target and the features.<br> However I wouldn't put in the model correlated variables ...
378
boosting
Gradient boosting vs logistic regression, for boolean features
https://datascience.stackexchange.com/questions/18081/gradient-boosting-vs-logistic-regression-for-boolean-features
<p>I have a binary classification task where all of my features are boolean (0 or 1). I have been considering two possible supervised learning algorithms:</p> <ul> <li>Logistic regression</li> <li>Gradient boosting with <a href="https://en.wikipedia.org/wiki/Decision_stump" rel="nofollow noreferrer">decision stumps</...
<p>You are right that the models are equivalent in terms of the functions they can express, so with infinite training data and a function where the input variables don't interact with each other in any way they will both probably asymptotically approach the underlying joint probability distribution. This would definit...
379
boosting
What is meant by Distributed for a gradient boosting library?
https://datascience.stackexchange.com/questions/41266/what-is-meant-by-distributed-for-a-gradient-boosting-library
<p>I am checking out XGBoost documentation and it's stated that XGBoost is an optimized <strong>distributed</strong> gradient boosting library. </p> <p>What is meant by distributed?</p> <p>Have a nice day</p>
<p>It means that it can be run on a <a href="https://en.wikipedia.org/wiki/Distributed_computing" rel="noreferrer">distributed system</a> (i.e. on multiple networked computers).</p> <p>From XGBoost's <a href="http://dmlc.cs.washington.edu/xgboost.html" rel="noreferrer">documentation</a>:</p> <blockquote> <p>The sam...
380
boosting
Is ensemble learning using different classifier combination another name for Boosting?
https://datascience.stackexchange.com/questions/33392/is-ensemble-learning-using-different-classifier-combination-another-name-for-boo
<p>For implementation I am following the <a href="https://www.mathworks.com/matlabcentral/fileexchange/63162-adaboost" rel="nofollow noreferrer">Matlab code for AdaBoost</a>. Based on my understanding, AdaBoost uses weak classifiers known as base classifiers and creates several instances of it. For example, a weak clas...
<p><em>Boosting</em> is a type of Ensemble Learning, but it is not the only one. Apart from stacking, <em>bagging</em> is also another type of Ensemble Learning.</p> <p><strong>Ensemble Learning</strong> is the combination of individual models together trying to obtain better predictive performance that could be obtai...
381
boosting
Are &quot;Gradient Boosting Machines (GBM)&quot; and GBDT exactly the same thing?
https://datascience.stackexchange.com/questions/81963/are-gradient-boosting-machines-gbm-and-gbdt-exactly-the-same-thing
<p>In the category of Gradient Boosting, I find some terms confusing.</p> <p>I'm aware that XGBoost includes some optimization in comparison to conventional Gradient Boosting.</p> <ul> <li><p>But are <strong>Gradient Boosting Machines (GBM)</strong> and <strong>GBDT</strong> the same thing? Are they just different name...
<p>Boosting is an ensemble technique where predictors are ensembled sequentially one after the other(<a href="https://www.youtube.com/watch?v=sRktKszFmSk&amp;t=2s&amp;ab_channel=AlexanderIhler" rel="noreferrer">youtube tutorial</a>. The term gradient of gradient boosting means that they are ensembled using the optimiza...
382
boosting
How does one decide when to use boosting over bagging algorithm?
https://datascience.stackexchange.com/questions/58269/how-does-one-decide-when-to-use-boosting-over-bagging-algorithm
<p>What kind of problem, circumstances and data makes it more suitable to apply boosting instead of bagging methods?</p>
<p>Bagging and boosting are two methods of implementing ensemble models.</p> <p>Bagging: each model is given the same inputs as every other and they all produce a model</p> <p>Boosting: the first model trains on the training data and then checks which observations it struggled most with, it passes this info to the ne...
383
boosting
Regression - How Random Forest and Gradient Boosting really works?
https://datascience.stackexchange.com/questions/28672/regression-how-random-forest-and-gradient-boosting-really-works
<p>I read a lot about random forest and gradient boosting, but I do not know how these two algorithms really work.</p> <p>For example, see the simple picture about basketball (picture 1) from <a href="https://www.r-bloggers.com/how-random-forests-improve-simple-regression-trees/" rel="nofollow noreferrer">this link</a...
<p><strong>Random Forest</strong>: Build a decision tree. </p> <ol> <li>Sample N examples from your population with replacement (meaning examples can appear multiple times).</li> <li>At each node do the following <ol> <li>Select m predictors from all predictors</li> <li>Split based on predictor that performs best v...
384
boosting
For what condition boosting work better than bagging in Ensemble Learner?
https://datascience.stackexchange.com/questions/28173/for-what-condition-boosting-work-better-than-bagging-in-ensemble-learner
<p>In boosting process we get a better accuracy for training data, but there is a lot of chance to over fit. For bagging ensemble method over fitting chance is lower than boosting. Why we use boosting and for what condition ??</p>
<p>Bagging (and features sampling) aim to reduce variance by providing low-correlated trees. Estimators can then be aggregated together to reduce variance. Reason is simple decision trees tend to quickly overfit in the bottom nodes. Bagging and features sampling only adress high-variance (overfitting) problems.</p> <p...
385
boosting
Forecasting using Boosting methods on Non-stationary Time Series data
https://datascience.stackexchange.com/questions/88441/forecasting-using-boosting-methods-on-non-stationary-time-series-data
<p>Theoretical Noob question -</p> <p>Can we use boosting methods to effectively forecast the future after being trained on a non-stationary time series? Or do you train/fit on the residual of the training set and then add seasonality/trend components while forecasting?</p> <p>Thanks in advance.</p>
<p>As @10xAI said, a tree-based gradient boosted approach may miss the mark for time series because it cannot forecast a growing trend. However, we can apply gradient boosting methodology to any algorithm. You can mess around with some code I wrote that is based on gradient boosting and decomposition: <a href="https:...
386
boosting
building a boosting model for repeated measurments
https://datascience.stackexchange.com/questions/94300/building-a-boosting-model-for-repeated-measurments
<p>I am working on an e-commerce data where the goal is to predict how will the user rate a movie from 1 to 5. We have a bunch of data from users but also from products. Some users have previously rated more than 10 (even 100s) and some less. Something like the following.</p> <p><a href="https://i.sstatic.net/vozKpl.pn...
387
boosting
training gradient boosting algorithm in python testing in Golang
https://datascience.stackexchange.com/questions/82636/training-gradient-boosting-algorithm-in-python-testing-in-golang
<p>What are the best strategy to train and save a gradient boosting algorithm, e.g. LightGBM or XGboost or Catboost in Python but load the model in GoLang and make prediction with Golang ?</p>
<p>There's actually a few libraries that handle the inference part well. <a href="https://github.com/dmitryikh/leaves" rel="nofollow noreferrer">https://github.com/dmitryikh/leaves</a> is probably the most common one and seems to fit your need.</p>
388
boosting
What does &quot;exaggeration&quot; mean in the context of Boosting?
https://datascience.stackexchange.com/questions/51646/what-does-exaggeration-mean-in-the-context-of-boosting
<p>I am learning <a href="https://youtu.be/t-XJ6AfqULg?t=583" rel="nofollow noreferrer">boosting</a>, the machine learning ensemble meta-algorithm. The professor is grouping 3 weak classifiers into an ensemble and said that before this <a href="https://youtu.be/t-XJ6AfqULg?t=584" rel="nofollow noreferrer">time point</a...
<p>Not sure, but "exaggeration" could be an other way to talk about "overfitting". </p> <p>Boosting are sequential model: each time you build a new tree, it will use the results of the precedent ones, and focus on residuals (where the precedent trees dont perform well). For this, the model exagerate the weights of the...
389
boosting
Small number of estimators in gradient boosting
https://datascience.stackexchange.com/questions/68635/small-number-of-estimators-in-gradient-boosting
<p>I am tuning a regression gradient boosting-based model to determine the appropriate hyperparameters using 4-folds cross validation. More specifically, I am using XGBoost and lightGBM for the models and Bayesian optimization algorithm for the hyperparameters search (hyperopt)</p> <p>One of the hyperparameter which is...
<p>First what is n_estimators:</p> <blockquote> <p>n_estimatorsinteger, optional (default=10) The number of trees in the forest.</p> </blockquote> <p>Gradient Boosting and Random Forest are decision trees ensembles, meaning that they fit several trees and then they average(ensemble) them. </p> <p>If you have n_...
390
boosting
Improving the performance of gradient boosting classifier
https://datascience.stackexchange.com/questions/126473/improving-the-performance-of-gradient-boosting-classifier
<p>I am training a gradient boosting classifier on an imbalanced data but the model is not performing very well. These are the things I have done to improve the model's performance.</p> <ol> <li>Balanced the data with SMOTE</li> <li>Added more variables</li> <li>combined features</li> <li>polynomial feature transformat...
<p>A little bit late, but you could try to do hyperparameter tuning on your gradient boosting classifier. For example, random search would be an efficient and effective choice (RandomizedSearchCV from sklearn in Python).</p> <p>If there are missing values in your dataset, you could impute them using multiple imputation...
391
boosting
Would you recommend feature normalization when using boosting trees?
https://datascience.stackexchange.com/questions/16225/would-you-recommend-feature-normalization-when-using-boosting-trees
<p>For some machine learning methods it is recommended to use feature normalization to use features that are on the same scale, especially for distance based methods like k-means or when using regularization. However, in my experience, boosting tree regression works less well when I use normalized features, for some st...
<p>Boosting trees is about building multiple decision trees. Decision tree doesn't require feature normalization, that's because the model only needs the absolute values for branching.</p> <p><a href="https://en.wikipedia.org/wiki/Decision_tree_learning#Decision_tree_advantages" rel="noreferrer">Wikipedia for decision...
392
boosting
What is the formula of gradient boosting trees model?
https://datascience.stackexchange.com/questions/108545/what-is-the-formula-of-gradient-boosting-trees-model
<p>I have been reading about gradient boosting trees (GBT) in some machine learning books and papers, but the references seem to only describe the training algorithms of GBT, but they do not describe the formula of a GBT model. So, I am not sure how a GBT model predict a new instance.</p> <p>What is the formula of a GB...
393
boosting
Does gradient boosting algorithm error always decrease faster and lower on training data?
https://datascience.stackexchange.com/questions/80530/does-gradient-boosting-algorithm-error-always-decrease-faster-and-lower-on-train
<p>I am building another XGBoost model and I'm really trying not to overfit the data. I split my data into train and test set and fit the model with early stopping based on the test-set error which results in the following loss plot:</p> <p><a href="https://i.sstatic.net/dLIDt.png" rel="nofollow noreferrer"><img src="h...
<p>You should worry about overfitting when the test error rate starts to go up again. Until then I would set it aside. Overfitting is rather about the number of parameters, e.g. When two models with the same performance have different number of parameters you would prefer the one with less parameters to preserve the ge...
394
boosting
How are regression trees fitted in gradient boosting for classification?
https://datascience.stackexchange.com/questions/102160/how-are-regression-trees-fitted-in-gradient-boosting-for-classification
<p>What I understood is that even gradient boosting for binary classification uses regression trees. The first value we calculate is constant = log(odds). For the rest of the trees, we try to fit regression trees on the residuals. But how do we fit the trees? Or how is the best splitting feature calculated? Is it the s...
395
boosting
Deep Learning vs gradient boosting: When to use what?
https://datascience.stackexchange.com/questions/2504/deep-learning-vs-gradient-boosting-when-to-use-what
<p>I have a big data problem with a large dataset (take for example 50 million rows and 200 columns). The dataset consists of about 100 numerical columns and 100 categorical columns and a response column that represents a binary class problem. The cardinality of each of the categorical columns is less than 50. </p> <p...
<p>Why restrict yourself to those two approaches? Because they're cool? I would always start with a simple linear classifier \ regressor. So in this case a Linear SVM or Logistic Regression, preferably with an algorithm implementation that can take advantage of sparsity due to the size of the data. It will take a long ...
396
boosting
Why is gradient boosting better than random forest for unbalanced data?
https://datascience.stackexchange.com/questions/115320/why-is-gradient-boosting-better-than-random-forest-for-unbalanced-data
<p>I've searched everywhere and still couldn't figure this one out. <a href="https://365datascience.com/career-advice/job-interview-tips/machine-learning-interview-questions-and-answers/#2:%7E:text=8.%20What%20are%20the%20bias%20and%20variance%20in%20a%20machine%20learning%20model%20and%20explain%20the%20bias-variance%...
<p>Boosting is the method of creating ensemble by increasing the importance of wrongly predicted instances in each iteration. RandomForest works by creating ensemble using Bootstrap Aggregating which involves 'sampling with replacement'. So, when you have imbalanced dataset random sampling is less likely to work than w...
397
boosting
Feature importance by random forest and boosting tree when two features are heavy correlated
https://datascience.stackexchange.com/questions/103898/feature-importance-by-random-forest-and-boosting-tree-when-two-features-are-heav
<p>I have asked this question <a href="https://stats.stackexchange.com/questions/550948/feature-importance-by-random-forest-and-boosting-tree-when-two-features-are-heav">here</a> but seems no one is interested in it.</p> <p>Here is my understanding, <code>pls correct me if there is any misunderstanding:</code></p> <p>T...
<blockquote> <p>Randomized sparse models: Random forest and boosting tree already have the feature (column) sampling, are two effects repeated?</p> </blockquote> <p>This question is unclear. Random Forest and GBDT are not randomized sparse models. Unless it is a nomenclature that I am not familiar about.</p> <p>In the ...
398
boosting
Solving the dual problem of boosting using column generation
https://datascience.stackexchange.com/questions/80584/solving-the-dual-problem-of-boosting-using-column-generation
<p>In our book there is boosting algorithm using column generation method (Dantzig-Wolfe decomposition) to solve the dual problem.<br /> So lets say we have want to solve the following primal linear problem based on hinge loss:<br /> <span class="math-container">$$\min_{w,\xi} \Sigma_{m=1}^Mw_m + C\Sigma_{i=1}^N\xi_i$$...
399
model interpretability
Interpreting Adaboost model results
https://datascience.stackexchange.com/questions/67843/interpreting-adaboost-model-results
<p>I'm trying to get a better grasp of model interpretability using many different kinds of models for a binary classification problem.</p> <p><em>Quick note: By interpretability in this case, what I mean is understanding which features have the largest effect on the target. (Not necessarily understanding how the mode...
400
model interpretability
reliability of human-level evaluation of the interpretability quality of a model
https://datascience.stackexchange.com/questions/92227/reliability-of-human-level-evaluation-of-the-interpretability-quality-of-a-model
<p>Christoph Molnar, in his book <a href="https://christophm.github.io/interpretable-ml-book/" rel="nofollow noreferrer">Interpretable Machine Learning</a>, writes that</p> <blockquote> <p>Human level evaluation (simple task) is a simplified application level evaluation. The difference is that these experiments are not...
<p>This is specifically for interpretability of outcomes, i.e. a task where non-expert humans outperform machines.</p> <p>There is a problem in collecting labels in machine learning, whereby labelling datasets is very expensive and time consuming (due to size of datasets &amp; cost of experts' time).</p> <p>So it's les...
401
model interpretability
How would you describe the trade-off between model interpretability and model prediction power in layman&#39;s terms?
https://datascience.stackexchange.com/questions/26511/how-would-you-describe-the-trade-off-between-model-interpretability-and-model-pr
<p>I know it depends on the data and question asked but imagine a scenario that for a given dataset you could either go for a fairly complex nonlinear model (hard to interpret though) giving you a better prediction power perhaps because the model may see the nonlinearities present in the data, or have a simple model (p...
<p>Interesting question. I think that you can illustrate this by thinking about different use cases. The one example I've heard that I like is around lending decisions for loan applications. That's an algorithm but, because of regulations, it can't be strictly "black box". The decision has to be, effectively, interpret...
402
model interpretability
An example of explainable, but not interpretable ML model
https://datascience.stackexchange.com/questions/99808/an-example-of-explainable-but-not-interpretable-ml-model
<p><a href="https://datascience.stackexchange.com/questions/70164/what-is-the-difference-between-explainable-and-interpretable-machine-learning">This post</a> attempts to explain the difference between explainability and interpretability of ML models. However, the explanation is somewhat unclear. Can somebody provide s...
<p>I am following the <a href="https://www.nature.com/articles/s42256-019-0048-x" rel="nofollow noreferrer">definitions by Cynthia Rudin</a> (and the <a href="https://statmodeling.stat.columbia.edu/2018/10/30/explainable-ml-versus-interpretable-ml/" rel="nofollow noreferrer">article by Keith O’Rourke</a> which is based...
403
model interpretability
Understand the interpretability of word embeddings
https://datascience.stackexchange.com/questions/118804/understand-the-interpretability-of-word-embeddings
<p>When reading the Tensorflow tutorial for <em>Word Embeddings</em>, I found two notes that confuse me:</p> <blockquote> <p>Note: Experimentally, you may be able to produce more interpretable embeddings by using a simpler model. Try deleting the Dense(16) layer, retraining the model, and visualizing the embeddings aga...
<p>&quot;Interpretable&quot; is not very precise in this context.</p> <p>In the case of deleting a dense layer, the embedding layer is more likely can learn the nontask dependent co-occurrences of words in the dataset.</p> <p>In the second case of adding more data, the embedding layer would learn more signals because t...
404
model interpretability
How are the confidence intervals of a model interpreted?
https://datascience.stackexchange.com/questions/109916/how-are-the-confidence-intervals-of-a-model-interpreted
<p>I am doing some work with R and after obtaining the confusion matrix I have obtained the following metrics corresponding to a logistic regression:</p> <pre><code>Accuracy : 0.7763 95% CI : (0.6662, 0.864) No Information Rate : 0.5395 P-Value [Acc &gt; NIR] : 1.629e-05 </c...
<p>The other answer is correct and summed it up nicely: we are 95% confident the accuracy value will fall somewhere between .666 and .864. It is a probability claim for how representative your number is.</p> <p>To your other question, it could mean a couple different things based on your data what the CI means. In gene...
405
model interpretability
Interpreting model
https://datascience.stackexchange.com/questions/114248/interpreting-model
<p>If I trained a model (say logistic regression) on train, test and validation. During interpretation which dataset (test or validation) should I base on for interpretation? If test and validation shows some difference in performance (say 10% where test is higher than validation in terms of accuracy) does it indicate ...
<p>Yes - that is probably overfitting.</p> <p>There is a chance that your distribution of test set, is different to your training or validation sets - but this is quite rare.</p> <p>Add some form of regularisation to to your model, which will flatten out the difference between your training and validation/testing sets....
406
model interpretability
&quot;Binary Encoding&quot; in &quot;Decision Tree&quot; / &quot;Random Forest&quot; Algorithms
https://datascience.stackexchange.com/questions/39094/binary-encoding-in-decision-tree-random-forest-algorithms
<p>Is it OK to use Binary Encoding in a dataset containing categorical columns with very high cardinalities? Some facts about my dataset:</p> <ul> <li>My dataset has ~170,000 rows</li> <li>One of the categoric variables has 1,700 unique values.</li> <li>Another one has 3,000 unique values.</li> <li>Note that it is not ...
<p>In general, it &quot;okay&quot; to apply to binary encode high cardinality datasets. In the sense of it will create numerical features that can be learned by a machine learning model.</p> <p>However there are often better options, such a label encoding, frequency encoding, target encoding, or embeddings.</p> <p>It i...
407
model interpretability
What model is recommended: I am using text features in a regression and want to interpret coefficients
https://datascience.stackexchange.com/questions/55019/what-model-is-recommended-i-am-using-text-features-in-a-regression-and-want-to
<p>I am using the text of comments on a forum to predict how many upvotes it will get. I want to be able to say, "Reviews with X, Y, Z words are more upvoted". So to do this, I want to use text features in a regression. In particular,</p> <p>What model should I use to maximize interpretability of coefficients? </p>
<p>I suppose you have a binary outcome (upvote: yes/no). In this case you could use simple linear (ols) regression (with lasso penalty). Each word (in a bag of words) is a „dummy“ here. If you look at the predicted coefficients, you can directly interpret them as „marginal effects“. Higher value means higher chance of ...
408
model interpretability
Decomposition and scaling and their effect on interpretability?
https://datascience.stackexchange.com/questions/128130/decomposition-and-scaling-and-their-effect-on-interpretability
<p>I have time series GDP growth rate data that I use as my Y and other X variables that I put into neural networks to make predictions. The two questions that I have are:</p> <ol> <li><p>When I decompose my GDP_growth variable I get a detrended variable that I model and make predictions of. If I have train and test da...
<p>This is a problem with forward forecasting and min-max scaling. Without digging into your dataset and model architecture, experiment with Robust, Standard, and logarithmic scaling and compare the results of your forward-forecasted data. From personal experience, I have seen significant improvements in performance by...
409
model interpretability
How to restructure my dataset for interpretability without losing performance?
https://datascience.stackexchange.com/questions/60466/how-to-restructure-my-dataset-for-interpretability-without-losing-performance
<p><strong>What I am doing:</strong></p> <p>I am predicting product ratings using boosted trees (XGBoost) with a dataset in this format:</p> <p><a href="https://i.sstatic.net/UssVN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/UssVN.png" alt="enter image description here" /></a></p> <p><strong>What I w...
<p>What may be happening is that your attribute predictors are weak predictors, they are noisy. Meaningful decision trees can't be made out of product attribute features by xgb. </p> <p>When you are adding name as a predictor, xgb finds some signal wrt your target variable - rating and thus you get a better score. So ...
410
model interpretability
How to interpret this Plot of Model Loss from a BiLSTM model?
https://datascience.stackexchange.com/questions/84394/how-to-interpret-this-plot-of-model-loss-from-a-bilstm-model
<p><a href="https://i.sstatic.net/GbG2Y.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/GbG2Y.png" alt="enter image description here" /></a></p> <p>Hi everyone,</p> <p>the above graph is produced by a BiLSTM model i just trained and tested. I can't seem to interpret it while it is very different from the...
<p>It looks like your train/val loss curves have a very large generalisation gap, which suggests that your model is overfitting. THis simply means it does a great job making predictions for the training set but a terrible one for your validation set. This appears to be the case even in early epochs, since valid loss ap...
411
model interpretability
Model selection by Interpreting p-value of anova function
https://datascience.stackexchange.com/questions/11248/model-selection-by-interpreting-p-value-of-anova-function
<p>I am trying to interpret the p-values for model selection. Here is a sample code taken from a book (<a href="http://www-bcf.usc.edu/~gareth/ISL/" rel="nofollow noreferrer">An Intro. to stat. Learning, page 290, by Gareth James et al.</a>)</p> <p><a href="https://i.sstatic.net/Qo8f7.png" rel="nofollow noreferrer"><i...
<p>To understand why, we should try to understand what we're doing here.</p> <p>Let's start with the first p-value: <code>2e-16</code>, what does that mean? This is the p-value under the null hypothesis that the linear model and the second polynomial model are statistically identical. We say that they are the same if ...
412
model interpretability
How to interpret predicted data from a keras model
https://datascience.stackexchange.com/questions/65421/how-to-interpret-predicted-data-from-a-keras-model
<p>I tried building a keras model to classify leaves from the leaf classification dataset on Kaggle. After I compiled and trained the model, I used it to predict the name of the leaves in the testing images, but all I got is an array of integers. How can I exactly interpret those numbers in order to get the names of th...
<p><strong>Simple do backwards transformation of y_pred.</strong></p> <p>You label-encoded Y_train (i.e. every number 1-99 essentially represents a leaf) you you need to do is find mapping from leaf number and leaf name (thats in LabelEncoder) you would proceede something like this</p> <blockquote> <pre><code>le=Labe...
413
model interpretability
How to interpret classification output - Predective model
https://datascience.stackexchange.com/questions/93117/how-to-interpret-classification-output-predective-model
<p>What is the significance of the macro avg? I'm not sure if this report signifies a good prediction by the model.</p> <p><a href="https://i.sstatic.net/YSnAU.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/YSnAU.png" alt="enter image description here" /></a></p>
<p>Your model is decent. Predictions are better than random chance.</p> <p>Macro average is a simple average of the performance measures (precision, recall etc) across all classes/labels.</p> <p>Micro average is a weighted average of the same , where the weights are based on the number of samples per class/label (suppo...
414
model interpretability
Interpreting Learning Curves of models
https://datascience.stackexchange.com/questions/117369/interpreting-learning-curves-of-models
<p>I need some help to understand if the models are overfitting and which of these we can consider &quot;the best&quot;. On the internet i only find simple examples with learning curves but in these cases i'm not sure to interpret them, so thank you in advance. It's a binary classification problem, the classes in the d...
<p>Difficult to tell without test data.</p> <p>Validation data is important to fine-tune the hyperparameters and improve your model.</p> <p>The final and most important result would be done with test data, i.e. unbiased data directly from the production environment.</p> <p>In addition to that, a model is more robust if...
415
model interpretability
How to interpret Shapley value plot for a model?
https://datascience.stackexchange.com/questions/65307/how-to-interpret-shapley-value-plot-for-a-model
<p>I was trying to use <code>Shapley value</code> approach for understanding the model predictions. I am trying this on a <code>Xgboost</code> model. My plot looks like as below</p> <p><a href="https://i.sstatic.net/lGb7V.png" rel="noreferrer"><img src="https://i.sstatic.net/lGb7V.png" alt="enter image description her...
<p><strong>1. 2.</strong> not always there are some blue points also.</p> <p><strong>3. 4. 5.</strong> yes</p> <p><strong>6.</strong> it depends on the shap plot you are using, on some them default is to surpress less important features and not even plot them.</p> <p><strong>7.</strong> They are discriminatory but n...
416
model interpretability
how to interpret predictions from model?
https://datascience.stackexchange.com/questions/37722/how-to-interpret-predictions-from-model
<p>I'm working on a multi-classification problem - <a href="https://www.kaggle.com/alxmamaev/flowers-recognition" rel="noreferrer">Recognizing flowers</a>. </p> <p>I trained the mode and I achieved accuracy of 0.99.</p> <p>To predict, I did:</p> <pre><code>a = model.predict(train[:6]) </code></pre> <p>output:</p> ...
<p>Alright so I rewrote some parts of your model such that it makes more sense for a classification problem. The first and most obvious reason your network was not working is due to the number of output nodes you selected. For a classification task the number of output nodes should be the same as the number of classes ...
417
model interpretability
Can numerical encoding really replace one-hot encoding?
https://datascience.stackexchange.com/questions/106673/can-numerical-encoding-really-replace-one-hot-encoding
<p>I am reading these articles (see below), which advocate the use of numerical encoding rather than one hot encoding for better interpretability of feature importance output from ensemble models. This goes against everything I have learnt - won't Python treat nominal features (like cities, car make/model) as ordinal i...
418
model interpretability
Interpretable models apart from Logistic Regression
https://datascience.stackexchange.com/questions/66066/interpretable-models-apart-from-logistic-regression
<p>I am wondering about other interpretable models apart from logistic regression.</p> <p>I am looking for models that can interpret the effect on the target variable by unit change in any feature variable.</p> <p>I was thinking tree-based models may help but I'm not sure.</p>
419
model interpretability
How to interpret RMSE to evaluate a regression model
https://datascience.stackexchange.com/questions/126593/how-to-interpret-rmse-to-evaluate-a-regression-model
<p>I am trying to evaluate a regression model (random forests); my understanding is that R^2 (coefficient of determination) is not a good measure of fitness since my dataset is non-linear. It looks like RMSE is the usual choice, but how do I know what is a 'good' value? Furthermore, it seems that RMSE is sensitive to t...
<p>You didn’t tell us about the use case or business domain for your problem. For example, if you were modeling battery energy consumption in noise canceling headphones, root mean squared error would be a natural loss function for your model; it falls out of the power equations.</p> <p>Figure out what matters to the b...
420
model interpretability
How can we assess the importance of the features even if we ended up applying PCA?
https://datascience.stackexchange.com/questions/67455/how-can-we-assess-the-importance-of-the-features-even-if-we-ended-up-applying-pc
<p>There are multiple techniques to analyze the feature importance (permutations, SHAP values, etc).</p> <p>It is essential that, in order to improve the interpretability of the model, we can somehow map the transformed features to the original ones. For example, when we assess the feature importance of encoded featur...
421
model interpretability
How to interpret the Mean squared error value in a regression model?
https://datascience.stackexchange.com/questions/90396/how-to-interpret-the-mean-squared-error-value-in-a-regression-model
<p>I'm working on a simple linear regression model to predict 'Label' based on 'feature'. The two variables seems to be highly correlate corr=0.99. After splitting the data sample for to training and testing sets. I make predictions and evaluate the model.</p> <pre><code>metrics.mean_squared_error(Label_test,Label_Pred...
<p>Whether you model is performing well or not depends on your business case, you might hive tiny RMSE or great looking score on whatever metric you are using, but it just not enough to solve the business problem, in that case the model is not performing well.</p> <ol> <li><p>MSE is just that Mean Squared Error</p> </l...
422
model interpretability
Interpreting a curve val_loss and loss in keras after training a model ; help
https://datascience.stackexchange.com/questions/111721/interpreting-a-curve-val-loss-and-loss-in-keras-after-training-a-model-help
<p>I need some help in Interpreting a curve val_loss and loss in keras after training a model</p> <p>These are the learning curves: <a href="https://i.sstatic.net/gdmMw.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gdmMw.png" alt="after 100 epoch of training " /></a></p>
<p>The training loss decreases while the validation loss increases, which is a clear sign of <strong>overfitting</strong>. This means that your model is too specific to the training dataset and do not generalize to the testing dataset. To solve that problem you can decrease the complexity of the model or add regulariza...
423
model interpretability
How do I interpret the output of linear regression model in R?
https://datascience.stackexchange.com/questions/77823/how-do-i-interpret-the-output-of-linear-regression-model-in-r
<p><a href="https://i.sstatic.net/mHbeh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/mHbeh.png" alt="enter image description here" /></a></p> <p>I have the following linear regression model and its analysis. There are a few errors, but I am not very sure about the errors. I have not succeeded in findi...
<p>So, the question is centred around the meaning behind a confidence interval.</p> <p>The main principle behind confidence intervals is the following:</p> <p>It is very costly and time-inefficient (if not impossible) to sample the whole population (i.e. all UCLA students from China and Hong Kong) and measure their cul...
424
model interpretability
How to interpret metrics of a model after scaling the data
https://datascience.stackexchange.com/questions/51323/how-to-interpret-metrics-of-a-model-after-scaling-the-data
<p>I have a GradientBoostingRegressor from <code>scikit-learn</code> which I trained. Afterwards, I obviously would like to know how good the model is. So, on a non-scaled dataset I would just use the <code>mean_squared_error</code> function from scikit and it would output a certain value that made sense (regarding the...
<p>I solved this issue with the help of @Franziska W. Thanks!</p> <p>I currently reverse transform y_test and y_pred and then calculate the metrics as following:</p> <pre><code># qt_y is a QuantileTransformer instance, gb is a GradientBoostingRegressor y_pred = gb.predict(X_test) inv_y_pred = qt_y.inverse_transform(y...
425
model interpretability
How do standardization and normalization impact the coefficients of linear models?
https://datascience.stackexchange.com/questions/80624/how-do-standardization-and-normalization-impact-the-coefficients-of-linear-model
<p>One benefit of creating a linear model is that you can look at the coefficients the model learns and interpret them. For example, you can see which features have the most predictive power and which do not.</p> <p>How, if at all, does feature interpretability change if we normalize (scale all features to 0-1) all our...
<p>When you have a linear regression (without any scaling, just plain numbers) and you have a model with one explanatory variable <span class="math-container">$x$</span> and coefficients <span class="math-container">$\beta_0=0$</span> and <span class="math-container">$\beta_1=1$</span>, then you essentially have a (est...
426
model interpretability
Methods to Interpret Physical Relationships Between Inputs and Output in a Trained ANN Model
https://datascience.stackexchange.com/questions/129910/methods-to-interpret-physical-relationships-between-inputs-and-output-in-a-train
<p>I have trained an artificial neural network (ANN) model using PyTorch that accurately predicts a scalar output based on three input tensors with the following shapes:</p> <p>Input 1: (3600, 3) Input 2: (10001, 3) Input 3: (1,) Output: (1,) float64</p> <p>The model architecture includes fully connected layers that ta...
427
model interpretability
What is the difference between explainable and interpretable machine learning?
https://datascience.stackexchange.com/questions/70164/what-is-the-difference-between-explainable-and-interpretable-machine-learning
<p><a href="https://statmodeling.stat.columbia.edu/2018/10/30/explainable-ml-versus-interpretable-ml/" rel="noreferrer">O’Rourke</a> says that explainable ML uses a black box model and explains it afterwards, whereas interpretable ML uses models that are no black boxes.</p> <p><a href="https://christophm.github.io/int...
<p>I found <a href="https://www.nature.com/articles/s42256-019-0048-x" rel="noreferrer">this article by Cynthia Rudin</a> which goes a bit more into the difference between the two terms that is in line with your source from O'Rourke.</p> <p>At the core it is about the time and mechanism of the explanation:</p> <p>A pri...
428
model interpretability
Interpreting a curve val_loss and loss in keras after training a model
https://datascience.stackexchange.com/questions/58506/interpreting-a-curve-val-loss-and-loss-in-keras-after-training-a-model
<p><a href="https://i.sstatic.net/W0JuB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/W0JuB.png" alt="mu"></a></p> <p><a href="https://i.sstatic.net/Osp3x.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Osp3x.png" alt="ee"></a></p> <p>I am having trouble understanding the curve <code>v...
<p>The loss curve shows what the model is trying to reduce. The training procedure tried to achieve the lowest loss possible. The loss is calculated using the number of training examples that the models gets right, versus the ones it gets wrong. Or how close it gets to the right answer for regression problems. </p> <p...
429
model interpretability
Feature engineering of timestamp for time series analysis
https://datascience.stackexchange.com/questions/107215/feature-engineering-of-timestamp-for-time-series-analysis
<p>Following a Tensorflow time series analysis <a href="https://www.tensorflow.org/tutorials/structured_data/time_series" rel="nofollow noreferrer">tutorial</a>, I came across a particular way of converting data timestamps into a time-of-day periodic signal, that could help the model interpret the data better than just...
<p><code>timestamp_s = date_time.map(pd.Timestamp.timestamp)</code> takes a column of timestamps and <a href="https://www.tensorflow.org/tutorials/structured_data/time_series#time" rel="nofollow noreferrer">converts them into seconds-since-1970</a> format (also called unix timestamp).</p> <p><code>day</code> is set to ...
430
model interpretability
How to perform bootstrap validation on CART decision tree?
https://datascience.stackexchange.com/questions/114309/how-to-perform-bootstrap-validation-on-cart-decision-tree
<p>I have a relatively small dataset n = 500 for which I am training a CART decision tree. My dataset has about 30 variables and the outcome has 3 classes. <a href="https://i.sstatic.net/LbmUp.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LbmUp.png" alt="enter image description here" /></a></p> <p>I am...
431
model interpretability
How to compare and interpret results of two neural networks models?
https://datascience.stackexchange.com/questions/80564/how-to-compare-and-interpret-results-of-two-neural-networks-models
<p>I made two models of neural networks(different architectures), the first one gave me as result:</p> <ul> <li><p>Training Loss: 0.4195</p> </li> <li><p>Training Acc: 0.8325</p> </li> <li><p>Training Recall: 0.7266</p> </li> <li><p>Validation Loss: 0.4331</p> </li> <li><p>Validation Acc: 0.8483</p> </li> <li><p>Valida...
432
model interpretability
Is multicollinarity a problem when interpreting SHAP values from an XGBoost model?
https://datascience.stackexchange.com/questions/111255/is-multicollinarity-a-problem-when-interpreting-shap-values-from-an-xgboost-mode
<p>I'm using an XGBoost model for multi-class classification and is looking at feature importance by using SHAP values. I'm curious if multicollinarity is a problem for the interpretation of the SHAP values? As far as I know, XGB is not affected by multicollinarity, so I assume SHAP won't be affected due to that?</p>
<p>Shapley values are designed to deal with this problem. You might want to have a look <a href="https://christophm.github.io/interpretable-ml-book/shapley.html" rel="nofollow noreferrer">at the literature</a>.</p> <p>They are based on the idea of a collaborative game, and the goal is to compute each player's contribut...
433
model interpretability
How to interpret the graph representing the fit provided by the ARIMA model?
https://datascience.stackexchange.com/questions/53222/how-to-interpret-the-graph-representing-the-fit-provided-by-the-arima-model
<p>I'm following this tutorial <a href="https://www.datascience.com/blog/introduction-to-forecasting-with-arima-in-r-learn-data-science-tutorials" rel="nofollow noreferrer">here</a> to build an ARIMA model in R. </p> <p>I've done a Forecast using a fitted model in R. I specified the forecast horizon h periods ahead fo...
434
model interpretability
How can I know how to interpret the output coefficients (`coefs_`) from the model sklearn.svm.LinearSVC()?
https://datascience.stackexchange.com/questions/17970/how-can-i-know-how-to-interpret-the-output-coefficients-coefs-from-the-mode
<p>I'm following <em>Introduction to Machine Learning with Python: A Guide for Data Scientists</em> by Andreas C. Müller and Sarah Guido, and in Chapter 2 a demonstration of applying <code>LinearSVC()</code> is given. The result of classifying three blobs is shown in this screenshot:</p> <p><a href="https://i.sstatic...
<p>Here's one (admittedly hard) way.</p> <p>If you really want to understand the low-level details, you can always work through the source code. For example, we can see that the <code>LinearSVC</code> <code>fit</code> method <a href="https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/svm/classes.py#L210"...
435
model interpretability
How to interpret continuous variables in a decision tree model?
https://datascience.stackexchange.com/questions/23247/how-to-interpret-continuous-variables-in-a-decision-tree-model
<p>After fitting a decision tree with some continuous variable, how do I interpret the effect that variable has on the target?</p> <p>For example I'm predicting target Y. From sklearn random forest or Xgboost I can find out that the feature X is important. How do I determine if feature X's correlation to Y is positive...
<p>Calculate the Pearson correlation coefficient or the Spearman rank <a href="https://databasecamp.de/en/statistics/correlation-and-causation" rel="nofollow noreferrer">correlation</a> coefficient between feature X and target Y. The <a href="https://databasecamp.de/en/statistics/correlation-and-causation" rel="nofollo...
436
model interpretability
Beginner level: how to interpret LIME and classification result
https://datascience.stackexchange.com/questions/93687/beginner-level-how-to-interpret-lime-and-classification-result
<p>I am new to the concept of model interpretability using LIME method. I am following the tutorial <a href="https://www.mathworks.com/help/deeplearning/ug/investigate-spectrogram-classifications-using-lime.html" rel="nofollow noreferrer">LIME for spectrogram classification</a>. I am finding hard to understand the colo...
437
model interpretability
correlated variables &amp; model performance: optimal trade-off
https://datascience.stackexchange.com/questions/93899/correlated-variables-model-performance-optimal-trade-off
<p>on the back of this topic (<a href="https://datascience.stackexchange.com/questions/36404/when-to-remove-correlated-variables">When to remove correlated variables</a>) I feel a follow up is needed, with the focus here being on raw performance and risk of distribution shift.</p> <p>assuming little to medium interpret...
438
model interpretability
For a regression model, can you transform all your features to linear to make a better prediction?
https://datascience.stackexchange.com/questions/56874/for-a-regression-model-can-you-transform-all-your-features-to-linear-to-make-a
<p>I was thinking. Would it be a good approach to check your features one by one (assuming you have a manageable amount of them) and see the relationship they have with your target variable, if they have a non linear relationship then transform each of those features using their appropriate function for each case to m...
<p>Your idea is good, but you are not the first with this idea.</p> <p>You can use <a href="https://stat.ethz.ch/R-manual/R-devel/library/mgcv/html/gam.html" rel="nofollow noreferrer">Generalized Additive Models (GAM)</a> with regression splines to check and/or add non-linearity in a linear regression setup. There is ...
439
model interpretability
When is scaling and centering important?
https://datascience.stackexchange.com/questions/112340/when-is-scaling-and-centering-important
<p>There are some models such as PCA or SVM where scaling and centering of training data is essential.</p> <p>There are some models, mostly tree-based where scaling and centering is not required at all.</p> <p>I don't think some of the linear models like linear or logistic regression need it. But I could be wrong. What...
440
model interpretability
Is there an R package for Locally Interpretable Model Agnostic Explanations?
https://datascience.stackexchange.com/questions/17791/is-there-an-r-package-for-locally-interpretable-model-agnostic-explanations
<p>One of the researchers, Marco Ribeiro, who developed this method of explaining how black box models make their decisions has developed a Python implementation of the algorithm available through Github, but has anyone developed a R package? If so, can you report on using it?</p>
<p>I think you're talking about the <code>lime</code> Python package. No, there is <strong>no</strong> R port for the package. The implementation for the localized model requires enhancements to the existing machine-learning code (explained in the paper), a new implementation for R would be very time consuming.</p> <p>...
441
model interpretability
How to interpret importance of random forest model, Mean Decrease Accuracy and Mean Decrease Gini?
https://datascience.stackexchange.com/questions/110184/how-to-interpret-importance-of-random-forest-model-mean-decrease-accuracy-and-m
<p><a href="https://i.sstatic.net/eeSVj.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/eeSVj.png" alt="Importance" /></a></p> <p>A random forest model outputs the following importance values. How do I interpert them for feature selection? If it's the mean decreased accuracy does that mean that by removi...
<p>I'm not sure which software you're using so I don't know the details, but generally it's simple: the highest values indicate the features which contribute the most to the target.</p> <p>In particular, the mean decrease in accuracy shows how much the accuracy decreases <em>when removing this feature</em>. Thus again ...
442
model interpretability
Adding recommendations to the output of a classification model
https://datascience.stackexchange.com/questions/41259/adding-recommendations-to-the-output-of-a-classification-model
<p>I have built a binary classification model using:</p> <ul> <li>logit</li> <li>decision trees</li> <li>random forest</li> <li>bagging classifier</li> <li>gradientboost</li> <li>xgboost</li> <li>adaboost</li> </ul> <p>I have evaluated the above models and chose xgboost based on training/test and validation metrics (...
<p>Decision tress can be plotted in python, this is the most visualizing machine learning algorithm, you can see a link here: <a href="https://medium.com/@rnbrown/creating-and-visualizing-decision-trees-with-python-f8e8fa394176" rel="nofollow noreferrer">https://medium.com/@rnbrown/creating-and-visualizing-decision-tre...
443
model interpretability
Should normalization be applied on interaction feature
https://datascience.stackexchange.com/questions/130734/should-normalization-be-applied-on-interaction-feature
<p>I am working with interaction features in my machine learning model, where I create new features by multiplying a numeric variable with an encoded categorical feature. My question is:</p> <p>Should normalization be applied to these interaction terms? If yes, so should it be applied <strong>before interaction feature...
<p>What is really important, you should use same scale factors for the data on which you <strong>train your model</strong> and data on which you <strong>make predictions</strong> by this trained model.</p> <p>If these two scalings are consistent, it's no big deal if some of your data not lay exactly in [0, 1] range or ...
444
model interpretability
Feature reduction convenience
https://datascience.stackexchange.com/questions/17244/feature-reduction-convenience
<p>In the field of machine learning, I'm wondering about the interest of applying feature selection techniques.</p> <p>I mean, I often read articles or lectures speaking about how to reduce the number of feature (dimensionality reduction, PCA), how to select the best features (feature selection etc).</p> <p>I'm not s...
<p>Feature Selection (FS) methods are focused on specializing the data as much as possible to find accurate models for your problem. Some of the main issues that drive the need for FS are:</p> <ul> <li>Curse of dimensionality: Most algorithms suffer to grasp relevant chacteristics of data for a specific prediction tas...
445
model interpretability
How to tell a boosting model that 2 features are related and should not be interpreted stand-alone?
https://datascience.stackexchange.com/questions/61125/how-to-tell-a-boosting-model-that-2-features-are-related-and-should-not-be-inter
<p>I am using XGBoost for a machine learning model that learns from tabular data.</p> <p>XGBoost uses boosting method on decision trees. When I look at the decision-making logic of decision trees, I notice the logic is based on 1 feature at one time. In real life, certain multiple features are related to each other. ...
<p>I am going to talk about some ways you could do it later but first I want to talk about whether you should!</p> <p>If the relation that you describe exists XGB will be able to learn and detect it! There is no real benefit in "hard-coding" a rule into the algorithm, it won't speed up the training, it won't benefit a...
446
model interpretability
When should I NOT scale features
https://datascience.stackexchange.com/questions/64302/when-should-i-not-scale-features
<p>Feature scaling can be crucially necessary when using distance-, variance- or gradient-based methods (KNN, PCA, neural networks...), because depending on the case, it can improve the quality of results or the computational effort.</p> <p>In some cases (tree-based models in particular), scaling has no impact on the ...
<p>Scaling often assumes you know the <strong>min/max</strong> or <strong>mean/standard deviation</strong>, so directly scaling features where these information is not really known, can be a bad idea.</p> <p>For example, <strong>clipped signals</strong> may hide this info, so scaling them can have a negative result be...
447
model interpretability
Can I include a quotient as dependent variable and independent variables with same denominator in a linear model? How do we interpret such models?
https://datascience.stackexchange.com/questions/107980/can-i-include-a-quotient-as-dependent-variable-and-independent-variables-with-sa
<p>I want to create a model in a food processing plant where my dependent variable is Electricity (KWhr) consumption per kg. Plant produce different food items with varying electricity consumption. I'm interested in knowing the impact of the proportion of each food item on consumption per kg. so my model is</p> <pre><c...
<p>Energy is additive but energy-per-kg is not.</p> <p>Assume</p> <p><span class="math-container">$p_i$</span> be the energy consumption rate for food <span class="math-container">$i$</span> (<span class="math-container">$\mathrm{kJs^{-1}} = \mathrm{kW}$</span>),</p> <p><span class="math-container">$t_i$</span> be the ...
448
model interpretability
Feature Importance based on a Logistic Regression Model
https://datascience.stackexchange.com/questions/63045/feature-importance-based-on-a-logistic-regression-model
<p>I was training a Logistic Regression model over a fairly large dataset with ~1000 columns.</p> <p>I did apply scaling of features using MinMaxScaler. </p> <p>I was wondering how to interpret the coefficients generated by the model and find something like feature importance in a Tree based model. </p> <p>Should I ...
<p>No, you do not need to re-scale the coefficients. To the contrary - if they are scaled, you can use them as a way to compare feature importance.</p> <p>Let's assume that our logistic regression model has coefficients {<span class="math-container">$ a_i$</span>}, relating to the different (scaled) variables {<span c...
449
neural network architectures
Is there data available about successful neural network architectures?
https://ai.stackexchange.com/questions/14303/is-there-data-available-about-successful-neural-network-architectures
<p>I am curious to if there is data available for MLP architectures in use today, their initial architecture, the steps that were taken to improve the architecture to an acceptable state and what the problem is the neural network aimed to solve.</p> <p>For example, what the initial architecture (amount of hidden layer...
0
neural network architectures
Can most of the basic machine learning models be easily represented as simple neural network architectures?
https://ai.stackexchange.com/questions/24484/can-most-of-the-basic-machine-learning-models-be-easily-represented-as-simple-ne
<p>I am currently studying the textbook <em>Neural Networks and Deep Learning</em> by Charu C. Aggarwal. In chapter <strong>1.2.1 Single Computational Layer: The Perceptron</strong>, the author says the following:</p> <blockquote> <p>Different choices of activation functions can be used to simulate different types of m...
<p>I think the author refers to both different choices of activation function and loss. It is explained in more detail in chapter 2. In particular 2.3 is ilustrative of this point.</p> <p>I don't think there is a relation between this argument and universal approximation theorems, which state that certain classes of ne...
1
neural network architectures
Why are these same neural network architecture giving different results?
https://ai.stackexchange.com/questions/22467/why-are-these-same-neural-network-architecture-giving-different-results
<p>I tried the first neural network architecture and the second one, but keeping all other variables constants, I am getting better results with the second architecture. Why are these same neural network architecture giving different results? Or am I making some mistakes?</p> <p><strong>First one:</strong></p> <pre><co...
2
neural network architectures
Image-in image-out neural network architectures
https://ai.stackexchange.com/questions/34685/image-in-image-out-neural-network-architectures
<p>With an RGB image of a paper sheet with text, I want to obtain an output image which is cropped and deskewed. Example of input:</p> <p><a href="https://i.sstatic.net/l64Kn.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/l64Kn.png" alt="enter image description here" /></a></p> <p>I have tried non-AI to...
<p>I think the second approach will be the best because it only requires that your training set is annotated with four labels for each of the four corners of the paper sheet.</p> <p>This is sort of the idea of a Region Proposal Network which is used in <a href="https://arxiv.org/pdf/1506.01497.pdf" rel="noreferrer">Fas...
3
neural network architectures
Neural network architecture for comparison
https://ai.stackexchange.com/questions/9169/neural-network-architecture-for-comparison
<p>When someone wants to compare 2 inputs, the most widespread idea is to use a Siamese architecture. Siamese architecture is a very high level idea, and can be customized based on the problem we are required to solve.</p> <p><strong>Is there any other architecture type to compare 2 inputs ?</strong> </p> <hr> <h3>B...
<p>A RBM (restricted Boltzmann machine) can be trained to extract document features. The same resulting machine can extract features of two or more documents. Because documents can be just as easily processed in series using the same machine parameters and CPU (saving the feature results) as documents could be process...
4
neural network architectures
Is there a neural network architecture specialized for mapping lower-to-higher-dimensional data?
https://ai.stackexchange.com/questions/41498/is-there-a-neural-network-architecture-specialized-for-mapping-lower-to-higher-d
<p>I am building a neural network that takes in a set of 86 parameters (primarily architecture-related, such as building floor area, kitchen size, number of a certain type of furniture, etc.) and outputs a 4D mulitdimensional array of shape <code>(6, 2532, 39, 5)</code> containing vertices of path data that are meant t...
5
neural network architectures
What type of neural network architecture allows filtering out of unwanted sounds?
https://ai.stackexchange.com/questions/38069/what-type-of-neural-network-architecture-allows-filtering-out-of-unwanted-sounds
<p>I have a use case where I will be inputting audio to a model, and the output of the model will be the same audio except with certain sounds removed (volume set to zero). The dataset is generated by taking an audio file, duplicating it, and then zeroing out the unwanted sounds (usually a half second long).</p> <p>I ...
<p>Since you say that you &quot;believe that a neural network architecture is needed here...&quot;, I am assuming that you are open to other options. This approach doesn't utilize a neural networks, but I think it can potentially get the job done (with some caveats). One approach is to</p> <ol> <li>First isolate the ...
6
neural network architectures
Is the following neural network architecture considered deep learning?
https://ai.stackexchange.com/questions/6215/is-the-following-neural-network-architecture-considered-deep-learning
<p>I am working in the following neural network architecture, I am using keras and TensorFlow as a back-end.</p> <p>It is composed by the following, embedding of words, then I added a layer of Long Short-Term Memory (LSTM) neural networks, one layer of output and finally. I am using the softmax activation function.</...
<p>"Deep learning" is not formally defined. However, typically even simple RNNs are taught as advanced neural network subject alongside other topics labelled "deep learning". </p> <p>Technically, given the time dimension, the depth of a RNN can include many layers of processing (as opposed to many layers of parameters...
7
neural network architectures
Which neural network architectures are there that perform 3D convolutions?
https://ai.stackexchange.com/questions/5979/which-neural-network-architectures-are-there-that-perform-3d-convolutions
<p>I am trying to do <strong>3d image deconvolution</strong> using <strong>convolution neural network</strong>. But I cannot find many famous CNNs that perform a 3d convolution. Can anyone point out some for me?</p> <p>Background: I am using PyTorch, but any language is OK. What I want to know most is the network struc...
<p>There are many approaches for training CNN on 3d data, but the decision to use a particular architecture is heavily dependant upon the format of your dataset.</p> <p>If you are using 3d point cloud data, I would suggest you go through <a href="https://arxiv.org/abs/1612.00593" rel="nofollow noreferrer">PointNet</a>...
8
neural network architectures
Neural network architecture with inputs and outputs being an unkown function each
https://ai.stackexchange.com/questions/24852/neural-network-architecture-with-inputs-and-outputs-being-an-unkown-function-eac
<p>I am trying to set up a neural network architecture that is able to learn the points of one function (blue curves) from the points of an other one (red curves). I think that it could be somehow similar to the problem of learning a functional like it was described in this question <a href="https://stats.stackexchange...
9
neural network architectures
Neural network architecture for line orientation prediction
https://ai.stackexchange.com/questions/6996/neural-network-architecture-for-line-orientation-prediction
<p>Imagine that a line divides an image in two regions which (slightly) differ in terms of texture and color. It is not a perfect, artificial line but rather a thin transition zone. I want to build a neural network which is able to infer geometrical information on this line (orientation and offset). The image may also ...
<p>A long shot: <a href="http://openaccess.thecvf.com/content_ICCV_2017/papers/Lee_Semantic_Line_Detection_ICCV_2017_paper.pdf" rel="nofollow noreferrer">these guys</a> have worked on a problem that might be relevant. They define "semantic" lines as lines delimiting significant regions or objects in an image. To detect...
10
neural network architectures
What kind of neural network architecture do I use to classify images into one hundred thousand classes?
https://ai.stackexchange.com/questions/6880/what-kind-of-neural-network-architecture-do-i-use-to-classify-images-into-one-hu
<p>I have an image dataset where objects may belong to one of the hundred thousand classes.</p> <p>What kind of neural network architecture should I use in order to achieve this?</p>
<p>Classification tasks with a large number of classes are usually handled with <a href="http://ruder.io/word-embeddings-softmax/index.html#hierarchicalsoftmax" rel="nofollow noreferrer">hierarchical softmax</a> to reduce the complexity of the final layer. This is useful, for example, in applications such as word embed...
11