text
stringlengths
81
47k
source
stringlengths
59
147
Question: <p>I need some suggestions to improve my model accuracy.</p> <p>The training data shape is : (166573, 14)</p> <p><a href="https://i.sstatic.net/fFpjX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/fFpjX.png" alt="train data"></a></p> <p>It has all int and float columns. I have dropped <em>c...
https://datascience.stackexchange.com/questions/49668/improving-accuracy-on-highly-imbalanced-dataset
Question: <p>I am currently dealing with a classification problem for a massively imbalanced dataset. More specifically, it is a fraud detection dataset with around 290k rows of data, with distribution of 99.8% for class 0 (non-frauds) and 0.17% for class 1 (frauds).</p> <p>I have been using XGBoost, Random Forest and ...
https://datascience.stackexchange.com/questions/120685/interpretation-of-evaluation-metrics-for-an-imbalanced-dataset
Question: <p>I am dealing with imbalanced dataset and I try to make a predictive model using MLP classifier. Unfortunately the algorithm classifies all the observations from test set to class "1" and hence the f1 score and recall values in classification report are 0. Does anyone know how to deal with it?</p> <pre><co...
https://datascience.stackexchange.com/questions/19801/imbalanced-dataset-in-mlp-classifier-in-python
Question: <p>I have a classifier with a heavily imbalanced dataset (1000 of each negative label for each positive.)</p> <p>I'm running a GradientBoostingClassifier with moderate success (AUC .75) but the curve has this strange look:</p> <p><a href="https://i.sstatic.net/8E0y9.png" rel="nofollow noreferrer"><img src="...
https://datascience.stackexchange.com/questions/24315/roc-curve-shows-strange-results-for-imbalanced-dataset
Question: <p>The xgboost classifier states the use of parameter <code>scale_pos_weight</code> for 2-class problems.</p> <p>I have a highly imbalanced dataset with 3 classes. Classes '1' and '-1' are very rare (~1% of dataset) and class '0' is very common. </p> <p>How do I set this <code>scale_pos_weight</code> parame...
https://datascience.stackexchange.com/questions/43376/imbalanced-dataset-with-3-classes-xgboost-scale-pos-weight-parameter
Question: <p>I have a dataset where around 20% of the data is the positive class and 80% of the data is the negative class. When I undersample and train my classifier on a balanced dataset and test on a balanced dataset, the results are pretty ok. However, if I train on the balanced dataset and test on an imbalanced da...
https://datascience.stackexchange.com/questions/66839/if-a-dataset-is-imbalanced-in-real-life-should-i-train-on-my-machine-learning-m
Question: <p>I like to understand what is the accuracy of an imbalanced dataset.</p> <p>Let's suppose we have a medical dataset and we want to predict the disease among the patients. Say, in an existing dataset 95% of patients do not have a disease, and 5% patients have disease. So clearly, it is an imbalanced dataset....
https://datascience.stackexchange.com/questions/114297/how-to-calculate-accuracy-of-an-imbalanced-dataset
Question: <p>I plan to use many methods to solve the imbalanced dataset problem on the training set. But I couldn't find any paper that describes how they dealt with the test dataset? I assume that they just tested on the original dataset without any adjustments? Will I need to adjust the threshold on the test set with...
https://datascience.stackexchange.com/questions/17873/imbalanced-dataset-how-to-deal-with-test-data
Question: <p>I was wondering what is the right way to proceed when you are dealing with an imbalanced dataset and you want to use a calibrator. When I work with a single model and imbalanced datasets I usually pass &quot;sample_weights&quot; to the model, but I don't know if &quot;sample_weights&quot; should be passed ...
https://datascience.stackexchange.com/questions/108427/should-i-use-sample-weights-on-a-calibrator-if-i-already-used-them-while-train
Question: <p>I have a <strong>text datase</strong>t where I need to train a classifier to classify the titles into categories. The dataset shape is more than 575000. There are 256 target classes here. The problem is the dataset is highly imbalanced. For target <strong>X1 it has 171793 records, X2 has 101575,........Xn-...
https://datascience.stackexchange.com/questions/60936/highly-imbalanced-dataset-fro-classes-more-than-200
Question: <p>Let's suppose that my dataset in a classification problem looks like that:</p> <ol> <li>class A: 50000 observations</li> <li>class B: 2000 observations</li> <li>class C: 800 observations</li> <li>class D: 200 observations</li> </ol> <p>These are some ways which I considered to deal with this imbalanced d...
https://datascience.stackexchange.com/questions/61814/imbalanced-dataset-undersampling-multiple-classifiers
Question: <p>I have a dataset containing thousands of text posts. I am building a binary classifier that will classify posts as <strong>safe (0)</strong> or <strong>risky (1)</strong>. I randomly picked some of them and manually labeled. Label 1 is minority.</p> <p>Imbalanced data results in skewed performance. To ov...
https://datascience.stackexchange.com/questions/24787/zeror-as-baseline-for-balanced-imbalanced-datasets
Question: <p>I have a multi-class prediction problem<br/> but the 300classes is imbalanced <br/> should I make it balance all 300 class will predict the better result? <br/> is there an easier method to do this job?<br/> if I'm using the random-forest imbalance dataset is matter?</p> Answer: <p>Nothing better if you c...
https://datascience.stackexchange.com/questions/67312/imbalanced-target-datasetmulti-class
Question: <p>Im trying to use gridsearch to find the best parameter for my model. Knowing that I have to implement nearmiss undersampling method while doing cross validation, should I fit my gridsearch on my undersampled dataset (no matter which under sampling techniques) or on my entire training data (whole dataset) b...
https://datascience.stackexchange.com/questions/89428/gridsearch-on-imbalanced-datasets
Question: <p>I have used an "adabag"(boosting + bagging) model on an imbalanced dataset (6% positive), I have tried to maximized the sensitivity while keeping the accuracy above 70% and the best results I got were: </p> <ul> <li>ROC= 0.711 </li> <li>SENS=0.94 </li> <li>SPEC=0.21</li> </ul> <p>The results aren't Inhof...
https://datascience.stackexchange.com/questions/18295/improving-classifier-performances-in-r-for-imbalanced-dataset
Question: <p>I have an imbalanced dataset (2:1 ratio) with about 60 patients and 80 features.</p> <p>I performed Recursive Feature Elimination (RFE) and stratified cross validation to reduce the features to 15 and I get an AUC of 0.9 with Logistic regression and/or SVM. I don't fully trust the AUC I got because I think...
https://datascience.stackexchange.com/questions/66779/will-oversampling-help-with-generalization-small-imbalanced-dataset
Question: <p>Let's say that I have a 2-class classification problem where classes <code>A &amp; B</code> have <code>10*N</code> and <code>N</code> observations respectively.</p> <p>I am pretty sure that the answer to my question depends on the specific classification problem and on the features of my dataset etc.. Sti...
https://datascience.stackexchange.com/questions/64706/training-model-on-a-balanced-vs-imbalanced-dataset
Question: <p>There's an imbalanced dataset in a Kaggle competition I'm trying. The target variable of the dataset is binary and it is biased towards 0. 0 - 70% 1 - 30% I tried several machine learning algorithms like Logistic Regression, Random Forest, Decision Trees etc. But all of them give an accuracy around 70%. It...
https://datascience.stackexchange.com/questions/98213/how-to-increase-the-accuracy-of-an-imbalanced-dataset-not-precision
Question: <p><a href="https://i.sstatic.net/5yOLt.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/5yOLt.png" alt="class distribution looks like this" /></a><a href="https://i.sstatic.net/4VseP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/4VseP.png" alt="this is how the dataset looks lik...
https://datascience.stackexchange.com/questions/78400/text-classification-of-an-imbalanced-dataset
Question: <p>Imagine I have a dataset with positive and negative sentences, and I need to train a transformer (Like BERT) to do the binary classification. The problem is that there are 100 negative sentences and 2000 positive sentences. There are libraries for NLP data augmentation like this one: <a href="https://githu...
https://datascience.stackexchange.com/questions/102181/how-much-data-augmentation-is-required-on-an-imbalanced-dataset
Question: <p>I trained a binary classifier for an imbalanced dataset. I did two experiments:</p> <ol> <li><strong>lightgbm classifier, boosting_type='gbdt', objective='cross_entropy', SMOTE upsample</strong></li> </ol> <p>After training the lgbm model, I made predictions on validation dataset. I plotted the probability...
https://datascience.stackexchange.com/questions/102129/binary-classification-with-imbalanced-dataset-about-lightgbm-output-probability
Question: <p>I have a data set collected from Facebook consists of 10 class, each class have 2500 posts, but when count number of unique words in each class, they has different count as shown in the figure <a href="https://i.sstatic.net/eUIMX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/eUIMX.png" alt...
https://datascience.stackexchange.com/questions/45163/imbalanced-dataset-in-text-classififaction
Question: <p>I am trying to make some semantic segmentation. I have 7 imbalanced classes in my case. I found several methods for handling Class Imbalance in a dataset is to perform Undersampling for the Majority Classes or Oversampling for the minority classes. but the most used one is introducing weights in the Loss F...
https://datascience.stackexchange.com/questions/93873/class-weights-formula-for-imbalanced-dataset
Question: <p>I work in the medical domain, so class imbalance is the rule and not the exception. While I know Python has packages for class imbalance, I don't see an option in Orange for e.g. a SMOTE widget. I have read other threads in Stack Exchange regarding this, but I have not found an answer to how to tackle clas...
https://datascience.stackexchange.com/questions/89726/handling-imbalanced-datasets-in-orange
Question: <p>I’m working with an imbalanced dataset to predict strokes, where the positive class (stroke occurrence) is significantly underrepresented. Initially, I used logistic regression, but due to the class imbalance, I switched to a Random Forest model. After applying techniques such as random oversampling and ad...
https://datascience.stackexchange.com/questions/130596/imbalanced-class-in-my-dataset
Question: <p>As an exercise, I'm trying to translate a model written in Keras (<a href="https://github.com/CVxTz/ECG_Heartbeat_Classification/blob/master/code/baseline_mitbih.py" rel="nofollow noreferrer">https://github.com/CVxTz/ECG_Heartbeat_Classification/blob/master/code/baseline_mitbih.py</a>) into Pytorch code. I...
https://datascience.stackexchange.com/questions/130193/understanding-the-model-fit-function-in-keras-and-imbalanced-datasets
Question: <p>I am building a binary classification model which has 17K values as class A and 10K values as class B. I want to know when a dataset can face the issues of "IMBALANCED Dataset" ?</p> Answer: <p>In general there will be not a hard rule about this, but this dataset seems to be like balanced. The point about...
https://datascience.stackexchange.com/questions/53923/around-how-much-difference-between-two-classes-can-be-accounted-as-an-imbalanced
Question: <p>I'm dealing with an imbalanced dataset for binary classification (about 70% to 30%). I was wondering what is the best way to optimize the F1 score for such a task when using a convolutional neural net.</p> <p>As of now, I'm sampling the dataset in order to create a balanced training set and am using the m...
https://datascience.stackexchange.com/questions/15795/f1-maximization-with-convolutional-neural-net-for-an-imbalanced-dataset
Question: <p>I'm facing a problem about making a classification on a dataset. The target variable is binary (with 2 classes, 0 and 1). I have 8,161 samples in the training dataset. And for each class, I have:</p> <ul> <li>class 0: 6,008 samples, 73.6% of total numbers.</li> <li>class 1: 2,153 samples, 26.4%</li> </ul> ...
https://datascience.stackexchange.com/questions/87933/in-which-situation-should-we-consider-a-dataset-as-imbalanced
Question: <p>I am confused whether to use f1 score with 'micro' average or 'macro' average for better evaluation. Given my dataset is highly imbalanced(600:100000)</p> Answer: <p>To summarise this <a href="https://datascience.stackexchange.com/questions/15989/micro-average-vs-macro-average-performance-in-a-multiclass-...
https://datascience.stackexchange.com/questions/58008/choice-of-f1-score-for-highly-imbalanced-dataset
Question: <p>We have a very imbalanced dataset (2% of class 1). To the best of our knowledge, there is no baseline in the literature to the problem we want to solve - so we thought of comparing our performance to a random classifier. We evaluate our model as a combination of precision and recall - we vary the threshold...
https://datascience.stackexchange.com/questions/70155/binary-classification-problem-with-imbalanced-dataset-how-to-compare-to-random
Question: <p>I have a small dataset with 300 rows and an imbalanced class distribution (35% positives). When I fit a logistic regression model, it consistently performs worse than random chance. I’m using stratified cross-validation to evaluate performance, but I’ve noticed a significant variance in results depending o...
https://datascience.stackexchange.com/questions/130738/problem-logistic-regression-vs-tree-based-model-performance-on-small-imbalance
Question: <p>Now I have a task to classify the imbalanced time series datasets using ML classifiers, such as Logistic Regression, Decision Tree, SVM, and KNN. I am not allowed to use the Deep Learning tools, such as CNN and RNN. The time series data is measurements of the Force-Displacement Curve from a production line...
https://datascience.stackexchange.com/questions/62838/data-augmentation-techniques-for-classification-of-imbalanced-time-series-datase
Question: <p>I am performing a Binary Classification over an <strong>imbalanced dataset</strong>:<br /> 0: 16,263<br /> 1: 214</p> <p>I have used multiple oversampling, undersampling, and combination techniques, below are the results that I have obtained: I obtained this plots thanks to this piece of code:</p> <pre><co...
https://datascience.stackexchange.com/questions/112720/low-f1-score-due-to-imbalanced-dataset-even-after-resampling
Question: <p>I have few dataset to experiment classification(Multi-class). These datasets are about 400GB. I wanted to know whether the dataset is balanced or imbalanced. How to know that dataset is balance or imbalanced using any scientific way?</p> Answer: <p>Typically, the representation of each class in a multi-cl...
https://datascience.stackexchange.com/questions/61657/how-to-find-whether-a-dataset-is-blanced-or-imbalanced
Question: <p>Reading the following article: <a href="https://kiwidamien.github.io/how-to-do-cross-validation-when-upsampling-data.html" rel="nofollow noreferrer">https://kiwidamien.github.io/how-to-do-cross-validation-when-upsampling-data.html</a></p> <p>There is an explanation of how to use <code>from imblearn.pipelin...
https://datascience.stackexchange.com/questions/106613/explaining-the-logic-behind-the-pipe-line-method-for-cross-validation-of-imbalan
Question: <p>My training data has extremely <strong>class imbalanced</strong> {0:872525,1:3335} with 100 features. I use xgboost to build classification model with bayessian optimisation to hypertune the model in range <code>{learning rate:(0.001,0.1), min_split_loss:(0.10), max_depth:(3,70), min_child_weight:(1:20), m...
https://datascience.stackexchange.com/questions/90015/hypertune-xgboost-to-dealing-with-imbalanced-dataset
Question: <p>I have some doubts regarding an analysis. I have a dataset with class imbalance. I am trying to investigate some information from that data, e.g., how many urls contain http or https protocols. My results are as follows:</p> <pre><code>http in dataset with class 1: 10 http in dataset with class 0: 109 http...
https://datascience.stackexchange.com/questions/89073/features-selection-in-imbalanced-dataset
Question: <p>I have a small dataset of 150 records with 25 features (too small to do train/test). I'm using nested cv for both hyperparameter tuning and feature selection. 10cv in the outer loop, 5 cv in the inner loop. Eventually i'm getting 10 sets of hyperparameters and 10 sets of selected features. If i'm publishin...
https://datascience.stackexchange.com/questions/85994/nested-cv-feature-selection
Question: <p>I have to perform predictive model over the dataset $D$ (with 1000 obs). From $D$, I extract 700 obs for training $(T)$ and 300 obs for validation $( V )$.</p> <p>I need to perform bootstrap or 10-fold cross validation sampling.</p> <p>The question is which of these sets should I use?</p> <ul> <li><p>Di...
https://datascience.stackexchange.com/questions/11316/which-observation-to-use-when-doing-k-fold-validation-or-boostrap
Question: <p>Recently I have been using LightGBM as regressor in order to predict, on a dataset of 20 thousand observations and 40 variables.</p> <p>I have two modes, <strong>1)</strong> Production and <strong>2)</strong> Testing. The first one just trains a model with the whole dataset. The second does the same with ...
https://datascience.stackexchange.com/questions/46430/80-20-better-than-full-dataset-for-lightgbm
Question: <p>For what I read the 5x2cv t test is</p> <p>"a procedure for comparing the performance of two models (classifiers or regressors) that was proposed by Dietterich to address shortcomings in other methods such as the resampled paired t test and the k-fold cross-validated paired t test"</p> <p>.</p> <p>I am ...
https://datascience.stackexchange.com/questions/56847/choosing-classifiers
Question: <p>So i'm doing <em>cross validation</em> and then i'm predicting using all the data on a test set ( a hold-out set ). My hold-out set has the <strong>same ratio</strong> on a column than the train ( seems thats how the test set was generated, a function that sampled it and tried to preserve the ratio for the...
https://datascience.stackexchange.com/questions/58557/cross-validation-while-preserving-a-column-not-the-target-distribution
Question: <p>My mentor wants me to write and submit an academic paper reporting a predictive model, but without any validation score.</p> <p>Everything I have read in textbooks or the Internet says that this is wrong, but is there any case where only reporting a train score makes sense?</p> <h3>Background</h3> <p>Th...
https://datascience.stackexchange.com/questions/60821/publish-without-validation-score
Question: <p>I've been running kfold cross validation with 10 folds and comparing it against a test set. Logging the score and the stdev along the way. </p> <p>Once I wad happy with my model I then run the estimator through the cross validation with the full data (including the test set) but ... The standard deviation...
https://datascience.stackexchange.com/questions/68182/increasing-samples-increases-variance
Question: <p>When using "K-Fold Cross Validtion" for Neural Net, do we:</p> <ol> <li>Pick <strong>and save</strong> initial weights of the network randomly (let's call it $W_0$)</li> <li>Split data into $N$ equal chunks</li> <li>Train model on $N-1$ chunks, validating against the left-out chunk (the $K$'th chunk)</li>...
https://datascience.stackexchange.com/questions/28542/cross-validation-how-to-determine-when-to-early-stop
Question: <p>I have on my uni lecture notes that one of the n-fold cross-validation disadvantages is that it is very expensive to train this because this could take a long time if the dataset is very large. But they say that this is not the case if we use k-nearest neighbors classifier. I know to some extend what a k-n...
https://datascience.stackexchange.com/questions/109729/why-is-n-fold-cross-validation-not-expensive-for-k-nearest-neighbours
Question: <p>You split the data in k subsamples. Train it on k-1 subsamples, test it on kth subsample, record the performance with some error merric.</p> <p>Do it k times for each of the k subsamples, record the error each time. Then choose the model with the lowest error? Is it the same as ensemble technique?</p> An...
https://datascience.stackexchange.com/questions/26669/how-does-k-fold-cross-validation-work
Question: <p>let me begin by saying that I understand how to build a stacked ensemble by using cross-validation to generate out-of-fold predictions for the base learners to generate meta-features. My question is about the methodology when cross-validating the entire stacked ensemble to check generalization error.</p> ...
https://datascience.stackexchange.com/questions/17317/cross-validation-of-a-cross-validated-stacking-ensemble
Question: <p>My textbook states that k-fold cross-validation is a resampling technique that is useful for estimating generalization error in a data-poor setting.</p> <blockquote> <p>Ideally, if we had enough data, we would set aside a validation set and use it to assess the performance of our prediction model. Since da...
https://datascience.stackexchange.com/questions/108474/should-i-use-gridsearch-cv-for-hyper-parameter-tuning-in-a-data-rich-context
Question: <p>In google's crash course on <a href="https://developers.google.com/machine-learning/crash-course/validation/another-partition" rel="nofollow noreferrer">ML</a>, I have read an interesting tip on train&amp;validation sets. they say</p> <blockquote> <p>'Test sets and validation sets &quot;wear out&quot; with...
https://datascience.stackexchange.com/questions/118122/how-and-why-do-training-and-cross-validations-sets-wear-out-in-time
Question: <p>I have seen this in two Papers:</p> <p>The authors use 10 fold cross validation, and then present the results from this validation or even odder the results from the best Fold as their modelling Result. </p> <p>there has been no testing data put aside to validate the final model. These are peer reviewed ...
https://datascience.stackexchange.com/questions/49571/can-we-use-k-fold-cross-validation-without-any-extra-excluded-test-set
Question: <p>We do the following:</p> <ol> <li>split <code>data_all</code> into K folds, each consisting of <code>data_train_k</code> and <code>data_test_k</code> where k = 0, ... K-1.</li> <li>for each k in 0, ... K-1, split <code>data_train_k</code> into M folds each consisting of <code>data_train_k,m</code> and <cod...
https://datascience.stackexchange.com/questions/120428/does-double-cross-validation-make-sense
Question: <p>Does cross_val_score in scikit-learn split the data consistently or randomly? I noticed that cross_val_score lacks a random_state parameter, but the documentation mentions stratified k-fold cross-validation, which is implemented in the StratifiedKFold class that does have a random_state parameter for shuff...
https://datascience.stackexchange.com/questions/121673/scikit-learn-cross-val-score-randomness
Question: <p>I have done a 10 fold Cross Validation on my data and have selected the best model from the results. With cross validation, I will have 10 models trained from different folds of the data. For the final model to use, should I take the average of the models or just fit a model for the entire training set?</p...
https://datascience.stackexchange.com/questions/56108/best-practice-with-cross-validation
Question: <p>Let's say we have model M1 and model M2 that we want to compare. When we do 5-fold (say) cross validation, would the correct method to be to partition the data into F1, F2, F3, F4, and F5 and then run both models through those folds? Then would the way to assess if M2 outperforms M1 be to do a paired t-tes...
https://datascience.stackexchange.com/questions/51703/cross-validation-for-model-comparison-use-the-same-folds
Question: <p>I found a question (Question 7) <a href="https://www.sanfoundry.com/data-science-questions-answers-cross-validation/" rel="nofollow noreferrer">here</a>:</p> <blockquote> <p>Question: For k cross-validation, larger k value implies more bias <br> Options: True or False</p> </blockquote> <p>My answer is: <s...
https://datascience.stackexchange.com/questions/92902/cross-validation-and-bias-relation
Question: <p>I do not get why in <a href="https://datascience.stackexchange.com/questions/123130/for-cross-validation-should-i-use-training-set-or-whole-dataset">For cross validation should I use training set, or whole dataset?</a> the responses say that cross validation must be done exclusively on training set. Doesn'...
https://datascience.stackexchange.com/questions/128741/cross-validation
Question: <p>Context: I'm training an RNN with LSTM layers using the keras api. I have sequences of 20 timesteps, but just a binary response. For example: X=[[[1,2,3], [2,3,1]], [[4,1,2], [2,1,3]]], and y = [[1.0], [0.0]]. The binary variable y explains the action of the <strong>next</strong> timestep, because that is ...
https://datascience.stackexchange.com/questions/18174/what-might-explain-a-dramatic-vertical-jump-in-sensitivity
Question: <p>I'd like to get an intuition about how varying <em>k</em> impacts k-fold validation. Is the following right?</p> <p><strong>Average of the OOS MSEs should generally <em>decrease</em> with k</strong> Because, a bigger "k" means the training sets are larger, so we have more data to fit the model (assuming...
https://datascience.stackexchange.com/questions/37150/k-fold-crossvalidation-how-do-mse-average-and-variance-vary-with-k
Question: <h3>Repeated K-Fold vs Group K-Fold</h3> <p>As per my understanding from sklearn docs</p> <p><strong>Repeated K-Fold:</strong></p> <p>RepeatedKFold repeats K-Fold n times. It can be used when one requires to run KFold n times, producing different splits in each repetition.</p> <p><strong>Repeated Stratifi...
https://datascience.stackexchange.com/questions/63901/cross-validation-repeated-k-fold-group-k-fold
Question: <p>It's my understanding that selecting for small models, i.e. having a multi-objective function where you're optimizing for both model accuracy and simplicity, automatically takes care of the danger of overfitting the data.</p> <p>Do I have this right?</p> <p>It would be very convenient for my use case to be...
https://datascience.stackexchange.com/questions/92571/does-adding-a-model-complexity-penalty-to-the-loss-function-allow-you-to-skip-cr
Question: <p>I am new to machine learning, though I have a background in statistics. But I had a question about $k$-fold cross-validation. So I understand the basic idea that we divide the dataset into $k$ partitions and then train a model on $k-1$ partitions while testing on the $k$th partition that was left out. So w...
https://datascience.stackexchange.com/questions/28420/k-fold-cross-validation-model-selection-or-variation-in-models-when-using-k-fol
Question: <p>I fully understand the data partition in a nested k-fold CV. But reading this:</p> <blockquote> <p>Within each outer fold, the best performing model was selected based on mean root mean squared error (RMSE) over the inner folds. The model was then retrained on all training and validation data from the inne...
https://datascience.stackexchange.com/questions/123711/trying-to-understand-nested-k-fold-cv-in-a-paper
Question: <p>My course notes list two reasons why cross-validation has a pessimistic bias. The first one is that the accuracy is measured for models that are trained on less data, which I understand. However, the second reason I don't understand. Supposedly, when we do cross validation and divide our data D into traini...
https://datascience.stackexchange.com/questions/84754/why-does-cross-validation-have-a-pessimistic-bias
Question: <p>I am trying to train and validate my datasets which contains 17 datasets. I have divided them as 15 for training and 2 for validation. In the process, I train on 15 datasets and use the generated model to predict the results on the remaining 2 datasets. This process is called leave out validation in my un...
https://datascience.stackexchange.com/questions/101754/leave-one-pair-out-cross-validation
Question: <p>I'm trying to do nested CV for my multivariate time series but I'm really confused how to do it. I have 7 Time series which are the inputs of my CNN model and one time series as target.Always when I read about it I found they talk about univariate.Any advices</p> Answer:
https://datascience.stackexchange.com/questions/78122/how-can-i-do-nested-cross-validation-for-multivariate-time-series-forecsting
Question: <p>Let's say I have 5 models cross-validated via leave-one-out strategy. I have the predictions and scores of each model.</p> <p>Now, it's time to calculate the average for the set of 5 models - am I supposed to:</p> <ul> <li>add up the 5 losses and divide them by 5?</li> <li>Or average their probabilities fo...
https://datascience.stackexchange.com/questions/87290/cross-validated-average-metrics-mean-or-ensembling-probabilities
Question: <p>I am all new with ML. I try to understand what is Kfold and cross_val_score.<br /> I made this model:</p> <pre><code>RandomForestRegressor(max_depth=17,n_estimators=93,criterion='mse') modelfinal.fit(xtrain1, ytrain1) mrse_test = np.sqrt(mean_squared_error(y_pred=modelfinal.predict(xtest1), y_true=ytest1))...
https://datascience.stackexchange.com/questions/87709/kfold-or-cross-val-score
Question: <p>I asked a data science question regarding how to decide on the best variation of a split test on the Statistics section of StackExchange. I hope I will have better luck here. The question is basically, "Why is mean revenue per user the best metric to make your decision on in a split test?"</p> <p>The orig...
https://datascience.stackexchange.com/questions/748/why-use-mean-revenue-in-a-split-test
Question: <p>As I understand it one can use cross validation to help find the optimal pruning of a classification or regression tree, for example, implemented here in <a href="http://au.mathworks.com/help/stats/classificationtree.cvloss.html#bunpajd-1" rel="noreferrer">Matlab</a>. </p> <p>I do not understand the follo...
https://datascience.stackexchange.com/questions/8598/how-is-cross-validation-used-to-prune-a-decision-tree
Question: <p>Is there a way to directly calculate an approximate quad weighted kappa measure from an OOB estimate, obtained from a gradient boosting model with subsampling without going through cross validation?</p> Answer:
https://datascience.stackexchange.com/questions/9923/convert-out-of-bag-oob-estimate-to-quad-weighted-kappa-score
Question: <p><strong>Background:</strong> I am trying to use Orange as to classify if a patient has TB based on their coughing sounds.</p> <p>In the dataset, there are say 100 patients and for each patient we have 10 coughs. For each cough, we have a full feature vector (170 features). </p> <p>Giving Orange this data...
https://datascience.stackexchange.com/questions/10824/is-it-possible-to-create-feature-groups-in-orange
Question: <p>I have a regression problem and I am in doubt about how I can calculate RMSE in my life-cycle.</p> <p>I deal with time-series and for every prediction, I want to look N points in the future. It is apparent how to calculate RMSE for a single iteration. My question is how to calculate RMSE for N predictions...
https://datascience.stackexchange.com/questions/13411/cross-validation-strategy
Question: <p>What could be the possible reasons for a significant difference in cross validation and testing f1_scores? I am performing 3 fold Stratified cross validation and the testing f1_score is almost 0.15 less than cross validation score. How can I come up with a more effective cross validation strategy so that t...
https://datascience.stackexchange.com/questions/13753/significant-difference-in-testing-vs-cross-validation-accuracy
Question: <p>I have written a function for 10 fold crossvalidation that I want to use for different models, e.g PPR, MARS. However, I get an error when running it and I cannot figure out why it does not work? My CV function:</p> <pre><code> cv10 &lt;- function(reg.fn, formula, dataset, ...) { set.seed(201) ###...
https://datascience.stackexchange.com/questions/22247/r-function-for-10-fold-crossvalidation
Question: <p>I have done 10-Fold CV on my data and I have selected my model complexity from the result. Now for my best complexity, I will be having 10 different models. Should I take the average of these models for my testing or should I just fit a model of our selected complexity on our CV data and then test?</p> An...
https://datascience.stackexchange.com/questions/23277/cross-validation-model-selection
Question: <p>When K-fold validation should be used and how to decide the value of the K. I see most of the text books suggesting implementation of algorithms using 2/3 of data as train and 1/3 of data as test</p> Answer: <p>The main criterion is that you need enough data in your training set to get a good model fit - ...
https://datascience.stackexchange.com/questions/29607/how-to-decide-to-use-k-fold-validation-or-not
Question: <p>Say I've divided the data into 3 parts: training, validation and test. I know for example, that in Neural Networks, the number of hidden layers is a hyper parameter. Why can't I train numerous NN architectures in the training set and then test their accuracy in the test set; thereby allowing me to choose o...
https://datascience.stackexchange.com/questions/31662/why-cant-i-choose-my-hyper-parameter-in-the-training-set
Question: <p>What is the correct procedure for using a validation set to reduce overfitting? </p> <p>Say I split the data 80:10:10 (training: validation:test). I train on the training set then get 90% accuracy. I apply this model to the validation set then get 20%. What do I do then? </p> <p>How can the validation se...
https://datascience.stackexchange.com/questions/40860/how-can-one-use-a-validation-set-to-reduce-overfitting-naive-bayes
Question: <p>Say we have N of labeled data, and we need to take some part for the <code>cross validation</code> (we will skip <code>test</code> part for this case). We chose, 0.6 part for the training and 0.4 for validation. </p> <p>After training neural Network with <code>early stop</code>, we have found 8 epochs, as...
https://datascience.stackexchange.com/questions/46700/change-rate-of-cross-validation-data-after-training
Question: <p>I have a methodology question: are hold-out and CV generalization-optimization techniques mutually exclusive? It gets really confusing to me at times, because in the most recent project I have been doing something as follows:</p> <ul> <li>I have split the dataset into TRAIN and TEST sets (with stratified ...
https://datascience.stackexchange.com/questions/51984/applying-hold-out-and-cv-technique
Question: <p>I'm trying to replicate result of a paper. The paper is a U-net for De-noising of some images. So basically I have a simple U-net that I give noisy data as input and have denoised data as the wanted output (use l2/MSE loss) . So, in the paper and generally in most papers like this (deep learning applied to...
https://datascience.stackexchange.com/questions/55093/training-deep-learning-and-validation-loss
Question: <p>Currently, I have trained my model through 5-fold cross validation with very small amount of the sample (n=100).</p> <p>I used whole data set to train and got quite low performance in terms of accuracy, which is bit higher than 70%.</p> <p>However, if I put my data which was used for training back to tra...
https://datascience.stackexchange.com/questions/56109/is-it-okay-to-use-training-data-for-validifying-the-trained-model
Question: <p>I'm trying to run cross validation with mean squared log error with sklearn and getting the following error message:</p> <pre class="lang-py prettyprint-override"><code>ValueError: Mean Squared Logarithmic Error cannot be used when targets contain negative values. </code></pre> <p>This would suggest that...
https://datascience.stackexchange.com/questions/61595/value-error-msle-crossval
Question: <p>I have a relatively small dataset consisting of 1432 samples.</p> <p>I have trained a Random Forest Classifier and performed KFold CV. The results of running 10 Fold CV are as follows:</p> <pre><code>=== 10 Fold Cross Validation Scores === CVFold 1 = 90.2% CVFold 2 = 87.6% CVFold 3 = 86.7% CVFold 4 = 86...
https://datascience.stackexchange.com/questions/64092/acceptable-variation-in-accuracy-of-each-k-fold-when-using-k-fold-cross-validati
Question: <p>I have found the following definitions, but I don't really see the difference.</p> <p><strong>cross validation</strong> Method for testing classification and prediction models. The data are randomly split into N partitions (typically N=10) and then N times a model is created from N-1 partitions and tested...
https://datascience.stackexchange.com/questions/64094/cross-validation-vs-leave-one-out
Question: <p>I would first like to create few multiple regression models based on if the models violate any multiple regression assumptions and how well it fits the training data. Then I would like to compare how well these models predict new observations by using 5-fold Cross Validation. From my understanding 5-fold C...
https://datascience.stackexchange.com/questions/64436/multiple-linear-regression-with-k-fold-cross-validation
Question: <p>I have sparse vectors and found that cosine similarity is very efficient to to measure the similarity. Now I want to cluster these vectors based on similarity. Hence, can someone please suggest/recommend clustering algorithms that make use of cosine similarity?</p> <p>P.S.: I do not have a predefined numb...
https://datascience.stackexchange.com/questions/20120/clustering-algorithms
Question: <p>How can I show clustering performance of various clustering algorithms on various datasets using adjusted mutual information and adjusted rand index. for instance, the plot below</p> <p>.<a href="https://i.sstatic.net/LNGbe.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LNGbe.png" alt="ent...
https://datascience.stackexchange.com/questions/106304/clustering-algorithms-evaluation
Question: <p>I am looking for an <strong><em>incremental</em></strong> clustering algorithm. By <strong><em>incremental</em></strong> I mean an algorithm that builds clusters starting from an initial dataset and that is able to progressively ingest new items/observations adding them to existing or new clusters.</p> <p>...
https://datascience.stackexchange.com/questions/116664/incremental-clustering-algorithm
Question: <p>I have a dataset with 10,000 genes like below</p> <pre><code>person gene1 gene2 ... gene10000 ethnic 1 0 1 1 asian 2 1 0 1 European </code></pre> <p>Each row means, whether a person has a gene in their DNA or not. We are trying to classify different ...
https://datascience.stackexchange.com/questions/23591/clustering-algorithms-for-high-dimensional-binary-sparse-data
Question: <p>I am wondering what's the best way to handle outliers when using non-supervised clustering algorithms?</p> Answer: <p>If you have outliers, the best way is to <strong>use a clustering algorithm that can handle them</strong>.</p> <p>For example DBSCAN clustering is robust against outliers when you choose ...
https://datascience.stackexchange.com/questions/63695/how-to-handle-outliers-for-clustering-algorithms
Question: <p>I have a set of time series data that I would like to feed into a clustering algorithm (like k-means, using dynamic time warping as the distance function). After standardizing the data with mean 0 and variance 1, the k-means classifier generated a batch of centroids that seemed to fit the data pretty well....
https://datascience.stackexchange.com/questions/54041/stationary-time-series-for-clustering-algorithms
Question: <p>As a newbie, I am interested what the major drawbacks of traditional clustering algorithms are. The purpose is to understand for which class of data or in which scenarios I shouldn't use traditional clustering methods (e.g. K-means)</p> Answer: <p>Check out this great answer for K-means in particular:</p>...
https://datascience.stackexchange.com/questions/28361/what-are-the-drawbacks-of-traditional-clustering-algorithms
Question: <p>Is feature scaling useful for <a href="https://en.wikipedia.org/wiki/Cluster_analysis" rel="noreferrer">clustering algorithms</a>? What type of features, I mean numeric, categorical etc., are most efficient for clustering?</p> Answer: <p>Clustering algorithms are certainly effected by the feature scaling....
https://datascience.stackexchange.com/questions/22795/do-clustering-algorithms-need-feature-scaling-in-the-pre-processing-stage
Question: <p>Often clustering algorithms only output a bunch of class labels, and do not provide any sort of interpretation of the classes formed by the algorithm. It seems to me not entirely unreasonable to attempt to get some sort of interpretation by using the class labels provided by the clustering algorithm as the...
https://datascience.stackexchange.com/questions/26235/using-classification-algorithms-to-interpret-clustering-reuslts
Question: <p>I am experimenting with clustering algorithms, like K-Means. Right now, I use all variables as input for the clustering algorithm. I am wondering if it is appropriate to do feature selection for clustering algorithms. That is, how can I find those variables that are most important or least important for cl...
https://datascience.stackexchange.com/questions/103200/find-most-important-and-least-important-features-for-clustering-algorithm
Question: <p>I am working on a project witht the goal of clustering participants of in a survey according to their answers. The dataset is a set of 63 questions, some nominal and some ordinal. How should I encode the data before using dimensionality reduction algorithms like tsne amd then clustering algorithms like kme...
https://datascience.stackexchange.com/questions/129530/how-to-preprocess-encode-categorical-data-to-use-in-dimensionality-reduction-an
Question: <p>I am trying to compare different clustering algorithms for my text data. I first calculated the tf-idf matrix and used it for the cosine distance matrix (cosine similarity). Then I used this distance matrix for K-means and Hierarchical clustering (ward and dendrogram). I want to use the distance matrix for...
https://datascience.stackexchange.com/questions/69183/how-to-use-cosine-distance-matrix-for-clustering-algorithms-like-mean-shift-dbs