Skip to main content
20 votes
Accepted

Improve Pandas dataframe filtering speed

The concept to understand is that the conditional is actually a vector. So, you can simply define the conditions, and then combine them logically, like: ...
Stephen Rauch's user avatar
  • 1,783
16 votes
Accepted

Why ML model produces different results despite random_state defined? And how to set global random seed for sklearn

Not every seed is the same. Here is a definitive function that sets ALL of your seeds and you can expect complete reproducibility: ...
Noah Weber's user avatar
  • 5,699
12 votes

FP16, FP32 - what is it all about? or is it just Bitsize for Float-Values (Python)

FP32 and FP16 mean 32-bit floating point and 16-bit floating point. GPUs originally focused on FP32 because these are the calculations needed for 3D games. Nowadays a lot of GPUs have native support ...
keiv.fly's user avatar
  • 1,269
12 votes
Accepted

Using a random forest, would a RandomForest performance be less if I drop the first or the last tree?

The two slightly-smaller models will perform exactly the same, on average. There is no difference baked in to the different trees: "the last tree will be the best trained" is not true. The ...
Ben Reiniger's user avatar
  • 11.9k
9 votes
Accepted

What is the best performance metric used in balancing dataset using SMOTE technique

First of all, just to be clear, you shouldn't evaluate the performance of your models on the balanced data set. What you should do is to split your dataset into a train and a test set with ideally the ...
Djib2011's user avatar
  • 7,998
8 votes
Accepted

Estimating Titan X graphics card impact on performance

There are a lot of parameters which matter when using GPU's for machine learning, some of them are: CUDA core count Memory bandwidth (GB/s) Memory per core (MB) Raw Speed (MHz) Total Memory available ...
Sandeep S. Sandhu's user avatar
7 votes

How to compare the performance of feature selection methods?

This is a hard problem and researchers are making a lot of progress. If you're looking for supervised feature selection, I'd recommend LASSO and its variants. Evaluation of the algorithm is very ...
franciscojavierarceo's user avatar
7 votes
Accepted

Improve Precision of a binary classifier - Decision Tree in Python

I guess differences in accuracies between class 0 and class 1 come from the class_weight parameter you have used. Class 1 will benefit from this overweighting towards class 0. You could try to play on ...
Theudbald's user avatar
  • 1,068
7 votes

Can the F1 score be equal to zero?

F1 will never be zero, but very near to zero for a bad classifier. If TP or TN is zero then there isn't any need to check F1.
Gaurav Koradiya's user avatar
6 votes

Improve Pandas dataframe filtering speed

Have you timed which line of your code is most time consuming? I suspect that the line df = df[~df.isin(df1)].dropna() would take a long time. Would it be faster if ...
Albert's user avatar
  • 106
6 votes

How label smoothing and label flipping increases the performance of a machine learning model

Label flipping is a training technique where one selectively manipulates the labels in order to make the model more robust against label noise and associated attacks - the specifics depend a lot on ...
Vlad_Z's user avatar
  • 620
5 votes

Why doesn't training RNNs use 100% of the GPU?

I get about this same utilization rate when I train models using Tensorflow. The reason is pretty clear in my case, I'm manually choosing a random batch of samples and calling the optimization for ...
davidparks21's user avatar
5 votes

Performance measure: Why is it called recall and sensitivity?

I think the term "sensitivity" comes from the world of medical tests. A very sensitive test will test positive for most or all people who take the test and really have a disease, as well as for many ...
cumin's user avatar
  • 151
5 votes

Log loss vs accuracy for deciding between different learning rates?

According to me, it is not correct to co-relate loss with accuracy. Loss is used to optimize the hypothesis such that we can get best weights whereas accuracy is used to identify how well model ...
vipin bansal's user avatar
  • 1,272
5 votes
Accepted

AUC ROC in keras is different when using tensorflow or scikit functions.

No, you shouldn't have the same numbers. All depends on the additional parameters: ...
Matthieu Brucher's user avatar
5 votes

Can the F1 score be equal to zero?

It's a mistake on Wikipedia. $F_{1}$ as the harmonic mean is defined only at positive real numbers. $PRE$ or $REC$ could be equal 0 in case $TP=0$. Which provides to undefined result $F_1=\frac{0}{0}...
fuwiak's user avatar
  • 1,373
4 votes

Performance measure: Why is it called recall and sensitivity?

Recall means to bring back or remember. The terminology comes from information retrieval where it's usually being applied to a result set from a query. I suppose the sense of it is, how much of the ...
Sean Owen's user avatar
  • 6,595
4 votes

How big is big data?

Data is "Big Data" if it is of such volume that it is less expensive to analyze it on two or more commodity computers, than on one high-end computer. This is essentially how Google's "BigFiles" file ...
Neil McGuigan's user avatar
4 votes
Accepted

Is R2 score a reasonable regression measure on huge datasets?

The coefficient of determination $r^2$ is defined in terms of variance: it is the proportion of variance in the dependent variable that is explained by the independent variable. Variance is a property ...
Pieter's user avatar
  • 961
4 votes

Metrics to determine K in K-cross fold validation

The rule of thumb is the higher K, the better. I think a better rule of thumb is: The larger your dataset, the less important is $k$. However, it is useful to have a general understanding of the ...
oW_'s user avatar
  • 6,367
4 votes
Accepted

Once a predictive model is in production, how it can be evaluated?

This is in fact a very good question. The answer is simple, but depends on the case. In general, what we do after pushing a model to production we apply an audit process. Let me explain: in reality ...
Bashar Haddad's user avatar
3 votes

Training And Testing Error Curves caret package in r

Here we are creating data to for a given model. The main advantage with this code snippet is you are able to see how the model performers over various sizes of the training set. The ...
Society of Data Scientists's user avatar
3 votes

Is there a straightforward way to run pandas.DataFrame.isin in parallel?

There is a more common version of this question regarding parallelization on pandas apply function - so this is a refreshing question :) First, I want to mention swifter since you asked for a "...
mork's user avatar
  • 359
3 votes

How do I compare traditional classifiers performance with my proposed method?

What about doing cross validation on your training set? Once you have the different train/test splits I would start by printing the accuracy (number of correct predictions / total predictions) and the ...
h3h325's user avatar
  • 253
3 votes

how should I measure performance if there is no test data?

If you are working with only enough data for training and validation, consider using K-Fold Cross Validation: One of the main reasons for using cross-validation instead of using the conventional ...
Imran's user avatar
  • 2,381
3 votes
Accepted

What makes you confident in your results? At what point do you think you can present your work to tech illiterate superiors?

Hey Welcome to the Site! What you are saying is right, Data Science din't reach to the stage where it has some standard methods for achieving this(standard procedures, don't know we would be able to ...
Toros91's user avatar
  • 2,392
3 votes

Does Sampling size matters in Multi classification Model

It is always better to keep sample sizes close each other. The problem you are facing is Imbalanced Classification. There are lots of methods you can apply such as upsampling/downsampling, synthetic ...
Ilker Kurtulus's user avatar
3 votes
Accepted

What is done first, cross validation or grid search?

Well, grid search involves finding best hyperparameters. Best according to what data set? a held out validation set. If that's what you mean by cross validation, then they necessarily happen ...
Sean Owen's user avatar
  • 6,595
3 votes

Using a random forest, would a RandomForest performance be less if I drop the first or the last tree?

In Random Forest, each tree of the forest is trained independant from the others. There's no relation between trees. To summarise very quickly, if you have a dataset with 10 attributes, each tree will ...
Adept's user avatar
  • 874

Only top scored, non community-wiki answers of a minimum length are eligible