20 votes

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
14 votes

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,669
12 votes

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.6k
10 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,239
9 votes

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,948
8 votes

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

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

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

There is the useful dask library for parallel numpy/pandas jobs
Severin Pappadeux's user avatar
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,262
5 votes

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,375
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

What can I do with a Decision Tree with poor ROC

Decision trees has one big quality and one big drawback. Their big quality is that they are what is known as glass-box models. What I mean by that is that they expose what they learn in a very clear ...
rapaio's user avatar
  • 4,723
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

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,327
4 votes

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

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

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

Geometric Interpretation of Whether SVMs are performing well or not

A most interesting paper! Following Opper and Haussler$\dagger$, the authors define a version space; the set of unit vectors which separate the training samples: $\mathcal V \equiv \{ \mathtt w | y_i ...
Emre's user avatar
  • 10.5k
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,371
3 votes

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,382

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