id
int64
1
141k
title
stringlengths
15
150
body
stringlengths
45
28.5k
tags
stringlengths
1
102
label
int64
1
1
text
stringlengths
128
28.6k
source
stringclasses
1 value
93,896
What do you do with one hot encoding items that are a non-match for all classes in a confusion matrix?
<p>I have trained a model for one-hot binary prediction for many classes, and am now applying it to the testing set of samples. However, a lot of the predictions for samples are 0 for every class. I'm not sure what to do with these results, as I need to make a confusion matrix (nxn for the number of classes) but I don'...
confusion matrix one hot encoding
1
What do you do with one hot encoding items that are a non-match for all classes in a confusion matrix? -- (confusion matrix one hot encoding) <p>I have trained a model for one-hot binary prediction for many classes, and am now applying it to the testing set of samples. However, a lot of the predictions for samples are ...
habedi/stack-exchange-dataset
93,897
Using scikit-learn iterative imputer with extra tree regressor eats a lot of RAM
<p>I'm imputing a table around 150K by 60 floats and has about 45% missing values, I'm using ExtraTreeRegressor with IterativeImputer</p>&#xA;<pre><code>IterativeImputer(max_iter=&lt;num_iter&gt;,&#xA; initial_strategy = 'most_frequent',&#xA; verbose=True,&#xA; estimator=...
scikit learn data imputation
1
Using scikit-learn iterative imputer with extra tree regressor eats a lot of RAM -- (scikit learn data imputation) <p>I'm imputing a table around 150K by 60 floats and has about 45% missing values, I'm using ExtraTreeRegressor with IterativeImputer</p>&#xA;<pre><code>IterativeImputer(max_iter=&lt;num_iter&gt;,&#xA; ...
habedi/stack-exchange-dataset
93,902
Why is the kernel of a Convolutional layer a 4D-tensor and not a 3D one?
<p>I am doing my final degree project on Convolutional Networks and trying to understand the explanation shown in Deep Learning book by Ian Goodfellow et al.</p>&#xA;<p>When defining convolution for 2D images, the expression is:</p>&#xA;<p><span class="math-container">$$S(i,j) = (K*I)(i,j) = \sum_{m}\sum_{n}I(i+m,j+n)K...
deep learning neural network cnn convolutional neural network convolution
1
Why is the kernel of a Convolutional layer a 4D-tensor and not a 3D one? -- (deep learning neural network cnn convolutional neural network convolution) <p>I am doing my final degree project on Convolutional Networks and trying to understand the explanation shown in Deep Learning book by Ian Goodfellow et al.</p>&#xA;<p...
habedi/stack-exchange-dataset
93,918
Train and predict two labels in a single process
<p>I have a python program that makes predictions using scikit-learn <code>RandomForestClassifier</code>. The label is called &quot;default&quot; and it's the default status of a loan. This works fine.</p>&#xA;<p>What I need now is to extend this model, and have another label called &quot;Prepayment Percentage&quot; th...
machine learning python scikit learn random forest machine learning model
1
Train and predict two labels in a single process -- (machine learning python scikit learn random forest machine learning model) <p>I have a python program that makes predictions using scikit-learn <code>RandomForestClassifier</code>. The label is called &quot;default&quot; and it's the default status of a loan. This wo...
habedi/stack-exchange-dataset
93,931
BERT embedding layer
<p>I am trying to figure how the embedding layer works for the pretrained BERT-base model. I am using pytorch and trying to dissect the following model:</p>&#xA;<pre><code>import torch&#xA;model = torch.hub.load('huggingface/pytorch-transformers', 'model', 'bert-base-uncased')&#xA;model.embeddings&#xA;</code></pre>&#xA...
nlp bert
1
BERT embedding layer -- (nlp bert) <p>I am trying to figure how the embedding layer works for the pretrained BERT-base model. I am using pytorch and trying to dissect the following model:</p>&#xA;<pre><code>import torch&#xA;model = torch.hub.load('huggingface/pytorch-transformers', 'model', 'bert-base-uncased')&#xA;mod...
habedi/stack-exchange-dataset
93,941
Create a continuous heatmap
<p>Most heatmap tutorials look at discrete data, where each cell has a well-defined boundary and a single value. How do you create a heatmap of continuous data, where individual points may be very close together without actually being identical?</p>&#xA;<p>Example: I have a set of 1000 map coordinates, all in the range...
python
1
Create a continuous heatmap -- (python) <p>Most heatmap tutorials look at discrete data, where each cell has a well-defined boundary and a single value. How do you create a heatmap of continuous data, where individual points may be very close together without actually being identical?</p>&#xA;<p>Example: I have a set o...
habedi/stack-exchange-dataset
93,961
Training is not stable with extreme class imbalance
<p>I'm dealing with a multi-class classification problem with around 30 categories.</p>&#xA;<p>This problem has a severe class imbalance:</p>&#xA;<ul>&#xA;<li>Around 300 examples for the least common class.</li>&#xA;<li>Around 100k examples for the most common class.</li>&#xA;</ul>&#xA;<p>I don't want the classificatio...
classification scikit learn class imbalance
1
Training is not stable with extreme class imbalance -- (classification scikit learn class imbalance) <p>I'm dealing with a multi-class classification problem with around 30 categories.</p>&#xA;<p>This problem has a severe class imbalance:</p>&#xA;<ul>&#xA;<li>Around 300 examples for the least common class.</li>&#xA;<li...
habedi/stack-exchange-dataset
93,964
what does one Shot learning mean? do they only need one image to train for some new class detection?
<p>Being new to deep learning I am somewhat struggling to grasp the idea of one shot learning.</p>&#xA;<p>Let us say I have a class to detect which didn't exist in training dataset such as COCO or Image NET. Can I train model for that class using only image or the training set must be large as for YOLO or RCNNs?</p>&#x...
machine learning deep learning ai one shot learning
1
what does one Shot learning mean? do they only need one image to train for some new class detection? -- (machine learning deep learning ai one shot learning) <p>Being new to deep learning I am somewhat struggling to grasp the idea of one shot learning.</p>&#xA;<p>Let us say I have a class to detect which didn't exist i...
habedi/stack-exchange-dataset
93,973
scikit learn target variable reversed (DecisionTreeClassifier)
<p>I created a Decision Tree Classifier using sklearn, defined the target variable:</p>&#xA;<pre><code>#extract features and target variables&#xA;x = df.drop(columns=&quot;target_column&quot;,)&#xA;y = df[&quot;target_column&quot;]&#xA;#save the feature name and target variables&#xA;feature_names = x.columns&#xA;labels...
scikit learn decision trees cart
1
scikit learn target variable reversed (DecisionTreeClassifier) -- (scikit learn decision trees cart) <p>I created a Decision Tree Classifier using sklearn, defined the target variable:</p>&#xA;<pre><code>#extract features and target variables&#xA;x = df.drop(columns=&quot;target_column&quot;,)&#xA;y = df[&quot;target_c...
habedi/stack-exchange-dataset
93,977
How to create a confusion matrix for one node of a decision tree?
<p>I am doing past papers for my data science exam and was curious about one of the questions. They ask us to create a confusion matrix by hand for one node of a decision tree.</p>&#xA;<p>I understand how to create a decision tree for an entire model, but I am unsure on how to create one for just one variable. Should t...
decision trees evaluation confusion matrix
1
How to create a confusion matrix for one node of a decision tree? -- (decision trees evaluation confusion matrix) <p>I am doing past papers for my data science exam and was curious about one of the questions. They ask us to create a confusion matrix by hand for one node of a decision tree.</p>&#xA;<p>I understand how t...
habedi/stack-exchange-dataset
93,983
Replace column in a dataframe with another column based on index
<p>I have the following dataframe <strong>A</strong>:</p>&#xA;<pre><code> score content content_preprocessed for_analysis&#xA;1 5 a aaa True&#xA;2 5 b NaN False&#xA;3 1 c ccc True&#x...
pandas
1
Replace column in a dataframe with another column based on index -- (pandas) <p>I have the following dataframe <strong>A</strong>:</p>&#xA;<pre><code> score content content_preprocessed for_analysis&#xA;1 5 a aaa True&#xA;2 5 b NaN ...
habedi/stack-exchange-dataset
93,993
GridSearchCV Decrease performance RF
<p>Can Gridsearchcv params perform worst than default RF?</p>&#xA;<p>RF with default values performs <code>rmse_train=4886</code>,<code>r^2_train=0.84</code>, <code>rmse_test=11008</code>,<code>r^2_test=0.22</code>.&#xA;RF after GridSearchCV tuning performs worst on train set (<code>rmse_train=9104</code>,<code>r^2_tra...
machine learning python regression random forest grid search
1
GridSearchCV Decrease performance RF -- (machine learning python regression random forest grid search) <p>Can Gridsearchcv params perform worst than default RF?</p>&#xA;<p>RF with default values performs <code>rmse_train=4886</code>,<code>r^2_train=0.84</code>, <code>rmse_test=11008</code>,<code>r^2_test=0.22</code>.&#...
habedi/stack-exchange-dataset
94,025
Tree complexity in xgboost
<p>According to <a href="https://dl.acm.org/doi/pdf/10.1145/2939672.2939785" rel="nofollow noreferrer">xgboost</a> paper, regularization is given by:</p>&#xA;<p><span class="math-container">$$\Omega(f) = \gamma T + \lambda || w||^2$$</span></p>&#xA;<p>where <span class="math-container">$\gamma$</span> is the complexity...
xgboost loss function gradient boosting decision trees
1
Tree complexity in xgboost -- (xgboost loss function gradient boosting decision trees) <p>According to <a href="https://dl.acm.org/doi/pdf/10.1145/2939672.2939785" rel="nofollow noreferrer">xgboost</a> paper, regularization is given by:</p>&#xA;<p><span class="math-container">$$\Omega(f) = \gamma T + \lambda || w||^2$$...
habedi/stack-exchange-dataset
94,028
Multiple solutions with same minima in MLP with same weights
<p>I came across an excercise on deep learning from <a href="https://d2l.ai/chapter_optimization/optimization-intro.html" rel="nofollow noreferrer">here</a>.&#xA;It goes as follows:&#xA;Consider a simple MLP with a single hidden layer of <span class="math-container">$d$</span> dimensions in the hidden layer and a singl...
mlp theory
1
Multiple solutions with same minima in MLP with same weights -- (mlp theory) <p>I came across an excercise on deep learning from <a href="https://d2l.ai/chapter_optimization/optimization-intro.html" rel="nofollow noreferrer">here</a>.&#xA;It goes as follows:&#xA;Consider a simple MLP with a single hidden layer of <span...
habedi/stack-exchange-dataset
94,029
Exploration in Q learning: Epsilon greedy vs Exploration function
<p>I am trying to understand how to make sure that our agent explores the state space enough before exploiting what it knows. I am aware that we use epsilon-greedy approach with a decaying epsilon to achieve this. However I came across another concept, that of using exploration functions to make sure that our agent exp...
machine learning model q learning
1
Exploration in Q learning: Epsilon greedy vs Exploration function -- (machine learning model q learning) <p>I am trying to understand how to make sure that our agent explores the state space enough before exploiting what it knows. I am aware that we use epsilon-greedy approach with a decaying epsilon to achieve this. H...
habedi/stack-exchange-dataset
94,034
Syntax error in function but everything seems correct
<p>I am custom defining a function and following is my function but I get error as below</p>&#xA;<pre><code>def saveSlice(img, fname, path):&#xA; img = np.uint8(img * 255)&#xA; fout = os.path.join(path, f'{fname}.png')&#xA; cv2.imwrite(fout, img)&#xA; print(f'[+] Slice saved: {fout}', end='\r')&#xA;&#...
python 3.x
1
Syntax error in function but everything seems correct -- (python 3.x) <p>I am custom defining a function and following is my function but I get error as below</p>&#xA;<pre><code>def saveSlice(img, fname, path):&#xA; img = np.uint8(img * 255)&#xA; fout = os.path.join(path, f'{fname}.png')&#xA; cv2.imwrite(...
habedi/stack-exchange-dataset
94,036
BERT Self-Attention layer
<p>I am trying to use the <strong>first</strong> individual <a href="https://github.com/huggingface/transformers/blob/master/src/transformers/models/bert/modeling_bert.py#L213" rel="nofollow noreferrer">BertSelfAttention</a> layer for the BERT-base model, but the model I am loading from <code>torch.hub</code> seems to ...
nlp bert
1
BERT Self-Attention layer -- (nlp bert) <p>I am trying to use the <strong>first</strong> individual <a href="https://github.com/huggingface/transformers/blob/master/src/transformers/models/bert/modeling_bert.py#L213" rel="nofollow noreferrer">BertSelfAttention</a> layer for the BERT-base model, but the model I am loadi...
habedi/stack-exchange-dataset
94,038
How to create multi-hot encoding from a list column in dataframe?
<p>I have dataframe like this</p>&#xA;<pre><code>Label IDs&#xA; 0 [10, 1]&#xA; 1 [15]&#xA; 0 [14]&#xA;</code></pre>&#xA;<p>I want to create a multihot encoding of the feature <code>IDs</code>. It should look like this</p>&#xA;<pre><code>Label ID_10 ID_1 ID_15 ID_14&#xA; 0 1 1 0 0&#xA; ...
keras pandas dataframe
1
How to create multi-hot encoding from a list column in dataframe? -- (keras pandas dataframe) <p>I have dataframe like this</p>&#xA;<pre><code>Label IDs&#xA; 0 [10, 1]&#xA; 1 [15]&#xA; 0 [14]&#xA;</code></pre>&#xA;<p>I want to create a multihot encoding of the feature <code>IDs</code>. It should look l...
habedi/stack-exchange-dataset
94,067
Machine Learning - Euclidian Distance Classifier exercise
<p>I'm taking part in an elective subject at university which mainly focuses on the foundations of Machine Learning.&#xA;Now we got our first exercise - this task should be done practically in any language (I've chosen Python). Our teacher doesn't explain the relations between theory and practice well and so it's hard ...
machine learning python classification k nn ai
1
Machine Learning - Euclidian Distance Classifier exercise -- (machine learning python classification k nn ai) <p>I'm taking part in an elective subject at university which mainly focuses on the foundations of Machine Learning.&#xA;Now we got our first exercise - this task should be done practically in any language (I'v...
habedi/stack-exchange-dataset
94,091
how to calculate similarity between users based on movie ratings
<p>Hi I am working on a movie recommendation system and I have to find alikeness between the main user and other users. For example, the main user watched 3 specific movies and rated them as 8,5,7. A user who happened to watch the same movies rated them as 8,2,3 and an another user of the same kind rated those movies a...
recommender system similarity vector space models
1
how to calculate similarity between users based on movie ratings -- (recommender system similarity vector space models) <p>Hi I am working on a movie recommendation system and I have to find alikeness between the main user and other users. For example, the main user watched 3 specific movies and rated them as 8,5,7. A ...
habedi/stack-exchange-dataset
94,094
How to interpret the rec curve for a regression task?
<p>I am using forest fire <a href="https://archive.ics.uci.edu/ml/datasets/forest+fires" rel="nofollow noreferrer">dataset</a> and applied neural network model. I tried to generate REC curve, this is how it looks like. Pretty weird!!!</p>&#xA;<p><a href="https://i.stack.imgur.com/kE5ib.png" rel="nofollow noreferrer"><i...
regression evaluation
1
How to interpret the rec curve for a regression task? -- (regression evaluation) <p>I am using forest fire <a href="https://archive.ics.uci.edu/ml/datasets/forest+fires" rel="nofollow noreferrer">dataset</a> and applied neural network model. I tried to generate REC curve, this is how it looks like. Pretty weird!!!</p>&...
habedi/stack-exchange-dataset
94,100
Negative log-likelihood not the same as cross-entropy?
<p>The negative log-likelihood&#xA;<span class="math-container">$$&#xA;\sum_{i=1}^{m}\log p_{model}(\mathbf{y} | \mathbf{x} ; \boldsymbol{\theta})&#xA;$$</span>&#xA;can be multiplied by <span class="math-container">$\frac{1}{m}$</span> after which the law of large numbers can be used to get&#xA;<span class="math-contai...
machine learning deep learning
1
Negative log-likelihood not the same as cross-entropy? -- (machine learning deep learning) <p>The negative log-likelihood&#xA;<span class="math-container">$$&#xA;\sum_{i=1}^{m}\log p_{model}(\mathbf{y} | \mathbf{x} ; \boldsymbol{\theta})&#xA;$$</span>&#xA;can be multiplied by <span class="math-container">$\frac{1}{m}$<...
habedi/stack-exchange-dataset
94,118
Understanding outputs from ANN and how to improve validation loss
<p>I apologise if this is a bit long winded, but it was suggested by another user that I post.</p>&#xA;<p>I will start by saying that I am very new to the world of machine learning and deep learning. As such, the most important thing I am after is the understanding of what I am doing.</p>&#xA;<p>I am trying to build an...
deep learning binary ann
1
Understanding outputs from ANN and how to improve validation loss -- (deep learning binary ann) <p>I apologise if this is a bit long winded, but it was suggested by another user that I post.</p>&#xA;<p>I will start by saying that I am very new to the world of machine learning and deep learning. As such, the most import...
habedi/stack-exchange-dataset
94,137
Is probabilistic machine learning just the mathematical background of machine learning?
<p>I wanted to begin with machine learning, I went through the contents of the course on ML by Andrew Ng and found that though the course was based on mathematics, but wasn't too much on the probability or statistics.</p>&#xA;<p>But in many university curriculua the book: &quot;Probabilistic Machine Learning: An introd...
machine learning
1
Is probabilistic machine learning just the mathematical background of machine learning? -- (machine learning) <p>I wanted to begin with machine learning, I went through the contents of the course on ML by Andrew Ng and found that though the course was based on mathematics, but wasn't too much on the probability or stat...
habedi/stack-exchange-dataset
94,146
ideal algorithms to demonstrate overfitting or underfitting
<p>When one tries to look up concepts such as overfitting and underfitting, the most common thing that pops up is polynomial regression. Why is polynomial regression often used to demonstrate these concepts? Is it just because it can be easily visualised like the graphs here:</p>&#xA;<p><a href="https://scikit-learn.or...
machine learning regression linear regression machine learning model overfitting
1
ideal algorithms to demonstrate overfitting or underfitting -- (machine learning regression linear regression machine learning model overfitting) <p>When one tries to look up concepts such as overfitting and underfitting, the most common thing that pops up is polynomial regression. Why is polynomial regression often us...
habedi/stack-exchange-dataset
94,154
Keras: apply multiple filters to each feature map in CNN
<p>I am new to Keras, and I want to do the following: take a 2D image, and apply four 2D convolution kernels to it, giving four 2D feature maps. I could accomplish this. But then I want to apply two distinct 2D convolutions to each of those 4 maps, giving 8 feature maps. Is that possible?</p>&#xA;<p>Here's what I have...
deep learning keras tensorflow cnn convolutional neural network
1
Keras: apply multiple filters to each feature map in CNN -- (deep learning keras tensorflow cnn convolutional neural network) <p>I am new to Keras, and I want to do the following: take a 2D image, and apply four 2D convolution kernels to it, giving four 2D feature maps. I could accomplish this. But then I want to apply...
habedi/stack-exchange-dataset
94,159
Error is occurring setting an array element with a sequence
<p>I have the columns in my Data Frame as shown below:</p>&#xA;<pre><code> Venue city Venue Categories&#xA;&#xA; Madison London [1, 1, 1, 1, 0, 0, 0, ...,0,0]&#xA; WaterFront Austria [0, 1, 1 0, 0, 0, 0, ....0,1]&#xA; Aeronaut Marvilles [0, 0, 0, 0, 1, 1, 1,...
machine learning python pandas dataframe
1
Error is occurring setting an array element with a sequence -- (machine learning python pandas dataframe) <p>I have the columns in my Data Frame as shown below:</p>&#xA;<pre><code> Venue city Venue Categories&#xA;&#xA; Madison London [1, 1, 1, 1, 0, 0, 0, ...,0,0]&#xA; WaterFro...
habedi/stack-exchange-dataset
94,173
What if irrelevant features impact the outputs?
<p>We know that weather conditions in China is not very useful to predict price of a house in Spain (as life experience). However, when we drop that China's weather condition, the accuracy is reduced largely. Will we keep it?</p>&#xA;
machine learning classification dataset feature selection
1
What if irrelevant features impact the outputs? -- (machine learning classification dataset feature selection) <p>We know that weather conditions in China is not very useful to predict price of a house in Spain (as life experience). However, when we drop that China's weather condition, the accuracy is reduced largely. ...
habedi/stack-exchange-dataset
94,174
Low scale ML/statistical techniques for data poor settings
<p>I have two separate problems. One is logistic regression and other is time series prediction. But both suffer from paucity of data problems</p>&#xA;<p>a) For logistic regression, I have tiny dataset with 10 observations which has variables such as age, Marital_Status, income, gender and car_purchase_status (outcome ...
machine learning classification time series data mining logistic regression
1
Low scale ML/statistical techniques for data poor settings -- (machine learning classification time series data mining logistic regression) <p>I have two separate problems. One is logistic regression and other is time series prediction. But both suffer from paucity of data problems</p>&#xA;<p>a) For logistic regression...
habedi/stack-exchange-dataset
94,187
Optimal points of $f(x,y)=x^2 + y^2 + \beta xy + x + 2y$
<p>I am self-learning basic optimization theory and algorithms from &quot;An Introduction to Optimization&quot; by Chong and Zak. I would like someone to verify my solution to this problem, on finding the minimizer/maximizer of a function of two variables, or any tips/hint to proceed ahead.</p>&#xA;<blockquote>&#xA;<p>...
optimization
1
Optimal points of $f(x,y)=x^2 + y^2 + \beta xy + x + 2y$ -- (optimization) <p>I am self-learning basic optimization theory and algorithms from &quot;An Introduction to Optimization&quot; by Chong and Zak. I would like someone to verify my solution to this problem, on finding the minimizer/maximizer of a function of two...
habedi/stack-exchange-dataset
94,190
what is the meaning of independent and identically distribution of samples in a dataset for neuralnetworks
<p>random variables like heads or tail that generated by flipping a coin is <code>independent</code> because each time we tossing the result isn't depend on previous toss( in other words the function that generates random variable doesn't have memory). the example also is <code>identically distributed</code> because ea...
machine learning neural network
1
what is the meaning of independent and identically distribution of samples in a dataset for neuralnetworks -- (machine learning neural network) <p>random variables like heads or tail that generated by flipping a coin is <code>independent</code> because each time we tossing the result isn't depend on previous toss( in o...
habedi/stack-exchange-dataset
94,216
Basic doubt regarding "training" of a YOLO model
<p>So I have just recently started exploring machine learning, and for a project I was required to train the YOLO v5 model. I first tried it on the coco128 dataset:<a href="https://www.kaggle.com/ultralytics/coco128." rel="nofollow noreferrer">https://www.kaggle.com/ultralytics/coco128.</a>.</p>&#xA;<p>repository of th...
machine learning cnn image classification image recognition yolo
1
Basic doubt regarding "training" of a YOLO model -- (machine learning cnn image classification image recognition yolo) <p>So I have just recently started exploring machine learning, and for a project I was required to train the YOLO v5 model. I first tried it on the coco128 dataset:<a href="https://www.kaggle.com/ultra...
habedi/stack-exchange-dataset
94,237
in binary classification where class labels are {-1, 1} is preprocessing needed?
<p>In machine learning we convert labels using LabelEncoder to convert string ex:{&quot;malignant&quot;, &quot;benign&quot;} -&gt; {0, 1}</p>&#xA;<p>I am wondering if converting Labels to any other numbers matter, in my scenario to {-1,1}.&#xA;If it matters, reason provided will be helpful (or direction of helpful reso...
machine learning classification preprocessing
1
in binary classification where class labels are {-1, 1} is preprocessing needed? -- (machine learning classification preprocessing) <p>In machine learning we convert labels using LabelEncoder to convert string ex:{&quot;malignant&quot;, &quot;benign&quot;} -&gt; {0, 1}</p>&#xA;<p>I am wondering if converting Labels to ...
habedi/stack-exchange-dataset
94,247
reprocessing steps for images before training classification models
<p>I have a data set of images for <code>classification task</code>.</p>&#xA;<p>I read some articles about image reprocessing (before training <code>CNN</code> models) which summarize in those steps:</p>&#xA;<ol>&#xA;<li><p>scale image values (<code>img / 255.0</code>)</p>&#xA;</li>&#xA;<li><p>remove noise (using <code...
image classification image preprocessing
1
reprocessing steps for images before training classification models -- (image classification image preprocessing) <p>I have a data set of images for <code>classification task</code>.</p>&#xA;<p>I read some articles about image reprocessing (before training <code>CNN</code> models) which summarize in those steps:</p>&#x...
habedi/stack-exchange-dataset
94,260
Criteria for saving best model during training neural network?
<p>I am doing 4-class semantic segmentation with U-net using generalised dice loss as loss function.</p>&#xA;<p>General approach to save best model during training is to monitor validation loss at each epoch and save the model if val loss decreases than previous minimum.</p>&#xA;<p>But, I am interested in the &quot;mod...
deep learning cnn cross validation loss function semantic segmentation
1
Criteria for saving best model during training neural network? -- (deep learning cnn cross validation loss function semantic segmentation) <p>I am doing 4-class semantic segmentation with U-net using generalised dice loss as loss function.</p>&#xA;<p>General approach to save best model during training is to monitor val...
habedi/stack-exchange-dataset
94,278
Slight confusion on the learning process
<p>Hi guys I have a slight confusion on the learning process of neural networks.</p>&#xA;<p>When the input layer receives inputs, goes through the hidden layers and then into the output layer. How does the neural network know that the outputs at the output layer are incorrect?</p>&#xA;<p>When the error is calculated at...
machine learning neural network
1
Slight confusion on the learning process -- (machine learning neural network) <p>Hi guys I have a slight confusion on the learning process of neural networks.</p>&#xA;<p>When the input layer receives inputs, goes through the hidden layers and then into the output layer. How does the neural network know that the outputs...
habedi/stack-exchange-dataset
94,283
Linear Learning Machines
<p>I was reading about Linear Learning Machines (LLMs) and learned that it is closely related with SVMs. Would like to know an example of any concrete problems that can be classified by LLM as I couldn't find any promising example or explanation for this.</p>&#xA;<p>Appreciate your time.</p>&#xA;
machine learning svm
1
Linear Learning Machines -- (machine learning svm) <p>I was reading about Linear Learning Machines (LLMs) and learned that it is closely related with SVMs. Would like to know an example of any concrete problems that can be classified by LLM as I couldn't find any promising example or explanation for this.</p>&#xA;<p>Ap...
habedi/stack-exchange-dataset
94,286
Best parameters to try while hyperparameter tuning in Decision Trees
<p>I want to post prune my decision tree as it is overfitting, I can do this using cost complexity pruning by adjusting ccp_alphas parameters however this does not seem very intuitive to me.</p>&#xA;<p>From my understanding there are some hyperparameters such as <code>min_samples_split</code>, <code>max_depth</code>, <...
python scikit learn decision trees
1
Best parameters to try while hyperparameter tuning in Decision Trees -- (python scikit learn decision trees) <p>I want to post prune my decision tree as it is overfitting, I can do this using cost complexity pruning by adjusting ccp_alphas parameters however this does not seem very intuitive to me.</p>&#xA;<p>From my u...
habedi/stack-exchange-dataset
94,289
Can someone explain to me how to use a predictive model to predict something other than the training set
<p>So let's say I create a logistic model to predict who will open a loan based on a based email list that includes who opened and who didn't that's 90% accurate. The model says age, income, bank engagement are three key variables that decide who opens a loan. Is there a way to apply this model to a different email lis...
predictive modeling logistic regression data science model data analysis
1
Can someone explain to me how to use a predictive model to predict something other than the training set -- (predictive modeling logistic regression data science model data analysis) <p>So let's say I create a logistic model to predict who will open a loan based on a based email list that includes who opened and who di...
habedi/stack-exchange-dataset
94,295
What exactly is convergence rate referring to in machine learning?
<p>My understanding of the term &quot;Convergence Rate&quot; is as follows:</p>&#xA;<blockquote>&#xA;<p>Rate at which maximum/Minimum of a function is reached, so in logistic&#xA;regression rate at which gradient decent reaches global minimum.</p>&#xA;</blockquote>&#xA;<p>So by convergence rate I am guessing it is meas...
machine learning python logistic regression convergence
1
What exactly is convergence rate referring to in machine learning? -- (machine learning python logistic regression convergence) <p>My understanding of the term &quot;Convergence Rate&quot; is as follows:</p>&#xA;<blockquote>&#xA;<p>Rate at which maximum/Minimum of a function is reached, so in logistic&#xA;regression ra...
habedi/stack-exchange-dataset
94,306
Using vgg16 or inception with wights equals to None
<p>When using pre-trained models like <code>vgg16</code> or <code>inception</code>,&#xA;it seems that one of the benfits of using pre-trained model, is to save up time of training.</p>&#xA;<p>Is there a reason to use the pre-trained models without loading the weights ? (use random weights) ?</p>&#xA;
deep learning transfer learning inception vgg16 inceptionresnetv2
1
Using vgg16 or inception with wights equals to None -- (deep learning transfer learning inception vgg16 inceptionresnetv2) <p>When using pre-trained models like <code>vgg16</code> or <code>inception</code>,&#xA;it seems that one of the benfits of using pre-trained model, is to save up time of training.</p>&#xA;<p>Is th...
habedi/stack-exchange-dataset
94,319
How to implement random cropping during training?
<p>I'm developing a U-net like model which segments the damaged tissue of the brain between two time-points in Multiple Sclerosis patients. The model is given the baseline and follow-up images as x and the segmentation mask as y. The images are 3D (192, 218, 192) and the model input size is (128, 128, 128) and is being...
python deep learning tensorflow cnn data augmentation
1
How to implement random cropping during training? -- (python deep learning tensorflow cnn data augmentation) <p>I'm developing a U-net like model which segments the damaged tissue of the brain between two time-points in Multiple Sclerosis patients. The model is given the baseline and follow-up images as x and the segme...
habedi/stack-exchange-dataset
94,320
Grouping with non-sequential index (datetime) [Pandas] [Python]
<p>Good morning everyone.</p>&#xA;<p>I am working in Python, I have a DataFrame whose index is of type DateTime, the times of the index are not continuous. You can see that the first three data are in sequence and after the third data it goes directly to minute 50. The entire DataFrame has this feature.</p>&#xA;<pre><c...
python pandas
1
Grouping with non-sequential index (datetime) [Pandas] [Python] -- (python pandas) <p>Good morning everyone.</p>&#xA;<p>I am working in Python, I have a DataFrame whose index is of type DateTime, the times of the index are not continuous. You can see that the first three data are in sequence and after the third data it...
habedi/stack-exchange-dataset
94,327
Flag consecutive dates by group
<p>Below is an example of my data (<code>Room</code> and <code>Date</code>). I would like to generate variables <code>Goal1</code> , <code>Goal2</code> and <code>Goal3</code>. Every time there is a gap in the <code>Date</code> variable means that the room was closed. My goal is to identify consecutive dates by room.</p...
r dataframe dplyr
1
Flag consecutive dates by group -- (r dataframe dplyr) <p>Below is an example of my data (<code>Room</code> and <code>Date</code>). I would like to generate variables <code>Goal1</code> , <code>Goal2</code> and <code>Goal3</code>. Every time there is a gap in the <code>Date</code> variable means that the room was close...
habedi/stack-exchange-dataset
94,330
Do Activation Functions map to Higher Dimensions?:
<p>I just started learning tensorflow and I have a question regarding activation functions used in neural networks, I watched a 3b1b video a while ago and it seems it squished the value into an interval like sigmoid does so by squishing it between 0 and 1 so we could make more concrete comparisons however while watchin...
tensorflow activation function
1
Do Activation Functions map to Higher Dimensions?: -- (tensorflow activation function) <p>I just started learning tensorflow and I have a question regarding activation functions used in neural networks, I watched a 3b1b video a while ago and it seems it squished the value into an interval like sigmoid does so by squish...
habedi/stack-exchange-dataset
94,331
Multivariate time series forecast with VAR confusion
<p>I am new to time-series forecasting. I am working now on a task in which I have a data set, containing samples of approx. 15 variables for every hour for several years. Then, I have a test data set (continues at the next time step where training data ended) containing values for all the variables <strong>except one<...
python time series regression predictive modeling
1
Multivariate time series forecast with VAR confusion -- (python time series regression predictive modeling) <p>I am new to time-series forecasting. I am working now on a task in which I have a data set, containing samples of approx. 15 variables for every hour for several years. Then, I have a test data set (continues ...
habedi/stack-exchange-dataset
94,348
The affect of bootstrap on Isolation Forest
<p>I've been using isolation forest for anomaly detection, and reviewing its parameters at scikit-learn (<a href="https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.IsolationForest.html" rel="nofollow noreferrer">link</a>). Looking at &quot;bootstrap&quot;, I'm not quite clear what using bootstrap would...
python anomaly detection isolation forest
1
The affect of bootstrap on Isolation Forest -- (python anomaly detection isolation forest) <p>I've been using isolation forest for anomaly detection, and reviewing its parameters at scikit-learn (<a href="https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.IsolationForest.html" rel="nofollow noreferrer">...
habedi/stack-exchange-dataset
94,365
KNN Variance using a high value of K and cross-validation
<p>it has come to my understanding, that a value of K=1, gives a high variance because we are only using only one data point, hence we are very likely to model the noise in that training example.</p>&#xA;<hr />&#xA;<p>Bias: It will take the value of point 3 as it’s the closest one. It looks much better here (I know not...
machine learning dataset k nn variance bias
1
KNN Variance using a high value of K and cross-validation -- (machine learning dataset k nn variance bias) <p>it has come to my understanding, that a value of K=1, gives a high variance because we are only using only one data point, hence we are very likely to model the noise in that training example.</p>&#xA;<hr />&#x...
habedi/stack-exchange-dataset
94,377
Feature importance with Text features
<p>I would like to determine features importance in several models:</p>&#xA;<ul>&#xA;<li>support vector machine</li>&#xA;<li>logistic regression</li>&#xA;<li>Naive Bayes</li>&#xA;<li>random forest</li>&#xA;</ul>&#xA;<p>I read that I will need an agnostic model, so I have thought to use performance_importance (in python...
machine learning python scikit learn feature selection feature importances
1
Feature importance with Text features -- (machine learning python scikit learn feature selection feature importances) <p>I would like to determine features importance in several models:</p>&#xA;<ul>&#xA;<li>support vector machine</li>&#xA;<li>logistic regression</li>&#xA;<li>Naive Bayes</li>&#xA;<li>random forest</li>&...
habedi/stack-exchange-dataset
94,384
What happens when the vocab size of an embedded layer is larger than the text corpus used in training?
<p>Full disclosure this question is based on following this tutorial: <a href="https://tinyurl.com/vmyj8rf8" rel="nofollow noreferrer">https://tinyurl.com/vmyj8rf8</a></p>&#xA;<p>I am trying to fully understand embedded layers in Keras. Imagine having a network to try and understand basic sentiment analysis as a binary...
neural network keras nlp tensorflow word embeddings
1
What happens when the vocab size of an embedded layer is larger than the text corpus used in training? -- (neural network keras nlp tensorflow word embeddings) <p>Full disclosure this question is based on following this tutorial: <a href="https://tinyurl.com/vmyj8rf8" rel="nofollow noreferrer">https://tinyurl.com/vmyj8...
habedi/stack-exchange-dataset
94,404
Merge two datasets based on date ranges. R
<p>My goal is to merge two datasets using date ranges. Dataset1 contains patients stays in a hospital overtime. Dataset2 contains room information overtime. My goal is to identify what type of room the stays were in my Dataset1. It can get complicated since room type in some hospitalizations can change. For example pat...
time series r data
1
Merge two datasets based on date ranges. R -- (time series r data) <p>My goal is to merge two datasets using date ranges. Dataset1 contains patients stays in a hospital overtime. Dataset2 contains room information overtime. My goal is to identify what type of room the stays were in my Dataset1. It can get complicated s...
habedi/stack-exchange-dataset
94,406
Transformer: where is the output of the last FF sub-layer of the encoder used?
<p>In the &quot;Attention Is All You Need&quot; paper, the decoder consists of two attention sub-layers in each layer followed by a FF sub-layer.&#xA;The first is a masked self attention which gets as an input the output of the decoder in the previous step (and the first input is a special start token).&#xA;The second,...
transformer
1
Transformer: where is the output of the last FF sub-layer of the encoder used? -- (transformer) <p>In the &quot;Attention Is All You Need&quot; paper, the decoder consists of two attention sub-layers in each layer followed by a FF sub-layer.&#xA;The first is a masked self attention which gets as an input the output of ...
habedi/stack-exchange-dataset
94,436
pandas groupby.count doesn't count zero occurrences
<p>I am using groupby.count for 2 columns to get value occurrences under a class constraint. However, if value <span class="math-container">$x$</span> in feature never occurs with class <span class="math-container">$y$</span>, then this pandas method returns only non-zero frequencies. Is there any solution or alternate...
pandas groupby
1
pandas groupby.count doesn't count zero occurrences -- (pandas groupby) <p>I am using groupby.count for 2 columns to get value occurrences under a class constraint. However, if value <span class="math-container">$x$</span> in feature never occurs with class <span class="math-container">$y$</span>, then this pandas meth...
habedi/stack-exchange-dataset
94,444
Model that predicts probability of correctness of another model
<p><strong>Problem:</strong></p>&#xA;<p>Given a neural network for <strong>image classification</strong> with <span class="math-container">$1000$</span> classes, the objective is to create another model which will output the <strong>probability</strong> of the neural network giving the <strong>correct prediction</stron...
machine learning deep learning neural network classification image classification
1
Model that predicts probability of correctness of another model -- (machine learning deep learning neural network classification image classification) <p><strong>Problem:</strong></p>&#xA;<p>Given a neural network for <strong>image classification</strong> with <span class="math-container">$1000$</span> classes, the obj...
habedi/stack-exchange-dataset
94,445
Pretrained models for Propositional logic
<p>Are there any pretrained models which understand propositional logic?</p>&#xA;<p>For example, the t5 model can do question-answering. Given a context such as &quot;Alice is Bob's mother. Bob is Charlie's father&quot;, t5 can answer the question &quot;Who is Charlie's father&quot; correctly, but it cannot say &quot;W...
deep learning question answering
1
Pretrained models for Propositional logic -- (deep learning question answering) <p>Are there any pretrained models which understand propositional logic?</p>&#xA;<p>For example, the t5 model can do question-answering. Given a context such as &quot;Alice is Bob's mother. Bob is Charlie's father&quot;, t5 can answer the q...
habedi/stack-exchange-dataset
94,456
Why does this paper claim to have found a minimal width of $d_{in}+1$?
<p>Why does <a href="https://arxiv.org/pdf/1710.11278.pdf" rel="nofollow noreferrer">this paper</a> (click the link) claim to have found a minimal width of <span class="math-container">$d_{in}+1$</span> in the abstract? I mean, if you read the main result, it seems like they only find a universal approximator with widt...
machine learning deep learning
1
Why does this paper claim to have found a minimal width of $d_{in}+1$? -- (machine learning deep learning) <p>Why does <a href="https://arxiv.org/pdf/1710.11278.pdf" rel="nofollow noreferrer">this paper</a> (click the link) claim to have found a minimal width of <span class="math-container">$d_{in}+1$</span> in the abs...
habedi/stack-exchange-dataset
94,510
Deciding which samples the model will (probably) classify incorrectly
<p><strong>Problem:</strong></p>&#xA;<p>Given a neural network for image classification, the objective is to develop an algorithm which decides which <strong>images</strong> are 'problematic' and the model is probably going to <strong>classify</strong> them <strong>incorrectly</strong>.</p>&#xA;<p><strong>Discussion:</...
machine learning deep learning neural network classification feature extraction
1
Deciding which samples the model will (probably) classify incorrectly -- (machine learning deep learning neural network classification feature extraction) <p><strong>Problem:</strong></p>&#xA;<p>Given a neural network for image classification, the objective is to develop an algorithm which decides which <strong>images<...
habedi/stack-exchange-dataset
94,512
Data Leakage when preprocessing categorical features?
<p>I am fairly new to machine learning. I came across the concept of Data Leakage. The article says that always split the data before performing preprocessing steps.</p>&#xA;<p>My question is, do steps such as discretization, grouping categories to a single category to reduce cardinality, converting categorical variabl...
machine learning feature engineering data leakage
1
Data Leakage when preprocessing categorical features? -- (machine learning feature engineering data leakage) <p>I am fairly new to machine learning. I came across the concept of Data Leakage. The article says that always split the data before performing preprocessing steps.</p>&#xA;<p>My question is, do steps such as d...
habedi/stack-exchange-dataset
94,519
How does epochs related with converging the model?
<p>I have read on Internet that epochs is used to give the time for the model to converge but I don't know how ? . I was thinking that epochs is used because to train the model sufficient times . How does model convergence relates with epochs . Also tell me that why epochs is useful ?</p>&#xA;
deep learning machine learning model epochs
1
How does epochs related with converging the model? -- (deep learning machine learning model epochs) <p>I have read on Internet that epochs is used to give the time for the model to converge but I don't know how ? . I was thinking that epochs is used because to train the model sufficient times . How does model convergen...
habedi/stack-exchange-dataset
94,537
Normalization vs standardization for image classification problem
<p>For day and night image classification, is it better to normalize or standardize images? In general, when should I use each method? I am interested in with example why one method is preferred over another one?</p>&#xA;<p>Here, by normalization, I mean dividing pixel values by 255. Standardization means subtracting t...
machine learning deep learning computer vision normalization
1
Normalization vs standardization for image classification problem -- (machine learning deep learning computer vision normalization) <p>For day and night image classification, is it better to normalize or standardize images? In general, when should I use each method? I am interested in with example why one method is pre...
habedi/stack-exchange-dataset
94,539
How the Support Vector Machine will perform if the bias b = 0 in the equation of hyperplane?
<p>We have a soft margin linear SVM and the equation is as follows :</p>&#xA;<p><a href="https://i.stack.imgur.com/clHpJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/clHpJ.png" alt="enter image description here" /></a></p>&#xA;<p>How the SVM will perform if b = 0, means the hyperplane is passing t...
svm
1
How the Support Vector Machine will perform if the bias b = 0 in the equation of hyperplane? -- (svm) <p>We have a soft margin linear SVM and the equation is as follows :</p>&#xA;<p><a href="https://i.stack.imgur.com/clHpJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/clHpJ.png" alt="enter image de...
habedi/stack-exchange-dataset
94,569
How does a random forest algorithm deal with a few irrelevant input variables
<p>I have a list of variables from which I would like to train a Random Forest Algorithm. I suspect that a few of my input variables, which have noisy distributions, won't be able to predict much. Can I use them anyway, knowing the algorithm will eliminate them in the process, or should I beware that these variables ma...
random forest
1
How does a random forest algorithm deal with a few irrelevant input variables -- (random forest) <p>I have a list of variables from which I would like to train a Random Forest Algorithm. I suspect that a few of my input variables, which have noisy distributions, won't be able to predict much. Can I use them anyway, kno...
habedi/stack-exchange-dataset
94,572
How do you choose an appropriate $k$ to achieve $k$-anonymity for data?
<p>How do you choose an appropriate <span class="math-container">$k$</span> to achieve <a href="https://en.wikipedia.org/wiki/K-anonymity" rel="nofollow noreferrer"><span class="math-container">$k$</span>-anonymity</a> for a data? What methods exist that are agnostic to the business context for the problem?</p>&#xA;
anonymization
1
How do you choose an appropriate $k$ to achieve $k$-anonymity for data? -- (anonymization) <p>How do you choose an appropriate <span class="math-container">$k$</span> to achieve <a href="https://en.wikipedia.org/wiki/K-anonymity" rel="nofollow noreferrer"><span class="math-container">$k$</span>-anonymity</a> for a data...
habedi/stack-exchange-dataset
94,578
How to mantain the nested structure of a tf.dataset after applying map?
<p>I'm creating a tf.dataset object containing 2 images as inputs and a mask as target. All of them are 3D in grayscale. After applying a custom map, the shape of the object changes from <code> ((TensorSpec(shape=(), dtype=tf.string, name=None), TensorSpec(shape=(), dtype=tf.string, name=None)), TensorSpec(shape=(), dt...
python tensorflow data augmentation
1
How to mantain the nested structure of a tf.dataset after applying map? -- (python tensorflow data augmentation) <p>I'm creating a tf.dataset object containing 2 images as inputs and a mask as target. All of them are 3D in grayscale. After applying a custom map, the shape of the object changes from <code> ((TensorSpec(...
habedi/stack-exchange-dataset
94,586
How useful is Bayesian Inference
<p>Last few months, I had been exposed to <code>Bayesian Inference</code> in ML course<br />&#xA;With further investigation, I come to place where there is MCMC technique to simulate the posterior distribution.<br />&#xA;It seems interesting. However, I am not sure if it is really useful in the industry?<br />&#xA;Does...
statistics probability bayesian
1
How useful is Bayesian Inference -- (statistics probability bayesian) <p>Last few months, I had been exposed to <code>Bayesian Inference</code> in ML course<br />&#xA;With further investigation, I come to place where there is MCMC technique to simulate the posterior distribution.<br />&#xA;It seems interesting. However...
habedi/stack-exchange-dataset
94,605
Difference between PCA and regularisation
<p>Currently, I am confusing about PCA and regularisation.</p>&#xA;<p>I wonder what is the difference between PCA and regularisation: particularly lasso (L1) regression?</p>&#xA;<p>Seems both of them can do the feature selection. I have to admit, I am not quiet familiar with the difference between dimensional reduction...
pca regularization lasso
1
Difference between PCA and regularisation -- (pca regularization lasso) <p>Currently, I am confusing about PCA and regularisation.</p>&#xA;<p>I wonder what is the difference between PCA and regularisation: particularly lasso (L1) regression?</p>&#xA;<p>Seems both of them can do the feature selection. I have to admit, I...
habedi/stack-exchange-dataset
94,608
Training set Distribution and Activation function/Loss function correlation
<p>How should the probability distribution of the training set influence the choice of the activation function / loss function? <br>&#xA;For instance if I have a Multinoulli distribution, which activation function should I choose? And why? <br>&#xA;I can't get this correlation between the probability distribution of th...
machine learning loss function probability activation function
1
Training set Distribution and Activation function/Loss function correlation -- (machine learning loss function probability activation function) <p>How should the probability distribution of the training set influence the choice of the activation function / loss function? <br>&#xA;For instance if I have a Multinoulli di...
habedi/stack-exchange-dataset
94,609
SGDClassifier - Why do I need to use argmax instead of argmin to find the lowest threshold satisfying given precision?
<p>I am an experienced programmer, but new to Python and data science. I am following Aurelien Gerone's book and I don't understand one thing.</p>&#xA;<p>I create SGDClassifier and calculate its precision_recall_curve(). Then I am trying to find the lowest threshold to satisfy precision equal to 90%:</p>&#xA;<pre><code...
python classification scikit learn numpy
1
SGDClassifier - Why do I need to use argmax instead of argmin to find the lowest threshold satisfying given precision? -- (python classification scikit learn numpy) <p>I am an experienced programmer, but new to Python and data science. I am following Aurelien Gerone's book and I don't understand one thing.</p>&#xA;<p>I...
habedi/stack-exchange-dataset
94,623
Machine learning problem with only original data without test and validation data
<p>I am new to machine learning and I am trying to solve a problem where I have to predict if a customer will buy a home insurance product or not.</p>&#xA;<ol>&#xA;<li>I have got a dataset which tells me that which of the bank's customer bought a mortgage from the bank.</li>&#xA;<li>I have got another data of the custo...
machine learning python classification training
1
Machine learning problem with only original data without test and validation data -- (machine learning python classification training) <p>I am new to machine learning and I am trying to solve a problem where I have to predict if a customer will buy a home insurance product or not.</p>&#xA;<ol>&#xA;<li>I have got a data...
habedi/stack-exchange-dataset
94,631
Is there such thing as linear and non-linear data?
<p>While doing machine learning projects we've heard that logistic regression works well with &quot;Linear data&quot; and decision tree works well with &quot;non-linear data&quot;</p>&#xA;<p>However concept of linear and non-linear data does not make sense. To me only linearly separable data and non-linearly separable ...
machine learning statistics mathematics
1
Is there such thing as linear and non-linear data? -- (machine learning statistics mathematics) <p>While doing machine learning projects we've heard that logistic regression works well with &quot;Linear data&quot; and decision tree works well with &quot;non-linear data&quot;</p>&#xA;<p>However concept of linear and non...
habedi/stack-exchange-dataset
94,636
Segmentation model to predict face forward and profile parts of the face
<p>I am developing a model for feature counting on a person's face that consumes three photos (one face forward and two profile pictures). My model can already detect features, but it counts some features twice.</p>&#xA;<p>Consider the image below. There are only four labels (1, 2, 3, 4 and 5). Model detects four label...
image segmentation
1
Segmentation model to predict face forward and profile parts of the face -- (image segmentation) <p>I am developing a model for feature counting on a person's face that consumes three photos (one face forward and two profile pictures). My model can already detect features, but it counts some features twice.</p>&#xA;<p>...
habedi/stack-exchange-dataset
94,648
Is it better to use F1 score or AUC metric for imbalanced data classification?
<p>I have a text classification problem, where the &quot;positive&quot; examples are the minority. What metric is better to use for binary classification for this case - F1-score or AUC?</p>&#xA;
machine learning evaluation
1
Is it better to use F1 score or AUC metric for imbalanced data classification? -- (machine learning evaluation) <p>I have a text classification problem, where the &quot;positive&quot; examples are the minority. What metric is better to use for binary classification for this case - F1-score or AUC?</p>&#xA;
habedi/stack-exchange-dataset
94,650
CNN Design for Counting on Simple Images
<p>This is the first CNN I'm designing following college examples and assignments. I'm working on a CNN that I'd like to use to classify images by the number of shapes on them. My basic problem is that I can't seem, to get the CNN to respond (accuracy and val_accuracy are flat) after n EPOCHS (I have varied n these alo...
tensorflow cnn image classification weight initialization
1
CNN Design for Counting on Simple Images -- (tensorflow cnn image classification weight initialization) <p>This is the first CNN I'm designing following college examples and assignments. I'm working on a CNN that I'd like to use to classify images by the number of shapes on them. My basic problem is that I can't seem, ...
habedi/stack-exchange-dataset
94,651
Hidden Markov Model
<p>I am trying to find answers to the following questions. Can someone please help. This is a Hidden Markov Model with 7 states and 4 observations. I have worked out the following solution but still need help with parts ii &amp; iii.</p>&#xA;<p><a href="https://i.stack.imgur.com/jbfqh.png" rel="nofollow noreferrer"><im...
markov hidden model
1
Hidden Markov Model -- (markov hidden model) <p>I am trying to find answers to the following questions. Can someone please help. This is a Hidden Markov Model with 7 states and 4 observations. I have worked out the following solution but still need help with parts ii &amp; iii.</p>&#xA;<p><a href="https://i.stack.imgur...
habedi/stack-exchange-dataset
94,685
What exactly is the linear layer in the transformer model?
<p>Please see this image:&#xA;<a href="https://i.stack.imgur.com/PSqZ7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PSqZ7.png" alt="" /></a></p>&#xA;<p>There are linear layers to modify the Query, key and value matrices and one linear layer after the multi head attention as they mention also from ...
deep learning neural network transformer attention mechanism
1
What exactly is the linear layer in the transformer model? -- (deep learning neural network transformer attention mechanism) <p>Please see this image:&#xA;<a href="https://i.stack.imgur.com/PSqZ7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PSqZ7.png" alt="" /></a></p>&#xA;<p>There are linear laye...
habedi/stack-exchange-dataset
94,686
Understanding LSTM text input
<p>I am an beginner in text generation and and deep-learing but I like to get in touch with it. Currently I am learing about LSTM networks and VAEs for text generation. I would like to read a sequence at once and output another sequence. What I learned from <a href="https://datascience.stackexchange.com/questions/33393...
deep learning lstm
1
Understanding LSTM text input -- (deep learning lstm) <p>I am an beginner in text generation and and deep-learing but I like to get in touch with it. Currently I am learing about LSTM networks and VAEs for text generation. I would like to read a sequence at once and output another sequence. What I learned from <a href=...
habedi/stack-exchange-dataset
94,718
IS there any way we can add range in hyperparameter tuning of Decision Tree?
<p>For example,</p>&#xA;<pre><code> &quot;min_samples_leaf&quot;:[1,2,3,4,5,6,7,8,9,10],&#xA; 'criterion':['gini','entropy'],&#xA; &quot;max_features&quot;:[&quot;auto&quot;,&quot;log2&quot;,&quot;sqrt&quot;,None],&#xA; &quot;max_leaf_nodes&quot;:[None,10,20,30,40,50,60,70,80,90...
machine learning decision trees machine learning model data science model hyperparameter tuning
1
IS there any way we can add range in hyperparameter tuning of Decision Tree? -- (machine learning decision trees machine learning model data science model hyperparameter tuning) <p>For example,</p>&#xA;<pre><code> &quot;min_samples_leaf&quot;:[1,2,3,4,5,6,7,8,9,10],&#xA; 'criterion':['gini','entropy...
habedi/stack-exchange-dataset
94,735
Image classification problem using convolutional neural networks
<p>I am trying to solve this problem by using a convolutional NN to classify an image data set to check the type of disease it is. I have reached task 1b and trying to implement the training loop. However, I am getting an error and can't understand how to implement the training loop.</p>&#xA;<p>I am sharing the google ...
python deep learning classification image classification convolutional neural network
1
Image classification problem using convolutional neural networks -- (python deep learning classification image classification convolutional neural network) <p>I am trying to solve this problem by using a convolutional NN to classify an image data set to check the type of disease it is. I have reached task 1b and trying...
habedi/stack-exchange-dataset
94,743
How to train and evaluate machine learning models with growing/changing datasets over time
<p>Assume that you have a classification machine learning model, and you start with an initial dataset that contains 3 classes. You split the initial dataset into training/testing spits, you train the initial model and evaluate it, and then overtime, you collect more data for your dataset. Now you have more data that y...
machine learning dataset training
1
How to train and evaluate machine learning models with growing/changing datasets over time -- (machine learning dataset training) <p>Assume that you have a classification machine learning model, and you start with an initial dataset that contains 3 classes. You split the initial dataset into training/testing spits, you...
habedi/stack-exchange-dataset
94,754
In what way is recurrent neural network state "hidden"?
<p>Recurrent neural networks have hidden state denoted <span class="math-container">$h$</span>. Why is the state considered &quot;hidden&quot;? It's clear to me what purpose the state itself serves, but I can't figure out why it is &quot;hidden&quot;. To me, the state seem perfectly &quot;visible&quot; - not &quot;hidd...
neural network rnn
1
In what way is recurrent neural network state "hidden"? -- (neural network rnn) <p>Recurrent neural networks have hidden state denoted <span class="math-container">$h$</span>. Why is the state considered &quot;hidden&quot;? It's clear to me what purpose the state itself serves, but I can't figure out why it is &quot;hi...
habedi/stack-exchange-dataset
94,758
Generate 3D "matrix" with Pandas, based on comparing two dataframes [Python]
<p>Good morning everyone. I am working with Python and Pandas.</p>&#xA;<p>I have two DataFrames, of the following type:</p>&#xA;<pre><code>df_C = pd.DataFrame(data=[[-3,-1,-1], [5,3,3], [3,3,1], [-1,-1,-3], [-3,-1,-1], [2,3,1], [1,1,1]], columns=['C1','C2','C3'])&#xA;&#xA; C1 C2 C3&#xA;0 -3 -1 -1&#xA;1 5 3 ...
python pandas python 3.x
1
Generate 3D "matrix" with Pandas, based on comparing two dataframes [Python] -- (python pandas python 3.x) <p>Good morning everyone. I am working with Python and Pandas.</p>&#xA;<p>I have two DataFrames, of the following type:</p>&#xA;<pre><code>df_C = pd.DataFrame(data=[[-3,-1,-1], [5,3,3], [3,3,1], [-1,-1,-3], [-3,-1...
habedi/stack-exchange-dataset
94,761
Pytorch: Starting with a high loss value, but the loss converged at the end. I dont know if the model could start with a loss > 100. Help!
<p>I have been trying to attempt plant disease detection using transfer learning methods. I chose ResNet50 first. I also performed a baseline model which is a CNN model. In resnet50, I used cross entropy loss and trained the model for 30 epochs. I did batch normalization too. Initially epoch 1 loss was 112.5250 and the...
machine learning deep learning cnn pytorch transfer learning
1
Pytorch: Starting with a high loss value, but the loss converged at the end. I dont know if the model could start with a loss > 100. Help! -- (machine learning deep learning cnn pytorch transfer learning) <p>I have been trying to attempt plant disease detection using transfer learning methods. I chose ResNet50 first. I...
habedi/stack-exchange-dataset
94,784
How to classify a set of words into one of the given labels
<p>I have three labels: amusement, calm and energetic.&#xA;I get sets of words like:&#xA;Set1 = {Cloud&#xA;Sky&#xA;People in nature&#xA;Plant&#xA;Flash photography&#xA;Happy&#xA;Shorts&#xA;Grass&#xA;Leisure&#xA;Recreation}&#xA;Set2 = {Plant&#xA;Green&#xA;Natural landscape&#xA;Natural environment&#xA;Branch&#xA;Tree&#xA...
classification nlp
1
How to classify a set of words into one of the given labels -- (classification nlp) <p>I have three labels: amusement, calm and energetic.&#xA;I get sets of words like:&#xA;Set1 = {Cloud&#xA;Sky&#xA;People in nature&#xA;Plant&#xA;Flash photography&#xA;Happy&#xA;Shorts&#xA;Grass&#xA;Leisure&#xA;Recreation}&#xA;Set2 = {P...
habedi/stack-exchange-dataset
94,815
Can a machine learning model be used as some kind of compression?
<p>I'm trying to understand how machine learning is working. I read a lot and now came into my mind that it could be missuses in a practical way. I also hope that this question is on topic here.</p>&#xA;<p>Please correct me if I have some wrong assumptions:</p>&#xA;<ul>&#xA;<li>All models require sample data</li>&#xA;<...
machine learning machine learning model
1
Can a machine learning model be used as some kind of compression? -- (machine learning machine learning model) <p>I'm trying to understand how machine learning is working. I read a lot and now came into my mind that it could be missuses in a practical way. I also hope that this question is on topic here.</p>&#xA;<p>Ple...
habedi/stack-exchange-dataset
94,829
Creating radial basis for linear regression Python
<p>I'm trying to do time series forecasting with linear regression like it's done in this video: <a href="https://www.youtube.com/watch?v=68ABAU_V8qI&amp;t=1817s" rel="nofollow noreferrer">Radial basis forecasting</a> starting from 5:50.</p>&#xA;<p>I understand the basic idea of basis, but I don't think I understood th...
python time series linear regression
1
Creating radial basis for linear regression Python -- (python time series linear regression) <p>I'm trying to do time series forecasting with linear regression like it's done in this video: <a href="https://www.youtube.com/watch?v=68ABAU_V8qI&amp;t=1817s" rel="nofollow noreferrer">Radial basis forecasting</a> starting ...
habedi/stack-exchange-dataset
94,831
Extremely negative r^2
<p>I use a linear regression to predict house prices (<a href="https://www.kaggle.com/c/house-prices-advanced-regression-techniques/overview" rel="nofollow noreferrer">https://www.kaggle.com/c/house-prices-advanced-regression-techniques/overview</a>). My linear regression sometimes works great with R^2 of 0.8 and somet...
python scikit learn linear regression
1
Extremely negative r^2 -- (python scikit learn linear regression) <p>I use a linear regression to predict house prices (<a href="https://www.kaggle.com/c/house-prices-advanced-regression-techniques/overview" rel="nofollow noreferrer">https://www.kaggle.com/c/house-prices-advanced-regression-techniques/overview</a>). My...
habedi/stack-exchange-dataset
94,837
Computing a cumulative distribution function in Python
<p>I'm trying to compute the distribution function of any of the usual distributions in Python... However, all the methods I've seen involve first drawing N samples from said distribution, and then order them somehow, and then do a cumulative sum.</p>&#xA;<p>In Mathematica, I can just do <code>CDF[ChiSquaredDistributio...
python statistics
1
Computing a cumulative distribution function in Python -- (python statistics) <p>I'm trying to compute the distribution function of any of the usual distributions in Python... However, all the methods I've seen involve first drawing N samples from said distribution, and then order them somehow, and then do a cumulative...
habedi/stack-exchange-dataset
94,842
TPOT machine learning
<p>I trained a regression <a href="https://epistasislab.github.io/tpot/" rel="nofollow noreferrer">TPOT algorithm</a> on Google Colab, where the output of the TPOT process is some boiler plate Python code as shown below.</p>&#xA;<pre><code>import numpy as np&#xA;import pandas as pd&#xA;from sklearn.ensemble import Extr...
machine learning python scikit learn regression pipelines
1
TPOT machine learning -- (machine learning python scikit learn regression pipelines) <p>I trained a regression <a href="https://epistasislab.github.io/tpot/" rel="nofollow noreferrer">TPOT algorithm</a> on Google Colab, where the output of the TPOT process is some boiler plate Python code as shown below.</p>&#xA;<pre><...
habedi/stack-exchange-dataset
94,843
Applying the same changes to the test set
<p>I'm busy working through Aurélien Géron's book. (Hands-On Machine Learning with Scikit-Learn, Keras, and Tensorflow)</p>&#xA;<p>The idea is to split the data into train and test set as early as possible in order to avoid data snooping bias. Afterwards changes are made to the data.</p>&#xA;<p>My question is that sinc...
training
1
Applying the same changes to the test set -- (training) <p>I'm busy working through Aurélien Géron's book. (Hands-On Machine Learning with Scikit-Learn, Keras, and Tensorflow)</p>&#xA;<p>The idea is to split the data into train and test set as early as possible in order to avoid data snooping bias. Afterwards changes a...
habedi/stack-exchange-dataset
94,849
Handling nominal category features in decision tree
<p>I have been reading some stackoverflow <a href="http://Using%20a%20OneHotEncoder%20is%20the%20only%20current%20valid%20way,%20allowing%20arbitrary%20splits%20not%20dependent%20on%20the%20label%20ordering,%20but%20is%20computationally%20expensive." rel="nofollow noreferrer">questions</a> on how to handle nominal feat...
python scikit learn decision trees categorical data one hot encoding
1
Handling nominal category features in decision tree -- (python scikit learn decision trees categorical data one hot encoding) <p>I have been reading some stackoverflow <a href="http://Using%20a%20OneHotEncoder%20is%20the%20only%20current%20valid%20way,%20allowing%20arbitrary%20splits%20not%20dependent%20on%20the%20labe...
habedi/stack-exchange-dataset
94,879
In U-Net, is there a non-linearity (relu) in up-convolution layer?
<p>I am doing semantic segmentatio using U-Net. I was wondering whether to include 'relu' activation or not in the up-convolution layer?</p>&#xA;<pre><code>x = Conv2DTranspose(filters, kernel_size) (x)&#xA;&#xA;OR&#xA;&#xA;x = Conv2DTranspose(filters, kernel_size, activation='relu') (x)&#xA;&#xA;<span class="math-conta...
deep learning tensorflow cnn
1
In U-Net, is there a non-linearity (relu) in up-convolution layer? -- (deep learning tensorflow cnn) <p>I am doing semantic segmentatio using U-Net. I was wondering whether to include 'relu' activation or not in the up-convolution layer?</p>&#xA;<pre><code>x = Conv2DTranspose(filters, kernel_size) (x)&#xA;&#xA;OR&#xA;&...
habedi/stack-exchange-dataset
94,886
How multi-head attention mechanism in Transformers is able to attend to information from different representation subspaces at different positions
<p>Question partially inspired by <a href="https://datascience.stackexchange.com/questions/55647/multi-head-attention-mechanism-in-transformer-and-need-of-feed-forward-neural-ne">this post</a> about the need of multi-head attention mechanism.</p>&#xA;<p>For me though it is still not clear how we will be able to initial...
machine learning deep learning neural network transformer attention mechanism
1
How multi-head attention mechanism in Transformers is able to attend to information from different representation subspaces at different positions -- (machine learning deep learning neural network transformer attention mechanism) <p>Question partially inspired by <a href="https://datascience.stackexchange.com/questions...
habedi/stack-exchange-dataset
94,934
dividing Mean by standard Deviation meaning
<p>I have played around with logistic regression a little using movement data intervals that are prelabeled as either resting or active.&#xA;I now found that if I divide the mean movement of the individual intervals by the intervals standard deviation, the outcome is quite a good predictor of whether the interval is a ...
regression statistics logistic regression variance mean
1
dividing Mean by standard Deviation meaning -- (regression statistics logistic regression variance mean) <p>I have played around with logistic regression a little using movement data intervals that are prelabeled as either resting or active.&#xA;I now found that if I divide the mean movement of the individual intervals...
habedi/stack-exchange-dataset
94,951
What the differences between self-supervised/semi-supervised in NLP?
<p>GPT-1 mentions both Semi-supervised learning and Unsupervised pre-training but it seems like the same to me. Moreoever, &quot;Semi-supervised Sequence Learning&quot; of Dai and Le also more like self-supervised learning. So what the key differences between them?</p>&#xA;
nlp semi supervised learning pretraining
1
What the differences between self-supervised/semi-supervised in NLP? -- (nlp semi supervised learning pretraining) <p>GPT-1 mentions both Semi-supervised learning and Unsupervised pre-training but it seems like the same to me. Moreoever, &quot;Semi-supervised Sequence Learning&quot; of Dai and Le also more like self-su...
habedi/stack-exchange-dataset
94,958
What if outliers still exist after variable transformation?
<p>I have a variable with a skewed distribution.</p>&#xA;<p><a href="https://i.stack.imgur.com/5KJGr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5KJGr.png" alt="enter image description here" /></a></p>&#xA;<p>I applied BoxCox transformation and now the variable follows a Gaussian distribution. Bu...
feature engineering outlier transformation
1
What if outliers still exist after variable transformation? -- (feature engineering outlier transformation) <p>I have a variable with a skewed distribution.</p>&#xA;<p><a href="https://i.stack.imgur.com/5KJGr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5KJGr.png" alt="enter image description here...
habedi/stack-exchange-dataset
94,969
Model accuracy when training on GPU and then inferencing on CPU
<p>When we are concerned about speed, <a href="https://datascience.stackexchange.com/questions/23341/should-i-use-gpu-or-cpu-for-inference">GPU is way better than CPU</a>.</p>&#xA;<p>But if I train a model on a GPU and then deploy the same trained model (no quantization techniques used) on a CPU, will this affect the a...
deep learning neural network accuracy gpu inference
1
Model accuracy when training on GPU and then inferencing on CPU -- (deep learning neural network accuracy gpu inference) <p>When we are concerned about speed, <a href="https://datascience.stackexchange.com/questions/23341/should-i-use-gpu-or-cpu-for-inference">GPU is way better than CPU</a>.</p>&#xA;<p>But if I train a...
habedi/stack-exchange-dataset
95,019
Why does adding data augmentation decrease training accuracy a tiny bit?
<p>Before data augmentation, my model clearly overfits and hits a 100% training accuracy and a 52% validation accuracy. When only adding data augmentation with Keras, as a regularization technique, it achieves a 95% training accuracy with slower convergence and a 80% validation accuracy (which is a way better result). ...
keras cnn image classification accuracy data augmentation
1
Why does adding data augmentation decrease training accuracy a tiny bit? -- (keras cnn image classification accuracy data augmentation) <p>Before data augmentation, my model clearly overfits and hits a 100% training accuracy and a 52% validation accuracy. When only adding data augmentation with Keras, as a regularizati...
habedi/stack-exchange-dataset
95,027
pytorch dataloader tensor modification
<pre><code>T=tensor([101,123,414,463][234,903,313,341]...)&#xA;train=TensorDataset(T)&#xA;train_dataloader=Dataloader(train)&#xA;</code></pre>&#xA;<p>Now I would like to update tensor <code>T[0]</code> i.e tensor</p>&#xA;<pre><code>T[0]=tensor([101,123,567,463])&#xA;</code></pre>&#xA;<p>for this i have tried as follows...
pytorch
1
pytorch dataloader tensor modification -- (pytorch) <pre><code>T=tensor([101,123,414,463][234,903,313,341]...)&#xA;train=TensorDataset(T)&#xA;train_dataloader=Dataloader(train)&#xA;</code></pre>&#xA;<p>Now I would like to update tensor <code>T[0]</code> i.e tensor</p>&#xA;<pre><code>T[0]=tensor([101,123,567,463])&#xA;<...
habedi/stack-exchange-dataset
1
What are the disadvantages of first-past-the-post electoral systems?
<p>We all know the situation could arise in the U.S. where one candidate wins the popular vote but another one the electoral college. Given that the same could arise in the United Kingdom and other countries with a <a href="http://www.electoral-reform.org.uk/first-past-the-post" rel="noreferrer">first-past-the-post or ...
election voting systems electoral system first past the post
1
What are the disadvantages of first-past-the-post electoral systems? -- (election voting systems electoral system first past the post) <p>We all know the situation could arise in the U.S. where one candidate wins the popular vote but another one the electoral college. Given that the same could arise in the United Kingd...
habedi/stack-exchange-dataset
2
Why can't voting be fair if there are more than two alternatives?
<p>I've heard that mathematically it can be shown that given any voting system with more than two choices, voters can cheat the system by not voting their true opinions in order to game the system and help their first choice.</p>&#xA;&#xA;<p>Why is this the case and what would be an example of its application. How can ...
voting political theory voting systems
1
Why can't voting be fair if there are more than two alternatives? -- (voting political theory voting systems) <p>I've heard that mathematically it can be shown that given any voting system with more than two choices, voters can cheat the system by not voting their true opinions in order to game the system and help thei...
habedi/stack-exchange-dataset