New answers tagged

2

I believe that there's no actual function in sklearn library that does that. However, that concept is relatively easy to implement: you can loop and compare each y_prediction with the respective y_true_value and increment TN, TP, FN, and FP accordingly to a certain threshold. For example: if abs(y_pred[i] - y_true[i]) <= threshold: TP += 1 elif ...


0

Based on this, both models generalize equally well. However both have overfit, the second one more significantly. You simply want to avoid that. For example, I'd expect the best validation loss to be closer to training loss if you're using early stopping. You can turn up things like dropout. If you do so, I think you'll find the augmented model ends up ...


2

There could be many reasons why you achieved 100% accuracy.One of them could be:Duplicates in your data which are repetitive in both train and test data.I would suggest you to try the following steps: 1.Check if there are any duplicates in the original data 2. Try a different Train-Test split like 80-20 3.Try k-Fold cross validation 4.Checkout for Precision ...


1

You are doing the split right, training in the train set and then testing in the test set. Seems weird yes. With out seeing your data, have you droped the target from the with you are trainning?? This could be a reason why you have a 100% accuracy. Other thing you could try is to plot the feature importance and check which features are contributing to the ...


3

Does the validation score's standard deviation have a correlation with overfitting / error Yes definitely: a high variance shows that the model is not stable across different training sets, which indicates a high risk of overfitting. and can this be used in my scoring? Using the std dev directly in the scoring itself, I'm not sure. I would consider ...


1

Your reasoning is perfectly correct. Augmentation is just a process, which helps you cover your domain better. You should only pick operators that help you. Abusing augmentation can definitely mess up your model. It's always good idea to print data at those limits, to check yourself. Try also to think, how data will be acquired on production. Albumentations ...


0

I have the same problem, too. It is the dataset error. I find that the training dataset loaded is the Fashion-MNIST dataset, while the test dataset is the the MNIST dataset. So, I download the original Fashion-MNIST dataset from the official site https://github.com/zalandoresearch/fashion-mnist


0

You have to transform your $ y_{pred} $ continuos values into binary. In python it looks like something like this: y_pred_binary = [1 if value>=0 else 0 for value in y_pred]


1

It is better to formulate this problem in terms of classification, not regression. For example, you can apply sign transformation on your labels (e.g. $y = numpy.sign(y)$) before training the model, then fit the model with classification loss (like binary cross-entropy), and then you can use accuracy for measuring the performance. Using accuracy with ...


0

I think this covers your issue in the Keras documentation https://keras.io/callbacks/#create-a-callback class LossHistory(keras.callbacks.Callback): def on_train_begin(self, logs={}): self.losses = [] def on_batch_end(self, batch, logs={}): self.losses.append(logs.get('loss')) model = Sequential() model.add(Dense(10, input_dim=784, ...


Top 50 recent answers are included