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 |
|---|---|---|---|---|---|
model evaluation | Some questions about supervised learning, model evaluation and preprocessing | https://datascience.stackexchange.com/questions/104851/some-questions-about-supervised-learning-model-evaluation-and-preprocessing | <p>I've been trying to employ some basic techniques of supervised learning on a dataset that I have and I have several questions about the overall procedure (i.e. data preprocessing, model evaluation etc).</p>
<p>Before I start posing the questions let me give you an insight of how my dataset looks like. The dataset is... | <h2>Q1</h2>
<blockquote>
<p>Q1 Are the above techniques (except GridSearch which I completely understand) going to improve the perfomance of the classifiers for sure? I mean is there any justification that these techniques generally work for better or it is just a trial and observation procedure?</p>
</blockquote>
<p>Q... | 62 |
model evaluation | Evaluation of linear regression model | https://datascience.stackexchange.com/questions/40265/evaluation-of-linear-regression-model | <p>I want to evaluate the performance of my linear regression model. I have the true values of y (y-true). I am thinking of two way for evaluation but not sure which one is correct. </p>
<p>Let's assume that we have 2 samples and each sample has two outputs as following: </p>
<pre><code>y_true = [[0.5, 0.5],[0.6, 0.3... | <p>The only difference is in your example is that you divide by an additional two, because you take the mean per vector instead of the sum. Correctness does not play here because for comparison between different models the only difference is a constant factor and for interpretability it depends on the problem you are s... | 63 |
model evaluation | Evaluation code understanding in wide and deep model of tensorflow | https://datascience.stackexchange.com/questions/35993/evaluation-code-understanding-in-wide-and-deep-model-of-tensorflow | <p>I'm doing some research on the wide and deep model developed by Google. And I got 2 questions on the training and evaluation code fragment. (<a href="https://github.com/tensorflow/models/blob/master/official/wide_deep/wide_deep_run_loop.py#L96-L120" rel="nofollow noreferrer">Complete code</a> see here):</p>
<pre><c... | 64 | |
model evaluation | Evaluation of a model of imbalanced data | https://datascience.stackexchange.com/questions/114577/evaluation-of-a-model-of-imbalanced-data | <p>I've created a model with Random Forest algorithm. There are 45k observations, where 1s I have 12% and the rest are 0s. As far as I know ROC AUC is not the best evaluation metric in such a case. I went with PR AUC and got 59%. How would you assess the results ?</p>
<p><a href="https://i.sstatic.net/XyA5a.png" rel="n... | <p><a href="https://stats.meta.stackexchange.com/q/6349/247274">As discussed on the stats.SE meta, class imbalance leads to a lot of misconceptions, and it is important to have a strong understanding of the underlying statistics in order to overcome those misconceptions.</a></p>
<p>Log loss and Brier score are two popu... | 65 |
model evaluation | Is anything missing from my model evaluation procedure? | https://datascience.stackexchange.com/questions/43370/is-anything-missing-from-my-model-evaluation-procedure | <p>I have been building a model, can someone please review my methods and let me know if I am making a mistake? </p>
<p>I trained a model with a support vector machine as follows : </p>
<p>Split data into training and test sets as 10 partitions for K10 fold cross validation. </p>
<p>Split training set into training ... | 66 | |
model evaluation | Can I use GridSearchCV.best_score_ for evaluation of model performance? | https://datascience.stackexchange.com/questions/122562/can-i-use-gridsearchcv-best-score-for-evaluation-of-model-performance | <p>Scikit-learn page on Grid Search says:</p>
<blockquote>
<p>Model selection by evaluating various parameter settings can be seen
as a way to use the labeled data to “train” the parameters of the
grid.</p>
<p>When evaluating the resulting model it is important to do it on
held-out samples that were not seen during the... | <p>Yes, the GridSearchCV.best_score_ should not be used as a final measure of model performance. The reason is that this score is optimistic, it is the best score obtained on the validation set during the grid search, but it does not guarantee that this is the best score the model can achieve on unseen data.</p>
<p>The... | 67 |
model evaluation | Rate-distortion plots in denoising diffusion model evaluation | https://datascience.stackexchange.com/questions/131567/rate-distortion-plots-in-denoising-diffusion-model-evaluation | <p>In the Denoising Diffusion Probabilistic Models paper (<a href="https://arxiv.org/abs/2006.11239" rel="nofollow noreferrer">https://arxiv.org/abs/2006.11239</a>), the rate-distortion plot is computed assuming access to a protocol that can transmit samples <span class="math-container">$(x_T, ... x_0)$</span>. This is... | 68 | |
model evaluation | What to report in the build model, asses model and evaluate results steps of CRISP-DM? | https://datascience.stackexchange.com/questions/33265/what-to-report-in-the-build-model-asses-model-and-evaluate-results-steps-of-cri | <p>I would greatly appreciate if you could let me know what to report in the following steps of CRISP-DM?</p>
<ul>
<li><strong>Build Model</strong>: what should be reported for parameter settings, models and model description? I used grid search to tune hyperparameters.</li>
<li><strong>Assess Model</strong>: what sho... | <p>The way you are trying to present the outcome is pretty good.</p>
<p>I cannot say that the following procedure is the standard procedure in my scenario I did something like this:
<a href="https://i.sstatic.net/Y2uNf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Y2uNf.png" alt="CRISP-DM"></a></p>
<... | 69 |
model evaluation | 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 & cost of experts' time).</p>
<p>So it's les... | 70 |
model evaluation | BERT Model Evaluation Measure in terms of Syntax Correctness and Semantic Coherence | https://datascience.stackexchange.com/questions/63124/bert-model-evaluation-measure-in-terms-of-syntax-correctness-and-semantic-cohere | <p>For example I have an original sentence. The word barking corresponds to the word that is missing.</p>
<pre><code>Original Sentence : The dog is barking.
Incomplete Sentence : The dog is ___________.
</code></pre>
<p>For example, using the BERT model, it predicts the word crying instead of
the word barking. How w... | <p>You just stumble over one big problem in the NLP field : finding the perfect metric..</p>
<hr>
<p>Most traditional metrics (BLEU, ROUGE, ...) simply does not take into account the distance in terms of semantics between <code>barking</code> and <code>crying</code>.</p>
<p>So according to these metrics, <code>The d... | 71 |
model evaluation | Restricting the output of a model didn't improve the loss value of the model evaluation | https://datascience.stackexchange.com/questions/39022/restricting-the-output-of-a-model-didnt-improve-the-loss-value-of-the-model-eva | <p>There is a deep model for prediction.</p>
<p>The outputs are some numbers between 0 and 80. (In the dataset the outputs are 0-80)</p>
<p>The model Loss value is 70 and I would like to reduce it.</p>
<p>I printed the outputs after evaluating the model by test values and some of the predicted values are more than 8... | <p>I suggest you normalise your labels so that it is scaled between 0 and 1, rather than 0 and 80. Once you have a trained model then multiply your output at the end. The network should find it easier to learn values between 0 and 1 (Andrew Ng's coursera course has a good lecture on this). </p>
<p>Go back to using the... | 72 |
model evaluation | Best metric to evaluate model probabilities | https://datascience.stackexchange.com/questions/110837/best-metric-to-evaluate-model-probabilities | <p>i'm trying to create ML model for binary classification problem with balanced dataset and i care mostly about probabilities.
I was trying to search web and i find only advices to use AUC or logloss scores. There is no advices to use Brier score as evaluation metric.
Can i use brier score as evaluation metric or ther... | 73 | |
model evaluation | How is model evaluation and re-training done after deployment without ground truth labels? | https://datascience.stackexchange.com/questions/109553/how-is-model-evaluation-and-re-training-done-after-deployment-without-ground-tru | <p>Suppose I deployed a model by manual labeling the ground truth labels with my training data, as the use case is such that there's no way to get the ground truth labels without humans. Once the model is deployed, if I wanted to evaluate how the model is doing on live data, how can I evaluate it without sampling some ... | <p>In your scenario there's no other way: the only way to properly evaluate on some live data is to have a sample of live data annotated.</p>
<p>However there are a few automatic things that can be done. Even though it's not a full evaluation it can give some indications about whether the model is doing as expected:</p... | 74 |
model evaluation | What is the most accurate way of computing the evaluation time of a neural network model? | https://datascience.stackexchange.com/questions/129480/what-is-the-most-accurate-way-of-computing-the-evaluation-time-of-a-neural-netwo | <p>I am training some neural networks in pytorch to use as an embedded surrogate model. Since I am testing various architectures, I want to compare the accuracy of each one, but I am also interested in evaluating the computational time of a single forward pass as accurately as possible.
Below is the structure I have be... | 75 | |
model evaluation | How to interprete the feature significance and the evaluation metrics in classification predictive model? | https://datascience.stackexchange.com/questions/98038/how-to-interprete-the-feature-significance-and-the-evaluation-metrics-in-classif | <p>Consider a experiment to predict the Google-Play apps rating using a Random-Forest classifier with scikit-learn in Python. Three attributes 'Free', 'Size' and 'Category' are utilized to predict the apps rating. 'Rating' (label) is not continuous value, instead, grouped into two classes 0 and 1. Where 0 is below 4 st... | <blockquote>
<p><em>Firstly, lets suppose model omits the 'Size' as most significant feature, so what is implied here, having larger size or lower size of an app contribute to the rating? What If there is no ascending or descending order in the attribute, for instance, if the 'Category' is most significant, then what c... | 76 |
model evaluation | Evaluating Logistic Regression Model in Tensorflow | https://datascience.stackexchange.com/questions/19850/evaluating-logistic-regression-model-in-tensorflow | <p>Following <a href="https://github.com/chiphuyen/tf-stanford-tutorials/blob/master/examples/03_logistic_regression_mnist_sol.py" rel="nofollow noreferrer">this</a> tutorial, I have a doubt about the evaluation part in:</p>
<pre><code># test the model
n_batches = int(mnist.test.num_examples/batch_size)
total_correct_... | <p>I think you are correct. The line should be</p>
<pre><code>loss_batch, logits_batch = sess.run([loss, logits], feed_dict={X: X_batch, Y:Y_batch})
</code></pre>
| 77 |
model evaluation | Evaluate prediction from multiple classification model | https://datascience.stackexchange.com/questions/36312/evaluate-prediction-from-multiple-classification-model | <p>Given that I have data containing images of oranges, apples and pineapples and I want to classify depending on a set of features.</p>
<p>Expected that I have completed the model and ready for prediction.</p>
<p>My questions are:</p>
<p>How can I output each score for every category the model predicted like this o... | <p>Based on the description of your question, it seems that you want the probability of outcome of each class (in <code>multiclass-classification</code>).</p>
<p>I would suggest you to use <code>XGBoost</code> to get output based on your requirement. By setting the value of <code>objective</code> parameter to <code>mu... | 78 |
model evaluation | Chi-square as evaluation metrics for nonlinear machine learning regression models | https://datascience.stackexchange.com/questions/36550/chi-square-as-evaluation-metrics-for-nonlinear-machine-learning-regression-model | <p>I am using machine learning models to predict an ordinal variable (values: 1,2,3,4, and 5) using 7 different features. I posed this as a regression problem, so the final outputs of a model are continuous variables. So an evaluation box plot looks like this:
<a href="https://i.sstatic.net/FBXw2.jpg" rel="nofollow nor... | <p>Use your test data to compare the predictive performance of each model.</p>
<p>In R you could do this like:</p>
<pre><code>linear.predictions <- predict(linear.model, newdata = test.data)
nonlinear.predictions <- predict(nonlinear.model, newdata = test.data)
linear.percent.difference <- (test.data$TARGET... | 79 |
model evaluation | Evaluation method for multi-class classification problem modeled as binary classification problem | https://datascience.stackexchange.com/questions/63091/evaluation-method-for-multi-class-classification-problem-modeled-as-binary-class | <p>I should mention that even though I have some basic knowledge regarding ML, it is the first big ML project I am working on and for the proposal of my research project I need to suggest an evaluation metric.</p>
<p>The problem is a multiclass(16 classes) classification problem where one data point can be classified ... | <p>Unbalanced data will definitely be a problem and should be addressed. In particular, "accuracy" will not be dependable metric any more so if you decide the use unbalanced data directly, so you should use other metrics that are more reliable for such scenarios, but that also can depend on the data distribution you ha... | 80 |
model evaluation | Modelling on one Population and Evaluating on another Population | https://datascience.stackexchange.com/questions/887/modelling-on-one-population-and-evaluating-on-another-population | <p>I am currently on a project that will build a model (train and test) on Client-side Web data, but evaluate this model on Sever-side Web data. Unfortunately building the model on Server-side data is not an option, nor is it an option to evaluate this model on Client-side data.</p>
<p>This model will be based on met... | <p>If the users who you are getting client-side data from are from the same population of users who you would get server-side data from. If that is true, then you aren't really training on one population and applying to another. The main difference is that the client side data happened in the past (by necessity unless ... | 81 |
model evaluation | Model Performance using Precision as evaluation metric | https://datascience.stackexchange.com/questions/47804/model-performance-using-precision-as-evaluation-metric | <p>I am dealing with an imbalanced class with the following distribution :
(Total dataset size : 10763 X 20)</p>
<p>0 : 91%</p>
<p>1 : 9%</p>
<p>To build model on this dataset having class imbalance, I have compared results using </p>
<p>1) SMOTE and </p>
<p>2) Assigning more weight to the minority class when ap... | 82 | |
model evaluation | Cost Function for evaluating a Regression Model | https://datascience.stackexchange.com/questions/24950/cost-function-for-evaluating-a-regression-model | <p>There are several "classical" ways to quantify the quality of (any!) regression models such as the RMSE, MSE, explained variance, r2, etc...</p>
<p>These metrics however do not take "costs" into account, for example, for me it is worse to under-predict a value (Real: 0.5, Predicted: 0.4) than to over-predict it (Re... | <p>A loss function and cost function are the same thing. As you intuit, classical regression treats loss/cost as symmetric, which is not always what you want. In classification tasks, you can make an asymmetric <em>loss matrix</em>. You can do a similar thing with regression if you solve it with gradient descent, but... | 83 |
model evaluation | Do we need the testing data to evaluate the Model Performance - Regression | https://datascience.stackexchange.com/questions/36089/do-we-need-the-testing-data-to-evaluate-the-model-performance-regression | <p>I have been working with Classification Modelling in R and Python for the last 6 months now. With the Classification, the evaluation of the Model was based on Precision, Recall, Hamming Loss, accuracy etc.,
These classification models needed the testing data to calculate these evaluation metrics.</p>
<p>Is it the ... | <p>ML community has many more metrics than you just listed here, both for regression and classification. But the principal remains; calculating the metrics on the training set would likely lead to overfitting.</p>
| 84 |
model evaluation | Why my sentiment analysis model is overfitting? | https://datascience.stackexchange.com/questions/121745/why-my-sentiment-analysis-model-is-overfitting | <p>The task is to predict sentiment from 1 to 10 based on Russian reviews. The training data size is 20000 records, of which 1000 were preserved as a validation set. The preprocessing steps included punctuation removal, digit removal, Latin character removal, stopword removal, and lemmatization. Since the data was imba... | <p>There might be multiple reasons that might be the reason for overfitting some of which are:</p>
<p>1.) Scaling the data</p>
<p>2.) You have not mentioned which parameter values you have selected in the Tfidf vectorizer. Some of them might help to reduce overfitting. <code>ngram_range</code> and <code>max_features</c... | 85 |
model evaluation | What is a suitable loss function and evaluation metric for a classification model with large number of unbalanced target classes? | https://datascience.stackexchange.com/questions/40946/what-is-a-suitable-loss-function-and-evaluation-metric-for-a-classification-mode | <p>I am building a multiclass classifier to predict the "Intent" of a question.
There are some 100 classes in the target variable and each target class contains an unequal proportion of observations/questions varying from 3 % to 40 %.</p>
<p><strong>Questions</strong></p>
<ol>
<li>What would be a good evaluation metr... | <p>You could look at <code>sensitivity</code> and <code>specificity</code>. They can be combined effectively to either provide a basis for a correct classification, or the basis for an exclusionary classification within each class. That said, if you are looking for a measure for the model as a whole, you'll probably w... | 86 |
model evaluation | Need term or method name for evaluation of CNN without ground truth using e.g. a regression model | https://datascience.stackexchange.com/questions/111330/need-term-or-method-name-for-evaluation-of-cnn-without-ground-truth-using-e-g-a | <p>I have the following problem,
I have trained a CNN and I can evaluate the network in-sample. I want to use the trained model for the class prediction of images for which I have no ground truth. However, there are other features referenced to these images that I can implement in a regression model along with predict... | <p>What you ask for is related to what is termed as <a href="https://en.wikipedia.org/wiki/Explainable_artificial_intelligence" rel="nofollow noreferrer">explainable AI</a> (especially for deep models, like CNNs). Explainable AI methods try to provide (quantitative) insight as to why the model makes this or that predic... | 87 |
model evaluation | Multiple models have extreme differences during evaluation | https://datascience.stackexchange.com/questions/102911/multiple-models-have-extreme-differences-during-evaluation | <p>My dataset has about 100k entries, 6 features, and the label is simple binary classification (about 65% zeros, 35% ones).</p>
<p>When I train my dataset on different models: random forest, decision tree, extra trees, k-nearest neighbors, logistic regression, sgd, dense neural networks, etc, the evaluations differ GR... | <p>A few thoughts:</p>
<ul>
<li>The first thing I would check is whether the other models overfit. You could check this by comparing the performance between the training set and the test set.</li>
<li>Also there's something a bit strange about k-NN always predicting the majority class. This would happen only if any ins... | 88 |
model evaluation | keras custom metric function how to feed 2 model outputs to a single metric evaluation function | https://datascience.stackexchange.com/questions/54443/keras-custom-metric-function-how-to-feed-2-model-outputs-to-a-single-metric-eval | <p>I have an CNN object detection model which has two heads(outputs) with tensor names <code>'classification'</code> and <code>'regression'</code>. </p>
<p>I want to define a metric function that <strong>accepts both the outputs at the same time</strong>, so that it looks into the <strong>regression predictions</stron... | <p>I have found suggestion to implement metrics through callback.</p>
<p><a href="https://github.com/keras-team/keras/issues/4506" rel="nofollow noreferrer">https://github.com/keras-team/keras/issues/4506</a></p>
<p>Maybe it helps you and those with similar problem to figure out the needed solution</p>
| 89 |
model evaluation | Why training model give great result but real data gives very bad result: Azure ML Studio | https://datascience.stackexchange.com/questions/28251/why-training-model-give-great-result-but-real-data-gives-very-bad-result-azure | <p>I am using Two-Class Boosted Decision Tree to train model. </p>
<p>Evaluation result I'd say really good.</p>
<p>But when I am using real dataset - the result is very bad.</p>
<p>What can possibly go wrong that makes such huge difference? </p>
<p>Below is the screenshot of my model:</p>
<p><a href="https://i.ss... | <p>Your question is not clear. There's 2 ways to understand it. Which dataset did you use to train your model?</p>
<ol>
<li>You trained and tested on a premade dataset. The result is great. Then you applied this model to real dataset and the result is really bad.</li>
</ol>
<p>If this is the case, you should retrain... | 90 |
model evaluation | Image Preprocessing | https://datascience.stackexchange.com/questions/100542/image-preprocessing | <p>I'm working on a use case where I need to pre process the image for my AIML model evaluation and I want to count all black pixels in RGB image.</p>
<p>Instead of iterating rows*column, I'm looking for some vector based approach for this evaluation.
Please suggest.</p>
| <p>I did this implementation,</p>
<pre><code>#img = [w,h,c] numpy array of image
out = img == [0,0,0]
np.sum(np.sum(out,axis=1) == 3)
</code></pre>
<p>Its working. Let me know in case we can optimized it further.</p>
| 91 |
model evaluation | How to make an DL model predict Correctly | https://datascience.stackexchange.com/questions/103955/how-to-make-an-dl-model-predict-correctly | <p>So I trained a DL algorithm using Keras for Human Action Recognition. The model has an accuracy of about 85 percent and a loss of 0.3 something. The problem is that the model did not predict well on unseen data. The dataset consists of 3 classes with 100 videos in each class.</p>
<p><strong>Training Phase:</strong>
... | 92 | |
model evaluation | Evaluate best model | https://datascience.stackexchange.com/questions/114204/evaluate-best-model | <p>Let's assume I have 2 models</p>
<p>Model 1:</p>
<ul>
<li>Train Accuracy = 92.4%</li>
<li>Validation Accuracy = 37.6%</li>
<li>Test Accuracy = 35.3%</li>
</ul>
<p>Model 2:</p>
<ul>
<li>Train Accuracy = 37.0%</li>
<li>Validation Accuracy = 34.2%</li>
<li>Test Accuracy = 34.1%</li>
</ul>
<p>Which is the best model ?
M... | <p>Deep learning models heavily rely on stochastic processes such as weight initialization, back-propagation, etc. For evaluation and comparison of different models, there are methods that are generally referred to as <a href="https://en.wikipedia.org/wiki/Cross-validation_(statistics)" rel="nofollow noreferrer">Cross-... | 93 |
model evaluation | How to effectively evaluate a model with highly imbalanced and limited dataset | https://datascience.stackexchange.com/questions/112713/how-to-effectively-evaluate-a-model-with-highly-imbalanced-and-limited-dataset | <p>Most data imbalance questions on this stack have been asking <em>How to learn a better model</em>, but I tend to think one other problem is <em>How do we define "better" (i.e. fairly evaluate the learned model)</em> to ensure the evaluation performance on the limited test set does not suffer from high vari... | <p>I think that one way is using a out of bootstrap validation several times in order to estimate the distribution of your interest metric.</p>
| 94 |
model evaluation | Is it a good practice to evaluate a model on the training set | https://datascience.stackexchange.com/questions/80555/is-it-a-good-practice-to-evaluate-a-model-on-the-training-set | <p>Is it a good practice to evaluate a model on the <strong>training set</strong> (i.e. train a model on training set and evaluate the regression error/accuracy on the same training set) <strong>and</strong> compare the evaluation result with the model regression error/accuracy of cross validation (we do the cross vali... | <p>Ok, let's be clear:</p>
<ul>
<li>When we say that evaluation should never be done on the training set, it means that <strong>the real performance of the model</strong> can only be estimated on a separate test set.</li>
<li>It's totally fine to calculate the performance of a system on the training data, and it's ofte... | 95 |
model evaluation | How to evaluate a hurdle model | https://datascience.stackexchange.com/questions/82639/how-to-evaluate-a-hurdle-model | <p>Should the two sequential parts of a hurdle model (Response model and Expected value model) be tuned and evaluated independently, and then combines for the final results (Product of the probability to respond and the expected value)? Or should they be tuned and evaluated as a single model? What is the best approach ... | 96 | |
model evaluation | Cross validation and evaluation: neural network loss function continuously decreases in cross-validation | https://datascience.stackexchange.com/questions/81126/cross-validation-and-evaluation-neural-network-loss-function-continuously-decre | <p>I am evaluating a neural network model using cross validation in 2 different ways ( A & B ) that I thought were equivalent.</p>
<ul>
<li><strong>Evaluation type A :</strong>
For each cross validation loop, the model is instantiated and fitted.</li>
<li><strong>Evaluation type B :</strong>
I instantiate the model... | <p>In the <em>evaluation type B</em> approach, your neural network <strong>weights and biais are not reset</strong> before each loop of cross-validation. The neural network is then learning from one loop to another, so you see the MAE continuously decreasing.</p>
<p>A solution is to store your weights and biais before ... | 97 |
model evaluation | Match between objective function and evaluation metric | https://datascience.stackexchange.com/questions/82224/match-between-objective-function-and-evaluation-metric | <p>Does the objective function for model fitting and the evaluation metric for model validation need to be identical throughout the hyperparameter search process?</p>
<p>For example, can a XGBoost model be fitted with the Mean Squares Error (MSE) as the objective function (setting the 'objective' argument to reg:square... | <p>The evaluation metric for model validation has to be the same throughout the hyperparameter search process in order fairly compare different models.</p>
<p>The objective function for model fitting can be different throughout the hyperparameter search process. During the hyperparameter search process, you can compare... | 98 |
model evaluation | Is data leakage giving me misleading results? Independent test set says no! | https://datascience.stackexchange.com/questions/108916/is-data-leakage-giving-me-misleading-results-independent-test-set-says-no | <p><strong>TLDR:</strong></p>
<p>I evaluated a classification model using 10-fold CV with data leakage in the training and test folds. The results were great. I then solved the data leakage and the results were garbage. I then tested the model in an independent new dataset and the results were similar to the evaluation... | 99 | |
hyperparameter tuning | With automated hyperparameter tuning available, do we still need to learn hyperparameter tuning | https://datascience.stackexchange.com/questions/85426/with-automated-hyperparameter-tuning-available-do-we-still-need-to-learn-hyperp | <p>Tools like AWS Sagemaker have capability to do automated hyperparameter tuning, even with complex algos like Neural Networks using Tensorflow. So do we still need to learn how to do hyperparameter tuning, or simply leave it to tools like Sagemaker? Thx</p>
| <blockquote>
<p>So do we still need to learn how to do hyperparameter tuning</p>
</blockquote>
<p>If you're saying this based on the context of acquiring a new skill, then go for it. It's always a good thing to get an idea an idea of how hyper-parameter testing is done for real. In addition to sagemaker you can use too... | 100 |
hyperparameter tuning | Automated Hyperparameter tuning | https://datascience.stackexchange.com/questions/27057/automated-hyperparameter-tuning | <p>Are there any advanced packages that allow automated hyperparameter tuning for neural networks and traditional machine learning algorithms like XGBoost, random forest (using method like Bayesian, random search etc. that could allow for faster discovery of the optimal parameters)? I have heard of hyperopt, but it see... | <p>There are a number of methods to automate the optimization of your hyper-parameters, such as GridSearch and RandomSearch which the article you linked discusses briefly.</p>
<p>The main reason to choose one over the other is if you want the best possible parameters, and do not care how long it takes to get them: go f... | 101 |
hyperparameter tuning | Hyperparameter Tuning vs Regularization | https://datascience.stackexchange.com/questions/116846/hyperparameter-tuning-vs-regularization | <p>While designing the architecture of a Neural Network, should I consider adding regularization (like Dropout, L1/L2, etc.) even after optimizing the problem using Hyperparameter Tuning? What should be the main focus (tuning or regularization) to achieve more generalization, considering that both of these simplify the... | <p>Yes, it is <strong>generally recommended to use regularization techniques</strong>, such as <strong>Dropout, L1/L2 regularization</strong>, etc., <em><strong>even after optimizing the problem using hyperparameter tuning</strong></em>. <strong>Regularization</strong> techniques help to prevent overfitting by adding c... | 102 |
hyperparameter tuning | Time Series Hyperparameter Tuning | https://datascience.stackexchange.com/questions/106346/time-series-hyperparameter-tuning | <p>My question is about the intuition for hyperparameter tuning of time series.</p>
<p>In other models, like Linear or Logistic Regression there is labeled data and according to accuracy or precision, the parameters are tuned. But in time series, the future values are predicted. For example, the next 30 days.</p>
<p>My... | 103 | |
hyperparameter tuning | hyperparameter tuning with validation set | https://datascience.stackexchange.com/questions/60547/hyperparameter-tuning-with-validation-set | <p>For what I know, and correct me if I am wrong, the use of cross-validation for hyperparameter tuning is not advisable when I have a huge dataset. So, in this case it is better to split the data in training, validation and test set; and then perform the hyperparameter tuning with the validation set.</p>
<p>In the ca... | <p>It seems to me that you're manually iterating through the hyper-parameters.</p>
<p><code>scikit-learn</code> has a number of helper functions that make it easy to iterate through all of the parameters using various strategies:
<a href="https://scikit-learn.org/stable/modules/grid_search.html#grid-search" rel="nofol... | 104 |
hyperparameter tuning | How to avoid numerous Hyperparameter tuning in ML? | https://datascience.stackexchange.com/questions/112244/how-to-avoid-numerous-hyperparameter-tuning-in-ml | <p>Suppose I have developed a dynamic system for forecasting the future of some specific stocks. As time passes, the train set will change dynamically. For a better understanding, consider this example:</p>
<ul>
<li><p><strong>First Round:</strong><br />
train set = [0 : 150] (The first 150 samples are in the training ... | <p>A good hyperparameter may be considered as a random variable with some variation. I wouldn't worry to much not to find the best parameter for one specific test set. In case you are sure there should be multiple values for some parameter, I would try to do it not for all test sets but with some step. Please take into... | 105 |
hyperparameter tuning | Why does model with hyperparameter tuning underperform? | https://datascience.stackexchange.com/questions/112115/why-does-model-with-hyperparameter-tuning-underperform | <p>I have a dataset where I applied xgb model with grid search to tune the hyperparameters and class balancing. I compared the model without any hyperparameter tuning with a model that has been applied with hyperparameter tuning. The model without any hyperparameters set output an accuracy around 90 (train), 81 (test) ... | 106 | |
hyperparameter tuning | Is hyperparameter tuning done on training or validation data set? | https://datascience.stackexchange.com/questions/121388/is-hyperparameter-tuning-done-on-training-or-validation-data-set | <p>Is hyperparameter tuning done on training or validation data set? The post <a href="https://stats.stackexchange.com/questions/366862/is-using-both-training-and-test-sets-for-hyperparameter-tuning-overfitting">here</a> gives mixed opinion as of whether the training set should be used for hyperparameter tuning. And I ... | <p>Tuning hyperparameters on the training set is generally not as critical as training on the test set, but overall increases the risk of overfitting.</p>
<p>Alternatively, use cross-validation to tune the hyperparameters. You might even get less biased hyperparameters, at the cost of higher implementation and computat... | 107 |
hyperparameter tuning | Ordering of Train/Val/Test set use in hyperparameter tuning | https://datascience.stackexchange.com/questions/124881/ordering-of-train-val-test-set-use-in-hyperparameter-tuning | <p>The way I read almost lots of ML advice on these datasets sounds like "You train a model that's randomly chosen hyperparameters first on the training set, then you ignore this bit of the work, and hyperparameter tune on a validation set, then choose the final model you want and test it on the test set". Th... | <p>You are asking about a model's ability to <strong>generalize</strong> to unseen examples.</p>
<p>Consult
<a href="https://work.caltech.edu/textbook.html" rel="nofollow noreferrer">Abu-Mostafa, et al.</a>,
Learning From Data, § 5.3 Data Snooping.</p>
<blockquote>
<p>If a data set has affected any step in the learning... | 108 |
hyperparameter tuning | Hyperparameter tuning one-class svm | https://datascience.stackexchange.com/questions/74691/hyperparameter-tuning-one-class-svm | <p>I have a problem where I am trying to apply a one-class svm to detect outliers. I am training on a dataset of <em>true</em> cases using a one-class radial svm and then predicting for both false and true cases. It is worth noting that the <em>true</em> cases I am training on do contain a proportion of misclassified c... | 109 | |
hyperparameter tuning | Feature selection or hyperparameter tuning first for 30 feature data | https://datascience.stackexchange.com/questions/126768/feature-selection-or-hyperparameter-tuning-first-for-30-feature-data | <p>I have about 30 variables and trying to create a Random Forest model. All the variables are expected to be predictors of outcome. I want to find the best model based on a C-stat score with any number of features. Shall I do feature selection first or hyperparameter tuning? I read that people prefer feature selection... | <p>Feature selection and hyper-parameter tuning have different purposes.</p>
<p>If you consider the entire workflow of data to the ML model and what the model is doing you can get to some intuition what to do first.
The model will learn some patterns that are in your data, and the hyper-parameter will slightly dictate ... | 110 |
hyperparameter tuning | Hyperparameter Tuning Time Series in Production | https://datascience.stackexchange.com/questions/56530/hyperparameter-tuning-time-series-in-production | <p>I have a time series data that handled using GDBT to predict the next value. I always use previous 30 days data to train daily, but overtime the data to predict and train is increased because the number of combination things increased.</p>
<p>My question is, how often do we need to hypertune our model? and what eva... | <p>Some ideas:</p>
<ul>
<li><strong>Number of previous observations to use:</strong> depends on the process you are modelling. If the target is related in some way to many of the previous values, you may need to use more data in your tuning process. On the other hand, if the target is largely unrelated to previous obs... | 111 |
hyperparameter tuning | Proper workflow for model selection and hyperparameter tuning using cross validation | https://datascience.stackexchange.com/questions/73990/proper-workflow-for-model-selection-and-hyperparameter-tuning-using-cross-valida | <p>I have been trying to teach myself about machine learning and wanted to make sure I had the right idea about model selection, hyperparameter tuning, and cross validation. </p>
<p>So given a data set, my understanding is that this is the general workflow should be.
1. Split into train and test
2. Use cross validatio... | <p>Like a Russian Matryoshka doll, there can be many layers of data partitioning and model selection you can use with a dataset. For a "simple" approach, you can first partition your data into train and test sets. Within your training set, you can use cross validation to choose the best hyperparameters for each model. ... | 112 |
hyperparameter tuning | Getting worse results after Hyperparameter Tuning(Grid/Random Search/TPOT) | https://datascience.stackexchange.com/questions/61487/getting-worse-results-after-hyperparameter-tuninggrid-random-search-tpot | <p>I have a problem with Hyperparameter Tuning. Usually I getting almost the same results(or worse) than before tuning. Usually default parameters of classificator(regressor) give me a best score. Anybody could recommend other techniques or give me a tip what I should improve?</p>
| 113 | |
hyperparameter tuning | Hyperparameter tuning results yield no improvement over spot-check | https://datascience.stackexchange.com/questions/73304/hyperparameter-tuning-results-yield-no-improvement-over-spot-check | <p>There is a balanced binary classified dataset as seen below.</p>
<p><a href="https://i.sstatic.net/NLgSH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/NLgSH.png" alt="Target Variable count"></a></p>
<p>Things I have tried using <a href="https://scikit-learn.org/stable/modules/generated/sklearn.ens... | 114 | |
hyperparameter tuning | validation after hyperparameter tuning | https://datascience.stackexchange.com/questions/90539/validation-after-hyperparameter-tuning | <p>I tuned my hyperparameter with random search and i used <code>cv=5</code>. Is it important to validated the hyperparameter with model and testdata or is it okay to use the given back accuracy from random search?</p>
| <p>In machine learning there is a fundamental difference between what is known as <em>hyperparameters</em> and <em>parameters</em>.</p>
<p><strong>Parameters</strong></p>
<p>They are the variables that define your <em>model</em>, or in other words the relationship between your inputs and the output you are trying to pr... | 115 |
hyperparameter tuning | XGBoost regressor hyperparameter tuning with hyperopt leads to overfit | https://datascience.stackexchange.com/questions/94600/xgboost-regressor-hyperparameter-tuning-with-hyperopt-leads-to-overfit | <p>Using hyperopt to hyperparameter tuning on XGBoost regressor, I am receiving overfiting on the train set.</p>
<p>There is any suggestion how to solve it ?</p>
<p>I have used cross validation with early_stopping_rounds and it still doesn't improved.</p>
<p>I have tried to tune the gamma, colsample_bytree, subsample,... | 116 | |
hyperparameter tuning | Hyperparameter tuning XGBoost | https://datascience.stackexchange.com/questions/84609/hyperparameter-tuning-xgboost | <p>I'm trying to tune hyperparameters with bayesian optimization. It is a regression problem with the objective function: objective = 'reg:squaredlogerror'<br />
<span class="math-container">$\frac{1}{2}[log(pred+1)-log(true+1)]^2$</span></p>
<p>My dataset consists of 20k vectors, each vector has length 12 (twelve feat... | <p>Another way is to use the mean_squared_log_error from the same metrics module,.</p>
<p>First clip the negative values in the predictions to 1 and find the mean squared log error</p>
<p>pred = np.clip(pred, min=1, max=None)</p>
<p>err = mean_squared_log_error(yval, pred)</p>
| 117 |
hyperparameter tuning | Is it a good practice to use hyperparameter tuning in production pipeline? | https://datascience.stackexchange.com/questions/108451/is-it-a-good-practice-to-use-hyperparameter-tuning-in-production-pipeline | <p>I'm studying TensorFlow Extended and I can see that it's training pipeline includes a "Tuner" component for hyperparameter tuning. As a consequence, I'm wondering if inclusion of tuning is a good practice in case of a production pipeline (which, as in most cases, invoked iteratively from time to time with ... | <p>Hyperparameter tuning helps model to find best parameters so that it can give you optimal results. Hyperparameter tuning should be done during training process only and not in production pipeline if you are deploying the model.</p>
<p>But if your doing model retraining as part of production pipeline then hyperparame... | 118 |
hyperparameter tuning | Disadvantages of hyperparameter tuning on a random sample of dataset | https://datascience.stackexchange.com/questions/44109/disadvantages-of-hyperparameter-tuning-on-a-random-sample-of-dataset | <p>I often work with very large datasets where it would be impractical to check all relevant combinations of hyperparameters when constructing a machine learning model. I'm considering randomly sampling my dataset and then performing hyperparameter tuning using the sample. Then, I would train/test the model using the f... | <p>One of the good practices is to create a split in the dataset for each tuning/ training step of your pipeline. Since you have large datasets, you should have enough data to split the original dataset into multiple subsets and still have a relevant number of rows for each step. As such, as an example, you can divide ... | 119 |
hyperparameter tuning | How does batch normalization make a model less sensitive to hyperparameter tuning? | https://datascience.stackexchange.com/questions/114953/how-does-batch-normalization-make-a-model-less-sensitive-to-hyperparameter-tunin | <p>Question 22 of <a href="https://www.projectpro.io/article/100-data-science-interview-questions-and-answers-for-2021/184" rel="nofollow noreferrer">100+ Data Science Interview Questions and Answers for 2022</a> asks <em>What is the benefit of batch normalization?</em></p>
<p>The first bullet of the answers to this is... | <p>Regularization is not the primary goal of batch normalization. The main goal of batch normalization is to speed up learning. Regularization is a side effect of batch normalization, it does not replace dropout.</p>
<p>As normalizing inputs improves learning, normalizing aggregated inputs to the activation function of... | 120 |
hyperparameter tuning | Which data hyperparameter tuning using for fit the model | https://datascience.stackexchange.com/questions/115204/which-data-hyperparameter-tuning-using-for-fit-the-model | <pre><code>X = all features from dataset
y = all target from dataset
X_train = features that already using train_test_split approach
y_train = target that already using train_test split approach
</code></pre>
<p>So my question is which one should I choose if I would like to do hyperparameter tuning? I have imbalance... | <p>The recommended approach is to use cross validation on the training dataset (X_train, y_train) for hyperparameter tunning and oversampling on each fold of cross validation.</p>
<p>The code would something like this:</p>
<pre class="lang-py prettyprint-override"><code>from imblearn.over_sampling import SMOTE
from imb... | 121 |
hyperparameter tuning | XGBoost Binary Classification for authentication hyperparameter tuning | https://datascience.stackexchange.com/questions/129989/xgboost-binary-classification-for-authentication-hyperparameter-tuning | <p>Im currently working on biometric authentication, specifically on keystroke dynamics. I used XGBoost as binary classification so i can calculate equal error rate (EER) and ROC-AUC. Now i want to do tuning hyperparameter but i dont know how should set them up. My current approach was wraping XGBoost with OneVsRestCla... | 122 | |
hyperparameter tuning | SVM C vs gamma hyperparameter tuning | https://datascience.stackexchange.com/questions/66251/svm-c-vs-gamma-hyperparameter-tuning | <p>While running SVC(), how we can hyperparameter tune C vs gamma combination?</p>
<p>I could see changes in C and gamma are impacting the accuracy differently. Also, what I understand about C and gamma are:</p>
<ol>
<li><p>C is the cost of mis-classification which means a large C gives you a low bias and high variance... | 123 | |
hyperparameter tuning | How to compare hyperparameter tuning in R and Python | https://datascience.stackexchange.com/questions/88363/how-to-compare-hyperparameter-tuning-in-r-and-python | <p>I tried random forest in both R (Caret) and Python (Scikit-learn), but the results differ drastically.
Pearson correlation between predicted value and actual value was 0.2 in python whereas 0.8 in R.</p>
<p>I suspect that is because of hyperparameter tuning difference and wanted to check detail settings in R and pyt... | 124 | |
hyperparameter tuning | RFECV and grid search - what sets to use for hyperparameter tuning? | https://datascience.stackexchange.com/questions/131174/rfecv-and-grid-search-what-sets-to-use-for-hyperparameter-tuning | <p>I am running machine learning models (all with sci-kit learn estimators, no neural networks) using a custom dataset with a number of features and binomial output. I first split the dataset into 0.6 (train), 0.2 (validation), 02 (test) sets, before preprocessing and converting into dataframes.</p>
<p>I use RFECV with... | <p>The best would be to do the features selection inside the grid search (look also at randomized search that I find more effective).</p>
<p>For this, using a scikit-learn pipeline is convenient and rigourous as in theory you should also include the other preprocessing steps inside the loop like encoding categorical fe... | 125 |
hyperparameter tuning | Robustness of hyperparameter tuning | https://datascience.stackexchange.com/questions/74710/robustness-of-hyperparameter-tuning | <p>I use a Bayesian hyperparameter (HP) optimization approach (<a href="https://docs.ray.io/en/master/_modules/ray/tune/suggest/bohb.html" rel="nofollow noreferrer">BOHB</a>) to tune a deep learning model. However, the resulting model is not robust when repeatedly applied to the same data. I know, I could use a seed to... | <p>As I understand them, Bayesian optimization approaches are already somewhat robust to this problem. The evaluated performance function is usually(?) considered noisy, so that the search would want to check nearby the "best solution" <span class="math-container">$h$</span> to improve certainty; if it then ... | 126 |
hyperparameter tuning | Does hyperparameter tuning of Decision Tree then use it in Adaboost individually vs Simultaneously yield the same results? | https://datascience.stackexchange.com/questions/102103/does-hyperparameter-tuning-of-decision-tree-then-use-it-in-adaboost-individually | <p>So, my predicament here is as follows, I performed hyperparameter tuning on a standalone Decision Tree classifier, and I got the best results, now comes the turn of Standalone Adaboost, but here is where my problem lies, if I use the Tuned Decision Tree from earlier as a base_estimator in Adaboost, then I perform hy... | <p>No, generally optimizing two parts of a modeling pipeline separately will not work as well as searching over all the parameters simultaneously.</p>
<p>In your particular case, this is easier to see: the optimal single tree will probably be much deeper than the optimal trees in an AdaBoost ensemble. A single tree (p... | 127 |
hyperparameter tuning | Hyperparameter tuning | https://datascience.stackexchange.com/questions/126432/hyperparameter-tuning | <p>Jane trains three different classifiers: Logistic Regression, Decision Tree, and Support Vector Machines on the
training set. Each classifier has one hyper-parameter (regularisation parameter, depth-of-tree, etc) that needs
to set, so she chooses a set of 10 reasonable values for each and performs a sweep over those... | <p>This is called data leakage.</p>
<p>She should choose hyper parameters based upon the training data. And then report performance when evaluated using the test data.</p>
<p>Being able to make good predictions on already seen data is uninteresting . Any relational database could accomplish that trick, it is trivial. W... | 128 |
hyperparameter tuning | Cross validation and hyperparameter tuning workflow | https://datascience.stackexchange.com/questions/104435/cross-validation-and-hyperparameter-tuning-workflow | <p>After reading a lot of articles on cross validation, I am now confused. I know that cross validation is used to get an estimate of model performance and is used to select the best algorithm out of multiple ones. After selecting the best model (by checking the mean and standard deviation of CV scores) we train that m... | <p>Suppose you have two models which you can choose <span class="math-container">$m_1$</span>, <span class="math-container">$m_2$</span>. For a given problem, there is a best set of hyperparameters for each of the two models (where they perform as good as possible), say <span class="math-container">$m_1^*$</span>, <spa... | 129 |
hyperparameter tuning | Is there a point in hyperparameter tuning for Random Forests? | https://datascience.stackexchange.com/questions/116761/is-there-a-point-in-hyperparameter-tuning-for-random-forests | <p>I have a binary classification task with substantial class imbalance (99% negative - 1% positive). I want to developed a Random Forest model to make prediction, and after establishing a baseline (with default parameters), I proceed to hyperparameter tuning with scikit-learn's GridSearchCV.</p>
<p>After setting some ... | <p>The grid search chooses the hyperparameters whose average score across the <em>test folds</em> is the best. That might also correspond to the best training fold scores and/or the highest-capacity hyperparameters, but might not. A "more overfit" model can still be better if its test and production scores ar... | 130 |
hyperparameter tuning | Hyperparameter Tuning in Machine Learning | https://datascience.stackexchange.com/questions/29962/hyperparameter-tuning-in-machine-learning | <p>What is the difference between Hyper-parameter Tuning and k-NN algorithm? Is k-NN also a type of Hyper-parameter tuning?</p>
| <p>In kNN algorithm, you only try to find a suitable value of parameter k. And some models may have many parameters that can be modified. Normal parameters are optimized by loss functions and Hyperparameter tuning allows you to set various parameters to get the best model. You set them before training. Its 2 methods: <... | 131 |
hyperparameter tuning | Is hyperparameter tuning more affected by the input data, or by the task? | https://datascience.stackexchange.com/questions/57364/is-hyperparameter-tuning-more-affected-by-the-input-data-or-by-the-task | <p>I'm working on optimizing the hyperparameters for several ML models (FFN, CNN, LSTM, BiLSTM, CNN-LSTM) at the moment, and running this alongside another experiment examining which word embeddings are best to use on the task of binary text classification.</p>
<p>My question is: should I decide on which embeddings to... | <blockquote>
<p>In other words, is hyperparameter tuning more affected by the task (which is constant) or by the input data?</p>
</blockquote>
<p>It's correct that the task is constant, but hyper-parameters are usually considered specific to a particular learning algorithm, or to a method in general. In a broad sens... | 132 |
hyperparameter tuning | Validation set after hyperparameter tuning | https://datascience.stackexchange.com/questions/89323/validation-set-after-hyperparameter-tuning | <p>Let's say I'm comparing few models, and for my dataset I'm using train/validation/test split, and not cross validation. Let's say I'm completely done with parameter tuning for one of them and want to evaluate on the test set. Will I train a new model, on both the training and the validation datasets combined with th... | 133 | |
hyperparameter tuning | How to combine preprocessor/estimator selection with hyperparameter tuning using sklearn pipelines? | https://datascience.stackexchange.com/questions/106568/how-to-combine-preprocessor-estimator-selection-with-hyperparameter-tuning-using | <p>I'm aware of how to use <code>sklearn.pipeline.Pipeline()</code> for simple and slightly more complicated use cases alike. I know how to set up pipelines for homogeneous as well as heterogeneous data, in the latter case making use of <code>sklearn.compose.ColumnTransformer()</code>.</p>
<p>Yet, in practical ML one m... | <p>Some pure scikit approaches:</p>
<ul>
<li><p>When pre-processing relates to data balancing & sampling strategies, consider using <a href="https://imbalanced-learn.org/stable/" rel="nofollow noreferrer">Imbalance-Learn</a> components (ie: RandomUnderSample) you embed right into your pipelines. This lets you hyper... | 134 |
hyperparameter tuning | Hyperparameter tuning for stacked models | https://datascience.stackexchange.com/questions/41336/hyperparameter-tuning-for-stacked-models | <p>I'm reading the following kaggle post for learning how to incorporate model stacking </p>
<p><a href="http://blog.kaggle.com/2016/12/27/a-kagglers-guide-to-model-stacking-in-practice/" rel="nofollow noreferrer">http://blog.kaggle.com/2016/12/27/a-kagglers-guide-to-model-stacking-in-practice/</a>
in ML models. The s... | <p>Do not mix dividing the data into k-fold with cross validation.</p>
<p>You can use the 4 folds ( training data) to optimize the base classifiers. You can also find the best hyper parameters by applying cross validation on your training data, re-train using all training data ( the 4 folds) and then test using the la... | 135 |
hyperparameter tuning | Hyperparameter tuning and cross validation | https://datascience.stackexchange.com/questions/61620/hyperparameter-tuning-and-cross-validation | <p>I have some confusion about proper usage of cross-validation to</p>
<ol>
<li>tune hyperparameters and</li>
<li>evaluate estimator performance and generalizeability.</li>
</ol>
<p>As I understand it, this would be the process you would follow:</p>
<ol>
<li>Split your full dataset into a training and test set (Python'... | <p>Some of the popular ways of splitting of data that the user can validate a model:</p>
<ol>
<li>Train-Test (Most popular)</li>
<li>Train-Test-Validation</li>
<li>Train-Test-Development</li>
<li>Train-Test-Dev-Val</li>
</ol>
<p>Every way has their own pros and cons. There is no one-size-fits-all approach for getting... | 136 |
hyperparameter tuning | Hyperparameter Tuning with Simulated Data | https://datascience.stackexchange.com/questions/47608/hyperparameter-tuning-with-simulated-data | <p>I'm trying to create a SVM classifier which can predict some fault, and to train it I'm using <strong>simulated examples</strong> of the fault. Of course, the simulations are not perfect, but they appear to be good enough since I get reasonable results when predicting on the real examples. </p>
<p>What is the best ... | 137 | |
hyperparameter tuning | Why does hyperparameter tuning occur on validation dataset and not at the very beginning? | https://datascience.stackexchange.com/questions/111372/why-does-hyperparameter-tuning-occur-on-validation-dataset-and-not-at-the-very-b | <p>Despite doing/using it a few times, I'm still slightly confused by the use of a validation set for hyper parameter tuning.</p>
<p>As far as I can tell, I choose a model, train it on training data, assess performance on training data, then do hyper parameter tuning assessing model performance on validation data, then... | <p>You perform hyperparameter tuning using train dataset. Validation dataset is used to make sure the model you trained is not overfit. The issue here is that the model has already "seen" the validation dataset and it is possible that the model doesn't perform as expected against new/unseen data. That's why y... | 138 |
hyperparameter tuning | Train/val/test approach for hyperparameter tuning | https://datascience.stackexchange.com/questions/118574/train-val-test-approach-for-hyperparameter-tuning | <p>When looking to train a model, does it make sense to have a 60-20-20 train val test split, first hyper parameter tuning over the training dataset, using the validation set, picking the best model. Then training over train+val and the final test occurring on the test set?</p>
| <p>I would say that this depends heavily on the type of data that you have and the task at hand. If the available dataset is sufficiently large, you can add a larger validation and test set. If you only have limited data available, you might consider decreasing the size of the validation and test set in order to improv... | 139 |
hyperparameter tuning | Hyperparameter Tuning Guidelines Across Lots of Models | https://datascience.stackexchange.com/questions/114064/hyperparameter-tuning-guidelines-across-lots-of-models | <p>I am performing a set of experiments in which I need to tune a fairly small set of hyperparameters but over a very large space of models trained on relatively related datasets and I'm trying to essentially limit the amount of trials I need to run in order to find <em>somewhat</em> optimal hyperparameter settings for... | 140 | |
hyperparameter tuning | Is it a problem to use the test dataset for the hyperparameter tuning, when I want to compare 2 classification algorithms on the 10 different dataset? | https://datascience.stackexchange.com/questions/123982/is-it-a-problem-to-use-the-test-dataset-for-the-hyperparameter-tuning-when-i-wa | <p>I know that we should use the validation set to perform hyperparameter tuning and that test dataset is not anymore really the test if it is used for hyperparameter tuning. But is this a problem if i want to compare the performance of 2 algorithms (e.g., Random Forest and XGBoost) across 10 different datasets, where ... | <p>Seems like there is something flawed in the procedure here. If you use the test data set for tuning, then what do you use for testing performance?</p>
<p>In general, the models should not get any information from the test set. If models are exposed to the test set you will generally tend to conclude the more flexibl... | 141 |
hyperparameter tuning | Hyperparameter tuning with Bayesian-Optimization | https://datascience.stackexchange.com/questions/89047/hyperparameter-tuning-with-bayesian-optimization | <p>I'm using LightGBM for the regression problem and here is my code.</p>
<pre><code>
def bayesion_opt_lgbm(X, y, init_iter = 5, n_iter = 10, random_seed = 32, seed= 100, num_iterations = 50,
dtrain = lgb.Dataset(data = X_train, label = y_train)):
def lgb_score(y_preds, dtrain):
... | <p>The <code>pbounds</code> must all be pairs; you cannot specify a list of options for <code>max_depth</code>.</p>
<p>The package cannot deal with discrete hyperparameters very directly; see section 2, "Dealing with discrete parameters", of <a href="https://github.com/fmfn/BayesianOptimization/blob/master/ex... | 142 |
hyperparameter tuning | Worse performance after Hyperparameter tuning | https://datascience.stackexchange.com/questions/97440/worse-performance-after-hyperparameter-tuning | <p>I first construct a base model (using default parameters) and obtain MAE.</p>
<pre><code># BASELINE MODEL
rfr_pipe.fit(train_x, train_y)
base_rfr_pred = rfr_pipe.predict(test_x)
base_rfr_mae = mean_absolute_error(test_y, base_rfr_pred)
</code></pre>
<p>MAE = 2.188</p>
<p>Then I perform GridSearchCV to get best param... | <p>Apparently the reason I was getting worse performance was because I was using cross validation during HP tuning but not when I built the base model. Hence the issue.</p>
<p>Another mistake was not scaling my data!</p>
<p>Typical noob mistakes!</p>
| 143 |
hyperparameter tuning | Hyperparameter tuning in multiclass classification problem: which scoring metric? | https://datascience.stackexchange.com/questions/30876/hyperparameter-tuning-in-multiclass-classification-problem-which-scoring-metric | <p>I'm working with an imbalanced multi-class dataset. I try to tune the parameters of a <code>DecisionTreeClassifier</code>, <code>RandomForestClassifier</code> and a <code>GradientBoostingClassifier</code> using a randomized search and a bayesian search.</p>
<p>For now, I used just <code>accuracy</code> for the scor... | <p>You should use the same metric to evaluate and to tune the classifiers. If you wull evaluate the final classifier using accuracy, then you must use accuracy to tune the hyper parameters. If you think you should use macro-averaged F1 as the final evaluation of the classifier, use it also to tune them.</p>
<p>On a sid... | 144 |
hyperparameter tuning | Metric to use to choose between different models - Hyperparameters tuning | https://datascience.stackexchange.com/questions/85456/metric-to-use-to-choose-between-different-models-hyperparameters-tuning | <p>I'm building a Feedforward Neural Network with Pytorch and doing hyperparameters tuning using Ray Tune. I have train, validation and test set, train and validation used during the training procedure.
I have different versions of the model (different learning rates and numbers of neurons in the hidden layers) and I h... | <p>Essentially, the function of your <code>testset</code> is to evaluate the performance of your model on new data. It mimics the situation of your model being put into production. The <code>validation set</code> is used for optimizing your algorithm.</p>
<p>Personally I would recommend tuning your algorithm using your... | 145 |
hyperparameter tuning | Hyperparameter Tuning in Random Forest Model | https://datascience.stackexchange.com/questions/81961/hyperparameter-tuning-in-random-forest-model | <p>I'm new to the machine learning field, and I'm learning ML models by practice, and I'm facing an issue while using the machine learning model.</p>
<p>While I'm implementing the <code>RandomForestClassifier model</code> with hyper tunning it's taking too much time to predict output. And I'm also using <code>GridSearc... | <p>You can access the GPU by going to the settings:</p>
<pre><code>Runtime> Change runtime type and select GPU as Hardware accelerator.
</code></pre>
| 146 |
hyperparameter tuning | Minimizing overfitting when doing hyperparameter Tuning | https://datascience.stackexchange.com/questions/60230/minimizing-overfitting-when-doing-hyperparameter-tuning | <p>Generaly when using Sklearn's GridSearchCV (or RandomizedGridSearchCV), we get best model with best test score even if the model overfits a little bit. How can we compute generalization error efficiently and force GridSearchCV to get best model with minimum generalization error?</p>
| 147 | |
hyperparameter tuning | Hyperparameter tuning does not improve accuracy? | https://datascience.stackexchange.com/questions/73526/hyperparameter-tuning-does-not-improve-accuracy | <p>I am working on titanic dataset, I achieved 92% accuracy using random forest. However, the accuracy score dropped to 89% after I tuned it using <code>Gridsearch</code>. Now, I was wondering if it caused by imbalanced dataset, since it has only 342 out of 891 passenger survived the disaster. Would appreciate the clar... | <p>Welcome! You haven't given us enough information to be able to diagnose this issue completely, but you should check your grid search code to see how each cross-validated model is being trained and note which parameters are different from those used with the 92% model. </p>
<p>If it has something to do with the unba... | 148 |
hyperparameter tuning | How to optimally visualise hyperparameter tuning? | https://datascience.stackexchange.com/questions/114645/how-to-optimally-visualise-hyperparameter-tuning | <p>I am working on a basic Neural network and want to show performance of model with respect to different parameters.<a href="https://i.sstatic.net/qvcKB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/qvcKB.png" alt="Here is my dataframe looks like." /></a></p>
<p>I need help with suggestions for impact... | <p>You can use a "Parallel Coordinates" plot, in which</p>
<ul>
<li>A model is represented by a line</li>
<li>Model performance is highlighted in colour</li>
<li>Model hyper-parameters are presented in axes along with their respective values.</li>
</ul>
<p>I attach below an example which you can generate eith... | 149 |
imbalanced datasets | CART classification for imbalanced datasets with R | https://datascience.stackexchange.com/questions/70116/cart-classification-for-imbalanced-datasets-with-r | <p>Hey guys i need your help for a university project. The main Task is to analyze the effects of over/under-smapling on a imbalanced Dataset. But before we can even start with that, our task sheet says, that we 1) have to find/create imbalanced Datasets and 2) fit those with a binary classification model like CART. So... | 150 | |
imbalanced datasets | Model assessment for EXTREMELY imbalanced dataset | https://datascience.stackexchange.com/questions/74014/model-assessment-for-extremely-imbalanced-dataset | <p>I am dealing with an extremely imbalanced dataset, with about 10,000 negative samples for each positive sample.
I am now trying to come up with an adequate measurement of model accuracy but none seem to fit.
Many places recommend the PR curve over the AUC curve for imbalanced datasets (e.g. <a href="https://datasc... | <p>I would only look at the <strong>precision/recall scores of the undersampled class</strong> (the positive class in your case).</p>
<p>Checking the performance on the oversampled class seems quite meaningless, since it is quite easy to achieve very high scores.</p>
<p>Then, balancing the precision/recall with a <em... | 151 |
imbalanced datasets | What cost function and penalty are suitable for imbalanced datasets? | https://datascience.stackexchange.com/questions/3699/what-cost-function-and-penalty-are-suitable-for-imbalanced-datasets | <p>For an imbalanced data set, is it better to choose an L1 or L2 regularization?</p>
<p>Is there a cost function more suitable for imbalanced datasets to improve the model score (<code>log_loss</code> in particular)? </p>
| <p>So you ask <strong>how does class imbalance affect classifier performance under different losses?</strong>
You can make a numeric experiment. </p>
<p>I do binary classification by logistic regression. However, the intuition extends on the broader class of models, in particular, neural networks. I measure performan... | 152 |
imbalanced datasets | RFECV for feature selection for imbalanced dataset | https://datascience.stackexchange.com/questions/104897/rfecv-for-feature-selection-for-imbalanced-dataset | <p>I am new in machine learning and just learned about feature selection. In my project, I have a dataset with 89% being a majority class and 11% as the minority class. Also, I have 24 features. I opted to use Recursive Feature Elimination with Cross-Validation (RFECV in the scikit-learn package) to find the optimal nu... | 153 | |
imbalanced datasets | The most informative curve for imbalance datasets | https://datascience.stackexchange.com/questions/73757/the-most-informative-curve-for-imbalance-datasets | <p>For the imbalanced datasets:</p>
<ol>
<li>Can we say the Precision-Recall curve is more informative, thus accurate, than ROC curve? </li>
<li>Can we rely on F1-score to evaluate the skillfulness of the resulted model in this case?</li>
</ol>
| <p>Precision-recall curves are argued to be more useful than ROC curves in "<a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4349800/" rel="nofollow noreferrer">The Precision-Recall Plot Is More Informative than the ROC Plot When Evaluating Binary Classifiers on Imbalanced Datasets</a>" by Saito and Rehm... | 154 |
imbalanced datasets | Prior probability shift vs oversampling/undersampling imbalanced datasets | https://datascience.stackexchange.com/questions/116527/prior-probability-shift-vs-oversampling-undersampling-imbalanced-datasets | <p>I'm trying to understand what prior probability shift (label drift) in data means.</p>
<p>If I understand it correctly then it means that distribution of labels in training dataset differs compared to distribution of labels in production environment. This difference causes that ML model trained on such data and depl... | 155 | |
imbalanced datasets | Multi class Imbalanced datasets under-sampling imblearn | https://datascience.stackexchange.com/questions/49575/multi-class-imbalanced-datasets-under-sampling-imblearn | <p>I have an imbalanced dataset. I am looking to under-sample. Even though, the oversampling process takes less time, the model training takes a lot of time. I have taken a look at <a href="https://imbalanced-learn.readthedocs.io/en/stable/index.html" rel="nofollow noreferrer">imbalanced-learn</a> website. There are se... | <p>If you're looking for a fast workaround to solve this you have to increase <code>n_neighbors</code> parameter in <code>AllKNN</code>, but I <strong>wouldn't recommend</strong> using this type of undersampling algorithm for what you want to do!</p>
<hr>
<p><strong>Explanation:</strong></p>
<p><a href="https://imba... | 156 |
imbalanced datasets | ROC vs PR-score and imbalanced datasets | https://datascience.stackexchange.com/questions/131105/roc-vs-pr-score-and-imbalanced-datasets | <p>I can see everywhere that when the dataset is imbalanced PR-AUC is a better performance indicator than ROC. From my experience, if the positive class is the most important, and there is higher percentage of positive class than the negative class in the dataset, then PR-AUC seems to be very biased. Actually, the high... | <p>The way to go is to take into account costs in learning: <a href="https://scikit-learn.org/dev/auto_examples/model_selection/plot_cost_sensitive_learning.html" rel="nofollow noreferrer">https://scikit-learn.org/dev/auto_examples/model_selection/plot_cost_sensitive_learning.html</a></p>
<p>For a start you can use tar... | 157 |
imbalanced datasets | Doesn't over(/under)sampling an imbalanced dataset cause issues? | https://datascience.stackexchange.com/questions/93730/doesnt-over-undersampling-an-imbalanced-dataset-cause-issues | <p>I'm reading a lot about how to use different metrics specifically for imbalanced datasets (e.g. two classes present, but 80% of the data is one class) and how to tackle the issue of imbalanced datasets.</p>
<p>One trick is to oversample, so to take more (or even duplicate some) data belonging to the underrepresented... | <p>Yes, the classifier will expect the relative class frequencies in operation to be the same as those in the training set. This means that if you over-sample the minority class in the training set, the classifier is likely to over-predict that class in operational use.</p>
<p>To see why it is best to consider probabi... | 158 |
imbalanced datasets | Ranking problem and imbalanced dataset | https://datascience.stackexchange.com/questions/85453/ranking-problem-and-imbalanced-dataset | <p>I know about the problems that imbalanced dataset will cause when we are working on classification problems. And I know the solution for that including undersampling and oversampling.</p>
<p>I have to work on a Ranking problem(Ranking hotels and evaluate based on NDCG50 score <a href="https://github.com/achilleasath... | <p>You are completely right, imbalance of labels does have an impact on ranking problems and people are using techniques to counter it.</p>
<p>The example in your notebook applies list-wise gradient boosting. Since pairwise ranking can be made list-wise by injecting the NDCG into the gradient, I will focus on pair-wise... | 159 |
imbalanced datasets | Cross validation schema for imbalanced dataset | https://datascience.stackexchange.com/questions/76107/cross-validation-schema-for-imbalanced-dataset | <p>Based on a previous <a href="https://datascience.stackexchange.com/questions/76056/for-imbalanced-classification-should-the-validation-dataset-be-balanced">post</a>, I understand the need to ensure that the validation folds during the CV process have the same imbalanced distribution as the original dataset when trai... | <p>I'm not sure if there's a question here, but I'll add some comments.</p>
<p><strong>Firstly</strong>, if you can get it in the wild, always work with balanced data. However, if you are going to manually create a "balanced" data set yourself, make sure that the selection criteria that you use to create that... | 160 |
imbalanced datasets | upsampling imbalanced dataset in decision tree | https://datascience.stackexchange.com/questions/71978/upsampling-imbalanced-dataset-in-decision-tree | <p>I have a imbalanced dataset with 3 output labels with one class with 98 percent and other two classes with 1 percent each. I need to run decision tree on this dataset. Should i be upsampling this dataset by duplicating rows?
Would this effect the impurity, entropy or information gain for nodes?</p>
| <p>Don't simply duplicate data.</p>
<p>You should do - </p>
<ol>
<li>Oversampling using standard techniques e.g. SMOTe</li>
<li>Undersampling</li>
<li>Class weights</li>
<li>Must try - <strong>Combining</strong> few of these</li>
</ol>
<p>Check these links - </p>
<p><a href="https://machinelearningmastery.com/smote... | 161 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.