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 |
|---|---|---|---|---|---|---|
77,369 | Generative Adversarial Text to Image Synthesis | <p>Can anyone explain the meaning of this line:
"Deep networks have been shown to learn representations
in which interpolations between embedding pairs tend to
be near the data manifold".</p>
<p>Reference: Section 4.3 of the paper <a href="https://arxiv.org/pdf/1605.05396.pdf" rel="nofollow no... | gan embeddings deep learning manifold | 1 | Generative Adversarial Text to Image Synthesis -- (gan embeddings deep learning manifold)
<p>Can anyone explain the meaning of this line:
"Deep networks have been shown to learn representations
in which interpolations between embedding pairs tend to
be near the data manifold".</p>
<p>Reference... | habedi/stack-exchange-dataset |
77,373 | Dummy variable only for character value in a column (Neglecting float and integers) | <p>My dataset consists of 3000 rows and 50 columns, out of which one column (<em>ESTIMATE_FAMILY_CONTRIBUTION</em>) contains all numerical value(around 2000 different values like 20,30,32....) but got one value as String e.g. <em>'No_information'</em>.
<br><br>When I create dummies(One-Hot Encoded) for the Feature... | logistic regression dummy variables | 1 | Dummy variable only for character value in a column (Neglecting float and integers) -- (logistic regression dummy variables)
<p>My dataset consists of 3000 rows and 50 columns, out of which one column (<em>ESTIMATE_FAMILY_CONTRIBUTION</em>) contains all numerical value(around 2000 different values like 20,30,32....) b... | habedi/stack-exchange-dataset |
77,390 | Where is the Backward function defined in PyTorch? | <p>This might sound a little basic but while running the code below, I wanted to see the source code of the <strong>backward</strong> function:</p>
<pre><code>import torch.nn as nn

[...]
criterion = nn.CrossEntropyLoss()
loss = criterion(output, target)
loss.backward()
</code></pre>
<p>... | pytorch | 1 | Where is the Backward function defined in PyTorch? -- (pytorch)
<p>This might sound a little basic but while running the code below, I wanted to see the source code of the <strong>backward</strong> function:</p>
<pre><code>import torch.nn as nn

[...]
criterion = nn.CrossEntropyLoss()
loss = criteri... | habedi/stack-exchange-dataset |
77,391 | Is there a method to apply trained weights to a model with the same input shape and model architecture but different output shape? | <p>I am developing a speaker identification model in Keras, and I have saved the weights from a trained custom model. Now, I am looking to use the trained weights to fine tune the model on a new dataset, but I am having trouble since the new dataset contains a different number of speakers than the first, so the new out... | machine learning python neural network keras tensorflow | 1 | Is there a method to apply trained weights to a model with the same input shape and model architecture but different output shape? -- (machine learning python neural network keras tensorflow)
<p>I am developing a speaker identification model in Keras, and I have saved the weights from a trained custom model. Now, I am ... | habedi/stack-exchange-dataset |
77,397 | Modeling price vs demand | <p>I have a dataset consisting of products, clients, price policy, discounts, quantities, and net sales. The task as put in words by the business is quantity vs price. I have noted a few observations from looking at the dataset :</p>
<ol>
<li><p>Discounts: Discounts nullify the effect of any change in the Price... | machine learning regression predictive modeling | 1 | Modeling price vs demand -- (machine learning regression predictive modeling)
<p>I have a dataset consisting of products, clients, price policy, discounts, quantities, and net sales. The task as put in words by the business is quantity vs price. I have noted a few observations from looking at the dataset :</p>
<ol>... | habedi/stack-exchange-dataset |
77,399 | Computing adjusted p-values in batches | <h2>Data</h2>
<p>For simplicity I propose the following scheme:</p>
<ol>
<li>I have two DataFrames, one with genes, the other with miRNA (it is a simple example, it is not the case what the DF are), the data are continuous:</li>
</ol>
<pre><code> Gene_1 Gene_2 Gene_3 ... | python r statistics correlation | 1 | Computing adjusted p-values in batches -- (python r statistics correlation)
<h2>Data</h2>
<p>For simplicity I propose the following scheme:</p>
<ol>
<li>I have two DataFrames, one with genes, the other with miRNA (it is a simple example, it is not the case what the DF are), the data are continuous:</li>
... | habedi/stack-exchange-dataset |
77,416 | What is the best way to pick the optimized configuration from this dataset? | <p>I have about 8000 configurations in an excel sheet. each configuration has four scores as seen in the image below. I would like to choose the best solution that has the highest lighting level score, lowest energy consumption score, the highest visual comfort score, the highest thermal comfort score, and the lowest C... | optimization ranking | 1 | What is the best way to pick the optimized configuration from this dataset? -- (optimization ranking)
<p>I have about 8000 configurations in an excel sheet. each configuration has four scores as seen in the image below. I would like to choose the best solution that has the highest lighting level score, lowest energy co... | habedi/stack-exchange-dataset |
77,424 | feature scaling xgbRegressor | <p>I read for example in this answer:
<a href="https://datascience.stackexchange.com/questions/77312/does-the-performance-of-gbm-methods-profit-from-feature-scaling">Does the performance of GBM methods profit from feature scaling?</a></p>
<p>that scaling doesn´t affect the performance of any tree-based method, ... | machine learning decision trees xgboost normalization feature scaling | 1 | feature scaling xgbRegressor -- (machine learning decision trees xgboost normalization feature scaling)
<p>I read for example in this answer:
<a href="https://datascience.stackexchange.com/questions/77312/does-the-performance-of-gbm-methods-profit-from-feature-scaling">Does the performance of GBM methods profit fro... | habedi/stack-exchange-dataset |
77,429 | Getting value of 2 in normalized confusion matrix | <p>I have created confusion matrix with python and I have gotten weird results that made me worried:</p>
<p><a href="https://i.stack.imgur.com/MYnQc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MYnQc.png" alt="enter image description here" /></a></p>
<p>as you can see, I have value of two,... | python confusion matrix | 1 | Getting value of 2 in normalized confusion matrix -- (python confusion matrix)
<p>I have created confusion matrix with python and I have gotten weird results that made me worried:</p>
<p><a href="https://i.stack.imgur.com/MYnQc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MYnQc.png" alt="enter... | habedi/stack-exchange-dataset |
77,430 | Train/Test dataset and model | <p>I would like to ask you how to work on train and test dataset. I have unlabelled data. They are short text (max 100 characters) and I would need to understand their sentiment.
To do this, I am manually assigning labels (1,0,-1). However I have more than 2000 text and I would like to find a way to do it automatic... | machine learning predictive modeling training data science model | 1 | Train/Test dataset and model -- (machine learning predictive modeling training data science model)
<p>I would like to ask you how to work on train and test dataset. I have unlabelled data. They are short text (max 100 characters) and I would need to understand their sentiment.
To do this, I am manually assigning la... | habedi/stack-exchange-dataset |
77,455 | Time series binary classification | <p>Which deep learning architecture and algorithms do you most recommend for time series classification problem?</p>
<p>Of course LSTM, I am looking for state of the art papers.</p>
 | deep learning classification time series lstm | 1 | Time series binary classification -- (deep learning classification time series lstm)
<p>Which deep learning architecture and algorithms do you most recommend for time series classification problem?</p>
<p>Of course LSTM, I am looking for state of the art papers.</p>
 | habedi/stack-exchange-dataset |
77,462 | One Hot Encoding for any kind of dataset | <p>How can I make a one hot encoding for a unknown dataset which can iterate and check the dytype of the dataset and do one hot encoding by checking the number of unique values of the columns, also how to keep track of the new one hot encoded data with the original dataset?</p>
 | data python 3.x one hot encoding | 1 | One Hot Encoding for any kind of dataset -- (data python 3.x one hot encoding)
<p>How can I make a one hot encoding for a unknown dataset which can iterate and check the dytype of the dataset and do one hot encoding by checking the number of unique values of the columns, also how to keep track of the new one hot encode... | habedi/stack-exchange-dataset |
77,463 | parsing dictionary to JSON | <p>I used the following code to pass a json string as a parameter in requests.post method,</p>
<pre><code>import json
data = {'Key': 'Value',"title": "hello world"}
# get string with all double quotes
json_string = json.dumps(data) 
json_string
</code></pre>
<p>output is<... | python pandas json | 1 | parsing dictionary to JSON -- (python pandas json)
<p>I used the following code to pass a json string as a parameter in requests.post method,</p>
<pre><code>import json
data = {'Key': 'Value',"title": "hello world"}
# get string with all double quotes
json_string = json.dumps(data) &... | habedi/stack-exchange-dataset |
77,464 | How to get model attributes in scikit learn (not hyper parameters) | <p>How to get model attributes list (not hyper parameters passed to Estimator's class)?</p>
<p>For ex:</p>
<pre><code>kmeans = KMeans(n_clusters=5) 
kmeans.fit(X)
kmeans.labels_ 
</code></pre>
<p>how to get list of the attributes like labels_ from model object (ending with _)?</p>
 | machine learning scikit learn clustering | 1 | How to get model attributes in scikit learn (not hyper parameters) -- (machine learning scikit learn clustering)
<p>How to get model attributes list (not hyper parameters passed to Estimator's class)?</p>
<p>For ex:</p>
<pre><code>kmeans = KMeans(n_clusters=5) 
kmeans.fit(X)
kmeans.labels_ 
</code><... | habedi/stack-exchange-dataset |
77,469 | Topics to learn in Neural Network | <p>I have recently started learning Deep Neural Networks and was going through the tutorials online. Everywhere I saw that the topics post Image classification using CNN is a little hazy. No one seems to follow a guide as to what topics should one learn after learning image classification.</p>
<p>I would really app... | machine learning deep learning | 1 | Topics to learn in Neural Network -- (machine learning deep learning)
<p>I have recently started learning Deep Neural Networks and was going through the tutorials online. Everywhere I saw that the topics post Image classification using CNN is a little hazy. No one seems to follow a guide as to what topics should one le... | habedi/stack-exchange-dataset |
77,470 | How to perform a running (moving) standardization for feature scaling of a growing dataset? | <p>Let's say that there is a function <span class="math-container">$r$</span></p>
<p><span class="math-container">$r_n = r(\tau_n)$</span>,</p>
<p>where <span class="math-container">$n$</span> denotes a so-called time-step of a system with an evolving state. Both <span class="math-container">$\rho$</span> and <... | statistics feature scaling | 1 | How to perform a running (moving) standardization for feature scaling of a growing dataset? -- (statistics feature scaling)
<p>Let's say that there is a function <span class="math-container">$r$</span></p>
<p><span class="math-container">$r_n = r(\tau_n)$</span>,</p>
<p>where <span class="math-container">$n$</s... | habedi/stack-exchange-dataset |
77,473 | SparseCategoricalCrosstentropy vs sparse_categorical_crossentropy | <p>What is the difference between SparseCategoricalCrosstentropy and sparse_categorical_crossentropy ?</p>
<p><a href="https://www.tensorflow.org/api_docs/python/tf/keras/losses/SparseCategoricalCrossentropy" rel="nofollow noreferrer">SparseCategoricalCrossentropy</a>: Computes the crossentropy loss between the lab... | keras tensorflow loss function | 1 | SparseCategoricalCrosstentropy vs sparse_categorical_crossentropy -- (keras tensorflow loss function)
<p>What is the difference between SparseCategoricalCrosstentropy and sparse_categorical_crossentropy ?</p>
<p><a href="https://www.tensorflow.org/api_docs/python/tf/keras/losses/SparseCategoricalCrossentropy" rel="... | habedi/stack-exchange-dataset |
77,499 | pandas groupby and sort values | <p>I am studying for an exam and encountered this problem from past worksheets:
<a href="https://i.stack.imgur.com/rBWLi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rBWLi.png" alt="enter image description here" /></a></p>
<p>This is the data frame called 'contest' with granularity as each... | pandas groupby | 1 | pandas groupby and sort values -- (pandas groupby)
<p>I am studying for an exam and encountered this problem from past worksheets:
<a href="https://i.stack.imgur.com/rBWLi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rBWLi.png" alt="enter image description here" /></a></p>
<p>This is the d... | habedi/stack-exchange-dataset |
77,510 | Selecting threshold for F1 Score | <p>When selecting a probability threshold to maximize the F1 score prior to deploying a model (based on the precision-recall curve), should the threshold be selected based on the training or holdout dataset?</p>
 | machine learning data mining class imbalance f1score | 1 | Selecting threshold for F1 Score -- (machine learning data mining class imbalance f1score)
<p>When selecting a probability threshold to maximize the F1 score prior to deploying a model (based on the precision-recall curve), should the threshold be selected based on the training or holdout dataset?</p>
 | habedi/stack-exchange-dataset |
77,511 | Negatively correlated features | <p>Is it ok to use negatively correlated features in data modeling? Say I have features <code>A</code> and <code>B</code> that have a correlation coefficient of 0.2 and features <code>C</code> and <code>D</code> with -0.2 correlation coefficient, is it fine to use features <code>C</code> and <code>D</code> in the model... | correlation | 1 | Negatively correlated features -- (correlation)
<p>Is it ok to use negatively correlated features in data modeling? Say I have features <code>A</code> and <code>B</code> that have a correlation coefficient of 0.2 and features <code>C</code> and <code>D</code> with -0.2 correlation coefficient, is it fine to use feature... | habedi/stack-exchange-dataset |
77,520 | Interpreting the results based on Granger Causality test | <p>I am trying to use Granger Causality test: <a href="https://www.statsmodels.org/stable/generated/statsmodels.tsa.stattools.grangercausalitytests.html" rel="nofollow noreferrer">https://www.statsmodels.org/stable/generated/statsmodels.tsa.stattools.grangercausalitytests.html</a></p>
<p>to assess whether "po... | statistics chi square test hypothesis testing | 1 | Interpreting the results based on Granger Causality test -- (statistics chi square test hypothesis testing)
<p>I am trying to use Granger Causality test: <a href="https://www.statsmodels.org/stable/generated/statsmodels.tsa.stattools.grangercausalitytests.html" rel="nofollow noreferrer">https://www.statsmodels.org/sta... | habedi/stack-exchange-dataset |
77,534 | How to use df.groupby() to select and sum specific columns w/o pandas trimming total number of columns | <p>I got Column1, Column2, Column3, Column4, Column5, Column6</p>
<p>I'd like to group Column1 and get the row sum of Column3,4 and 5</p>
<p>When I apply groupby() and get this that is correct but it's leaving out Column6:</p>
<pre><code> df = df.groupby(['Column1'])[['Column3', 'Column4', 'Column5']].su... | python pandas automatic summarization groupby | 1 | How to use df.groupby() to select and sum specific columns w/o pandas trimming total number of columns -- (python pandas automatic summarization groupby)
<p>I got Column1, Column2, Column3, Column4, Column5, Column6</p>
<p>I'd like to group Column1 and get the row sum of Column3,4 and 5</p>
<p>When I apply grou... | habedi/stack-exchange-dataset |
77,541 | How is GPT able to handle large vocabularies? | <p>From what I understand, GPT and GPT-2 are trained to predict the <span class="math-container">$N^{th}$</span> word in a sentence given the previous <span class="math-container">$N-1$</span> words. When the vocabulary size is very large (100k+ words) how is it able to generate any meaningful prediction? Shouldn't it ... | deep learning nlp openai gpt | 1 | How is GPT able to handle large vocabularies? -- (deep learning nlp openai gpt)
<p>From what I understand, GPT and GPT-2 are trained to predict the <span class="math-container">$N^{th}$</span> word in a sentence given the previous <span class="math-container">$N-1$</span> words. When the vocabulary size is very large (... | habedi/stack-exchange-dataset |
77,550 | First two principal components explain 100% variance of data set with 300 features | <p>I am trying to do some analysis on my data set with PCA so I can effectively cluster it with kmeans.</p>
<p>My preprocessed data is tokenized, filtered (stopwords, punctuation, etc.), POS tagged, and lemmatized</p>
<p>I create a data set of about 1.2 million tweet vectors (300 features each) by taking the av... | machine learning python nlp clustering pca | 1 | First two principal components explain 100% variance of data set with 300 features -- (machine learning python nlp clustering pca)
<p>I am trying to do some analysis on my data set with PCA so I can effectively cluster it with kmeans.</p>
<p>My preprocessed data is tokenized, filtered (stopwords, punctuation, etc.)... | habedi/stack-exchange-dataset |
77,574 | How to use id's in binary classification problem | <p>I would like to predict for a given user (on a website) if he/she logs out from the website within ten minutes.</p>
<p>In terms of data, I have a user ID and timestamp of the latest post on the website.</p>
<p>example of an id: <code>54a47e7a9cd118513</code></p>
<p>It would be great to get advice on how ... | machine learning classification time series feature engineering supervised learning | 1 | How to use id's in binary classification problem -- (machine learning classification time series feature engineering supervised learning)
<p>I would like to predict for a given user (on a website) if he/she logs out from the website within ten minutes.</p>
<p>In terms of data, I have a user ID and timestamp of the ... | habedi/stack-exchange-dataset |
77,590 | How to use multiple cross-section observations per subject for churn prediction? | <p>Recently I have started to teach myself about machine learning and I have ran into a dataset, which got me a bit confused.</p>
<p><strong>Dataset:</strong> The subjects of the dataset are university students (student ID == "Key" feature), and each observation is a summary of their semester (grade avera... | machine learning python churn | 1 | How to use multiple cross-section observations per subject for churn prediction? -- (machine learning python churn)
<p>Recently I have started to teach myself about machine learning and I have ran into a dataset, which got me a bit confused.</p>
<p><strong>Dataset:</strong> The subjects of the dataset are universit... | habedi/stack-exchange-dataset |
77,592 | How does SVM classify images? | <p>I have read about SVM and understood that for complex divisions, the SVM theoretically plots the data into a higher dimensional plane such that the in the new dimension the data is linearly separable and to achieve this in a practical way, it uses kernel functions which in place of actually transforming the data int... | image classification svm | 1 | How does SVM classify images? -- (image classification svm)
<p>I have read about SVM and understood that for complex divisions, the SVM theoretically plots the data into a higher dimensional plane such that the in the new dimension the data is linearly separable and to achieve this in a practical way, it uses kernel fu... | habedi/stack-exchange-dataset |
77,595 | AttributeError: 'DataFrame' object has no attribute 'ix' | <p>I was learning Classification-based collaboration system and while running the code I faced the error <strong>AttributeError: 'DataFrame' object has no attribute 'ix'</strong>. Here is the code I write until now.
<code>X=bank_full.ix[:,(18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36)].values</code></p>... | pandas dataframe | 1 | AttributeError: 'DataFrame' object has no attribute 'ix' -- (pandas dataframe)
<p>I was learning Classification-based collaboration system and while running the code I faced the error <strong>AttributeError: 'DataFrame' object has no attribute 'ix'</strong>. Here is the code I write until now.
<code>X=bank_full.ix[... | habedi/stack-exchange-dataset |
77,606 | Tensorflow, how many layers does this model have? | <p>I'm very new to machine learning and I'm not sure about Tensorflow implementation of neural network model. How many layers does the model below have?</p>
<pre><code>model = Sequential() 
 model.add(Dense(200, activation="tanh"))
 model.add(Dropout(0.3))
 model.add(Dense(1, activati... | deep learning tensorflow | 1 | Tensorflow, how many layers does this model have? -- (deep learning tensorflow)
<p>I'm very new to machine learning and I'm not sure about Tensorflow implementation of neural network model. How many layers does the model below have?</p>
<pre><code>model = Sequential() 
 model.add(Dense(200, activation="... | habedi/stack-exchange-dataset |
77,608 | Is it possible to compress a sequence of numbers through an autoencoder? | <p>Specifically: I would like compress a set of coordinates, which map to the locations of 1's in a binary image, and then decode back to the original set. For instance, for a 16x16 image, the input might be something like the following:</p>
<p>[5, 4], [12, 5], [8, 7],....</p>
<p>I am not looking to recognize a... | autoencoder representation | 1 | Is it possible to compress a sequence of numbers through an autoencoder? -- (autoencoder representation)
<p>Specifically: I would like compress a set of coordinates, which map to the locations of 1's in a binary image, and then decode back to the original set. For instance, for a 16x16 image, the input might be somethi... | habedi/stack-exchange-dataset |
77,623 | Confusion between precision and recall | <p>I have a machine learning model that try to fingerprint the functions in a binary file with a corpus. Final output of upon inputing a binary file is a table with one to one mapping between the binary function and the corpus function as follows-:
<a href="https://i.stack.imgur.com/P6YWd.png" rel="nofollow norefer... | classification multiclass classification metric | 1 | Confusion between precision and recall -- (classification multiclass classification metric)
<p>I have a machine learning model that try to fingerprint the functions in a binary file with a corpus. Final output of upon inputing a binary file is a table with one to one mapping between the binary function and the corpus f... | habedi/stack-exchange-dataset |
77,632 | What's the complexity of HDBSCAN? | <p>I can't find any complexity information about <code>HDBSCAN</code> by google or wiki.</p>
<p>And how about compare to OPTICS?</p>
 | clustering | 1 | What's the complexity of HDBSCAN? -- (clustering)
<p>I can't find any complexity information about <code>HDBSCAN</code> by google or wiki.</p>
<p>And how about compare to OPTICS?</p>
 | habedi/stack-exchange-dataset |
77,636 | How to select 'cutoff' of classifier probability | <p>I have recently used xgboost to conduct binary classification in an nlp problem. The idea was to identify if a particular article belonged to an author or not, pretty standard exercise.</p>
<p>The results are outputted as a probability between 0 and 1, and there is the ocasional article that is completely miscla... | classification metric | 1 | How to select 'cutoff' of classifier probability -- (classification metric)
<p>I have recently used xgboost to conduct binary classification in an nlp problem. The idea was to identify if a particular article belonged to an author or not, pretty standard exercise.</p>
<p>The results are outputted as a probability b... | habedi/stack-exchange-dataset |
77,644 | Count the max number of consecutive 1 and 0 in Pandas Dataframe | <p>Hey I have the following Dataset</p>
<pre><code>import pandas as pd
df = pd.DataFrame({ 
'column1': [0,0,1,0,1,0,0,1,1,0,1,1,1]})
</code></pre>
<p>I want to be able to count the number of consecutive 1 and 0 and generate 2 columns as such:</p>
<pre><code>consec0: 1,2,_,1,_,1,2,_,_,1,_,_,_&... | python pandas preprocessing numpy | 1 | Count the max number of consecutive 1 and 0 in Pandas Dataframe -- (python pandas preprocessing numpy)
<p>Hey I have the following Dataset</p>
<pre><code>import pandas as pd
df = pd.DataFrame({ 
'column1': [0,0,1,0,1,0,0,1,1,0,1,1,1]})
</code></pre>
<p>I want to be able to count the number of con... | habedi/stack-exchange-dataset |
77,651 | Predicting sequence element based on the previous M and the following N elements | <p>I have an array of sequences of equal length, each sequence contains 300 numbers (M=300). Each element in a sequence is a number from 1 to 9:</p>
<pre><code>13571398...2455 # 300 numbers
33344467...1143 # 300 numbers
...
...
...
66118859...2121 # 300 numbers
</code></pre>
<p>My task i... | keras lstm pytorch sequence deep learning | 1 | Predicting sequence element based on the previous M and the following N elements -- (keras lstm pytorch sequence deep learning)
<p>I have an array of sequences of equal length, each sequence contains 300 numbers (M=300). Each element in a sequence is a number from 1 to 9:</p>
<pre><code>13571398...2455 # 300 number... | habedi/stack-exchange-dataset |
77,653 | How is the fit function in SimpleImputer working to find the mean in the Salary column as well when just the Age column is given as its argument? | <p>The only argument inside the fit function of SimpleImputer is: 'Age'. Yet the returned output worked on the 'Salary' column as well. That is what I am unable to understand.</p>
<p>Here is my code (considering all the necessary libraries imported):</p>
<pre><code>from sklearn.impute import SimpleImputer
i... | data cleaning preprocessing | 1 | How is the fit function in SimpleImputer working to find the mean in the Salary column as well when just the Age column is given as its argument? -- (data cleaning preprocessing)
<p>The only argument inside the fit function of SimpleImputer is: 'Age'. Yet the returned output worked on the 'Salary' column as well. That ... | habedi/stack-exchange-dataset |
77,662 | Why cant I overfit this dataset with my neural network? | <p>I have read that given a model is complex enough and I train for enough epochs, my model should at some point overfit the dataset. However I implemented a simple neural network in keras and my validation set loss seems to never go up:</p>
<pre><code>import tensorflow as tf
from tensorflow import keras
im... | neural network keras overfitting | 1 | Why cant I overfit this dataset with my neural network? -- (neural network keras overfitting)
<p>I have read that given a model is complex enough and I train for enough epochs, my model should at some point overfit the dataset. However I implemented a simple neural network in keras and my validation set loss seems to n... | habedi/stack-exchange-dataset |
77,663 | decision -tree regression to avoid multicollinearity for regression model? | <p>I read in comments a recommendation for decision tree´s instead of linear models like neural network, when the dataset has many correlated features. Because to avoid multicollinearity.
A similar question is already placed, but not really answered.
<a href="https://stats.stackexchange.com/questions/137573/do-... | regression decision trees data science model collinearity | 1 | decision -tree regression to avoid multicollinearity for regression model? -- (regression decision trees data science model collinearity)
<p>I read in comments a recommendation for decision tree´s instead of linear models like neural network, when the dataset has many correlated features. Because to avoid multicollinea... | habedi/stack-exchange-dataset |
77,679 | How do reshape an image to fit my Mnist Convolutional model? | <p><em><strong>I have done research but cannot seem to find what's wrong here</strong></em></p>
<p>I have created this model for Mnist digit clasification :</p>
<pre><code>import numpy as np
import matplotlib.pyplot as plt
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers i... | deep learning scikit learn image classification image preprocessing mnist | 1 | How do reshape an image to fit my Mnist Convolutional model? -- (deep learning scikit learn image classification image preprocessing mnist)
<p><em><strong>I have done research but cannot seem to find what's wrong here</strong></em></p>
<p>I have created this model for Mnist digit clasification :</p>
<pre><code>... | habedi/stack-exchange-dataset |
77,684 | Time-series grouped cross-validation | <p>I have data with the following structure:</p>
<pre><code>created_at | customer_id | features | target
2019-01-01 2 xxxxxxxx y 
2019-01-02 3 xxxxxxxx y 
2019-01-03 3 xxxxxxxx y 
...

</code></pre>
<p>That is, a session time... | machine learning time series cross validation | 1 | Time-series grouped cross-validation -- (machine learning time series cross validation)
<p>I have data with the following structure:</p>
<pre><code>created_at | customer_id | features | target
2019-01-01 2 xxxxxxxx y 
2019-01-02 3 xxxxxxxx y 
2019-01-03 ... | habedi/stack-exchange-dataset |
77,685 | What is a "surrogate model"? | <p>While reading about model explainability and model accountability, the term surrogate model keeps appearing. I had an idea about what it is but it does not seem to make sense anymore:</p>
<ul>
<li><p><strong>What is a surrogate models?</strong></p>
</li>
<li><p><strong>Why are surrogate models good f... | machine learning explainable ai | 1 | What is a "surrogate model"? -- (machine learning explainable ai)
<p>While reading about model explainability and model accountability, the term surrogate model keeps appearing. I had an idea about what it is but it does not seem to make sense anymore:</p>
<ul>
<li><p><strong>What is a surrogate models?</strong... | habedi/stack-exchange-dataset |
77,698 | Cleaning a certain feature to predict salary using Machine Learning | <p><em><strong>Info</strong></em>:</p>
<p>I am working on a dataset, and i would like to create a model that would predict salary.</p>
<p>Columns are as follows:</p>
<pre><code>Index(['ID', 'Salary', 'DOJ', 'DOL', 'Designation', 'JobCity', 'Gender', 'DOB',
 '10percentage', '10board', '12percentage... | machine learning python dataset regression data cleaning | 1 | Cleaning a certain feature to predict salary using Machine Learning -- (machine learning python dataset regression data cleaning)
<p><em><strong>Info</strong></em>:</p>
<p>I am working on a dataset, and i would like to create a model that would predict salary.</p>
<p>Columns are as follows:</p>
<pre><code>I... | habedi/stack-exchange-dataset |
77,701 | Keras model.predict giving different shape from training label array | <p>I'm using the following code to try and learn tensorflow. I've clearly specified the shapes of the training and validation <code>X</code> and <code>y</code> arrays.</p>
<pre><code>import numpy as np
import tensorflow as tf

f = lambda x: 2*x
Xtrain = np.random.rand(400,1)
ytrain = f(Xtrain)&#... | tensorflow | 1 | Keras model.predict giving different shape from training label array -- (tensorflow)
<p>I'm using the following code to try and learn tensorflow. I've clearly specified the shapes of the training and validation <code>X</code> and <code>y</code> arrays.</p>
<pre><code>import numpy as np
import tensorflow as tf&#... | habedi/stack-exchange-dataset |
77,704 | How to find correlation between categorical data and continuous data | <p>I'm working on imputing null values in the Titanic dataset.
The <code>'Embarked'</code> column has some. I do NOT want to just set them all to the most common value, <code>'S'</code>.
I want to impute <code>'Embarked'</code> based on its correlation with the other columns.</p>
<p>I have tried applying th... | scikit learn categorical data correlation kaggle | 1 | How to find correlation between categorical data and continuous data -- (scikit learn categorical data correlation kaggle)
<p>I'm working on imputing null values in the Titanic dataset.
The <code>'Embarked'</code> column has some. I do NOT want to just set them all to the most common value, <code>'S'</code>.
I ... | habedi/stack-exchange-dataset |
77,711 | Layer weights don't match in keras | <p>This question uses the following code:</p>
<pre><code>Xtrain = np.random.rand(400,1)
ytrain = f(Xtrain)
Xval = np.random.rand(200,1)
yval = f(Xval)

model = tf.keras.models.Sequential([
 tf.keras.layers.Dense(10, activation='relu'),
 #tf.keras.layers.Dense(10, activation='relu')... | keras tensorflow | 1 | Layer weights don't match in keras -- (keras tensorflow)
<p>This question uses the following code:</p>
<pre><code>Xtrain = np.random.rand(400,1)
ytrain = f(Xtrain)
Xval = np.random.rand(200,1)
yval = f(Xval)

model = tf.keras.models.Sequential([
 tf.keras.layers.Dense(10, activation='relu... | habedi/stack-exchange-dataset |
77,732 | Confidence rating for regression tasks | <p>In classification tasks, we can interpret the output vector as how "confident" the model is that the input has a certain label. For example,</p>
<pre><code>y = [0.01 0.20 0.99 0.10]
</code></pre>
<p>would mean the model is 99% certain the input has label with index 2 and 1% certain it has la... | regression confidence | 1 | Confidence rating for regression tasks -- (regression confidence)
<p>In classification tasks, we can interpret the output vector as how "confident" the model is that the input has a certain label. For example,</p>
<pre><code>y = [0.01 0.20 0.99 0.10]
</code></pre>
<p>would mean the model is 99%... | habedi/stack-exchange-dataset |
77,742 | Cost sensitive learning and class balancing | <p>I am facing a <strong>classification problem with classes that are really imbalanced</strong> (more or less 1% of positive cases). In addition, <strong>the "cost" of a False Negative (FN) is much higher than the cost of False Positive (FP).</strong></p>
<p>Considering so, I decided to insert the weight... | machine learning classification class imbalance cost function | 1 | Cost sensitive learning and class balancing -- (machine learning classification class imbalance cost function)
<p>I am facing a <strong>classification problem with classes that are really imbalanced</strong> (more or less 1% of positive cases). In addition, <strong>the "cost" of a False Negative (FN) is much ... | habedi/stack-exchange-dataset |
77,743 | How to restrict the columns to be passed to final classifier in PMML Pipeline | <p>I am working on building XGBoost PMML using SKLearn and SKLearn2PMML.
I am having some numerical,somecategorical and datetime columns from which i am creating new feature inside the pipeline. When i am trying to train the model, it gets failed as the original categorical features also gets passed to the final cl... | python scikit learn pipelines | 1 | How to restrict the columns to be passed to final classifier in PMML Pipeline -- (python scikit learn pipelines)
<p>I am working on building XGBoost PMML using SKLearn and SKLearn2PMML.
I am having some numerical,somecategorical and datetime columns from which i am creating new feature inside the pipeline. When i a... | habedi/stack-exchange-dataset |
77,761 | Text classification with Word2Vec on a larger corpus | <p>I am working on a small project and I would like to use the word2vec technique as a text representation method. I need to classify patents but I have only a few of them labelled and to increase the performance of my ML model, I would like to increase the corpus/vocabulary of my model by using a large amount of pate... | machine learning nlp word2vec text classification corpus | 1 | Text classification with Word2Vec on a larger corpus -- (machine learning nlp word2vec text classification corpus)
<p>I am working on a small project and I would like to use the word2vec technique as a text representation method. I need to classify patents but I have only a few of them labelled and to increase the per... | habedi/stack-exchange-dataset |
77,770 | Explanation on some steps of AdaBoost.R2 | <p>I am trying to understand AdaBoost.R2 in order to implement it and apply it to a regression problem. In this circumstances I need to understand it perfectly, however there's some step i don't really get.</p>
<p>The paper is available here, and Adaboost.R2 is presented in section 3:<br />
<a href="http://cite... | boosting mathematics adaboost | 1 | Explanation on some steps of AdaBoost.R2 -- (boosting mathematics adaboost)
<p>I am trying to understand AdaBoost.R2 in order to implement it and apply it to a regression problem. In this circumstances I need to understand it perfectly, however there's some step i don't really get.</p>
<p>The paper is available her... | habedi/stack-exchange-dataset |
77,803 | Why can't I specify the correct NumPy size? | <p>In the network (model of Keras, Sequential), the input layer must have 4 neurons. The input must be 1 list, the length of which is 4, each element is a number.</p>
<pre><code>print("SHAPE:", np.array([1, 1, 1, 1]).shape)

self.model.fit(np.array([1, 1, 1, 1]),
self.rightAnswer, 
epochs ... | python neural network keras numpy | 1 | Why can't I specify the correct NumPy size? -- (python neural network keras numpy)
<p>In the network (model of Keras, Sequential), the input layer must have 4 neurons. The input must be 1 list, the length of which is 4, each element is a number.</p>
<pre><code>print("SHAPE:", np.array([1, 1, 1, 1]).shape)... | habedi/stack-exchange-dataset |
77,813 | Logistic regression does cannot converge without poor model performance | <p>I have a multi-class classification logistic regression model. Using a very basic sklearn pipeline I am taking in cleansed text descriptions of an object and classifying said object into a category.</p>
<pre><code>logreg = Pipeline([('vect', CountVectorizer()),
 ('tfidf', TfidfTransformer()),&... | scikit learn logistic regression multiclass classification convergence | 1 | Logistic regression does cannot converge without poor model performance -- (scikit learn logistic regression multiclass classification convergence)
<p>I have a multi-class classification logistic regression model. Using a very basic sklearn pipeline I am taking in cleansed text descriptions of an object and classifying... | habedi/stack-exchange-dataset |
77,828 | Forecasting using Python | <p>I have very less training observations (15). I need to predict 6 months into the future. What forecasting model is best suited for this scenario? Here is how my dataset looks</p>
<p>Month | Response Rate |% Promoters |% Detractors |%Neutrals</p>
<p>2019-01-01 | 5% ... | python forecasting data analysis | 1 | Forecasting using Python -- (python forecasting data analysis)
<p>I have very less training observations (15). I need to predict 6 months into the future. What forecasting model is best suited for this scenario? Here is how my dataset looks</p>
<p>Month | Response Rate |% Promoters |% Detracto... | habedi/stack-exchange-dataset |
77,830 | How do stacked CNN layers work? | <p>The internet is full of pictures like this:</p>
<p><a href="https://i.stack.imgur.com/T3a83.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T3a83.png" alt="enter image description here" /></a></p>
<p>But how are the second/third/etc CNN layers able to extract features when the features are... | machine learning cnn feature extraction | 1 | How do stacked CNN layers work? -- (machine learning cnn feature extraction)
<p>The internet is full of pictures like this:</p>
<p><a href="https://i.stack.imgur.com/T3a83.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T3a83.png" alt="enter image description here" /></a></p>
<p>But how are t... | habedi/stack-exchange-dataset |
77,842 | Why is batch size limited by RAM? | <p>The parameters of the network are changed to minimize the loss on the mini-batch, but usually the loss on the mini-batch is just the (weighted) sum of losses on each datum individually. Loosely, I would represent this as
<span class="math-container">$$ dT = \frac{1}{\text{batch_size}} \sum_{i \in \text{batch}} d... | machine learning training | 1 | Why is batch size limited by RAM? -- (machine learning training)
<p>The parameters of the network are changed to minimize the loss on the mini-batch, but usually the loss on the mini-batch is just the (weighted) sum of losses on each datum individually. Loosely, I would represent this as
<span class="math-container... | habedi/stack-exchange-dataset |
77,870 | How do we get the coefficients and intercept in Logistic Regression? | <p>I'm using Codecademy to learn about logistic regression and there are some holes in my understanding of this topic.</p>
<pre><code>import numpy as np

hours_studied = np.array([[ 0],[ 1],[ 2],[ 3],[ 4],[ 5],[ 6],[ 7],[ 8],[ 9],[10],[11],[12],[13],[14],[15],[16],[17],[18],[19]])
calculated_coefficient... | logistic regression | 1 | How do we get the coefficients and intercept in Logistic Regression? -- (logistic regression)
<p>I'm using Codecademy to learn about logistic regression and there are some holes in my understanding of this topic.</p>
<pre><code>import numpy as np

hours_studied = np.array([[ 0],[ 1],[ 2],[ 3],[ 4],[ 5],[ 6]... | habedi/stack-exchange-dataset |
77,876 | How to model user choice probability: binary model vs multi class model | <p>Let's say Morpheus has multiple users to offer colored pills(from an infinite set of colored pills), there are in total 3 unique colored pills(red, blue, green) Morpheus can offer. The trick is, Morpheus can offer only one pill to a user and the user has a choice to either take the pill or deny it. (Also, user's dec... | machine learning predictive modeling multiclass classification probability binary | 1 | How to model user choice probability: binary model vs multi class model -- (machine learning predictive modeling multiclass classification probability binary)
<p>Let's say Morpheus has multiple users to offer colored pills(from an infinite set of colored pills), there are in total 3 unique colored pills(red, blue, gree... | habedi/stack-exchange-dataset |
77,880 | Is Label Encoding with arbitrary numbers ever useful at all? | <p>From what I read online, there seems to be some confusion regarding the taxonomy and the terms used, so to avoid misunderstanding I'm going to define them here:</p>
<p><strong>Label Encoding</strong> - encoding a nominal variable with <em>arbitrary</em> numeric labels.</p>
<p><strong>Ordinal Encoding</strong... | scikit learn pandas decision trees encoding | 1 | Is Label Encoding with arbitrary numbers ever useful at all? -- (scikit learn pandas decision trees encoding)
<p>From what I read online, there seems to be some confusion regarding the taxonomy and the terms used, so to avoid misunderstanding I'm going to define them here:</p>
<p><strong>Label Encoding</strong> - e... | habedi/stack-exchange-dataset |
77,891 | Function extrapolation | <p>I have a list</p>
<pre><code>[1.0, 0.488, 0.300, 0.213, 0.163, 0.127]
</code></pre>
<p><a href="https://i.stack.imgur.com/kffVZ.png" rel="nofollow noreferrer">Plot</a> (dont have enough reputation to post an image)</p>
<p>I need to extrapolate this function for 15 more points further, asymptote is 0.... | python scikit learn | 1 | Function extrapolation -- (python scikit learn)
<p>I have a list</p>
<pre><code>[1.0, 0.488, 0.300, 0.213, 0.163, 0.127]
</code></pre>
<p><a href="https://i.stack.imgur.com/kffVZ.png" rel="nofollow noreferrer">Plot</a> (dont have enough reputation to post an image)</p>
<p>I need to extrapolate this func... | habedi/stack-exchange-dataset |
77,910 | Tensorflow.Keras: How to get gradient for an output class w.r.t a given input? | <p>I have implemented and trained a sequential model using tf.keras. Say I am given an input array of size 8X8 and an output [0,1,0,...(rest all 0)].</p>
<p>How to calculate the gradient of the input w.r.t to the given output?</p>
<pre class="lang-py prettyprint-override"><code>model = ...
output = np.asarr... | keras tensorflow gradient | 1 | Tensorflow.Keras: How to get gradient for an output class w.r.t a given input? -- (keras tensorflow gradient)
<p>I have implemented and trained a sequential model using tf.keras. Say I am given an input array of size 8X8 and an output [0,1,0,...(rest all 0)].</p>
<p>How to calculate the gradient of the input w.r.t ... | habedi/stack-exchange-dataset |
77,912 | What does it mean that an hypotesis is consistent? | <p>I am studying <strong>concept learning</strong>, and I am focusing on the concept of <strong>consistency</strong> for an hypotesis.</p>
<p>Consider an Hypotesis <span class="math-container">$h$</span>, I have understood that it is consistent with a training set <span class="math-container">$D$</span> <strong>iff... | machine learning dataset | 1 | What does it mean that an hypotesis is consistent? -- (machine learning dataset)
<p>I am studying <strong>concept learning</strong>, and I am focusing on the concept of <strong>consistency</strong> for an hypotesis.</p>
<p>Consider an Hypotesis <span class="math-container">$h$</span>, I have understood that it is c... | habedi/stack-exchange-dataset |
77,921 | Test for feature dependencies in time series modelling | <p>I have time-series data that track event occurrence in 3 locations. Here's a sample:</p>
<pre><code> Count Total 
Location A B C 
Date 
2018-06-22 0 1 1 2
2018-06-23 2 1 0 3
2018-06-24 0 0 1 1
2018-06-... | time series feature engineering | 1 | Test for feature dependencies in time series modelling -- (time series feature engineering)
<p>I have time-series data that track event occurrence in 3 locations. Here's a sample:</p>
<pre><code> Count Total 
Location A B C 
Date 
2018-06-22 ... | habedi/stack-exchange-dataset |
77,926 | What does it exactly mean when we say that PCA and LDA are linear methods of learning data representation? | <p>I have been reading on representation learning and I have come across this idea that PCA and LDA are linear methods of data representation, however, auto-encoders provide a non-linear way. Does this mean that the embedding learned by PCA can be transformed only linearly to reproduce data points ?</p>
 | machine learning deep learning representation | 1 | What does it exactly mean when we say that PCA and LDA are linear methods of learning data representation? -- (machine learning deep learning representation)
<p>I have been reading on representation learning and I have come across this idea that PCA and LDA are linear methods of data representation, however, auto-encod... | habedi/stack-exchange-dataset |
77,942 | What kind of data (in context of trends in data) is Logistic Regression appropriate for? | <p>I'm not able to visualise what kind of 'trends' I would have to observe in multi-featured data to be able to say 'Logistic Regression would work well here'.</p>
<p>For example if I have only 1 feature and if the data is something like all negative data is class 0 and all positive data is class 1. Then I can clea... | visualization logistic regression | 1 | What kind of data (in context of trends in data) is Logistic Regression appropriate for? -- (visualization logistic regression)
<p>I'm not able to visualise what kind of 'trends' I would have to observe in multi-featured data to be able to say 'Logistic Regression would work well here'.</p>
<p>For example if I have... | habedi/stack-exchange-dataset |
77,952 | Mathematics: Can the result of a derivative for the Gradient Descent consist of only one value? | <p>I have a problem of a task using the formula of the Gradient Descent:</p>
<p><a href="https://latex.codecogs.com/png.latex?%5Cdpi%7B200%7D%5Cvec%7Bx%7D(i+1)=%5Cvec%7Bx%7D(i)-%5Cepsilon%5Cvec%7B%5Cnabla%7Df%7C_%7B%5Cvec%7Bx%7D(i)%7D" rel="nofollow noreferrer"><img src="https://latex.codecogs.com/png.latex?%5Cdpi%... | gradient descent mathematics | 1 | Mathematics: Can the result of a derivative for the Gradient Descent consist of only one value? -- (gradient descent mathematics)
<p>I have a problem of a task using the formula of the Gradient Descent:</p>
<p><a href="https://latex.codecogs.com/png.latex?%5Cdpi%7B200%7D%5Cvec%7Bx%7D(i+1)=%5Cvec%7Bx%7D(i)-%5Cepsilo... | habedi/stack-exchange-dataset |
77,956 | How to compare two clustering solutions when their labelling differs | <p>I am planning to test the reliability of a clustering approach for some data. My plan is to repeatedly (with replacement) draw a number of random subsample pairs (e.g. 2x 10% of the total data), run the clustering on both individually, and then compare the results. The issue is that I am using HDBSCAN, which not onl... | clustering | 1 | How to compare two clustering solutions when their labelling differs -- (clustering)
<p>I am planning to test the reliability of a clustering approach for some data. My plan is to repeatedly (with replacement) draw a number of random subsample pairs (e.g. 2x 10% of the total data), run the clustering on both individual... | habedi/stack-exchange-dataset |
77,960 | Is there a deep learning method for 3D labels? | <p>As the question says, I want to feed labels into a neural net that are three dimensional. Let's say that I have 3 possible labels and each one of my data points corresponds to a percentage of those labels. e.g, my first datapoint contains 20% of label A, 30% of label B, and 50% of label C.</p>
<p>Is there any ar... | deep learning multilabel classification labels | 1 | Is there a deep learning method for 3D labels? -- (deep learning multilabel classification labels)
<p>As the question says, I want to feed labels into a neural net that are three dimensional. Let's say that I have 3 possible labels and each one of my data points corresponds to a percentage of those labels. e.g, my firs... | habedi/stack-exchange-dataset |
77,964 | Difference between convolution structures | <p>I am having a hard time understanding the difference what is a multichannel CNN:
In the paper titled, "A Multichannel 2D Convolutional Neural Network Model for Task-Evoked fMRI Data Classification" (<a href="https://www.hindawi.com/journals/cin/2019/5065214/#sec2.1" rel="nofollow noreferrer">https://ww... | time series cnn image classification convolution | 1 | Difference between convolution structures -- (time series cnn image classification convolution)
<p>I am having a hard time understanding the difference what is a multichannel CNN:
In the paper titled, "A Multichannel 2D Convolutional Neural Network Model for Task-Evoked fMRI Data Classification" (<a href=... | habedi/stack-exchange-dataset |
77,968 | What is the most straightforward way to visualize color-coded clusters along with the cluster centers? | <p>I have applied the kMeans Clustering algorithm to a dataframe and have gained cluster labels for each row. I had selected only two features.<br />
There are 4 clusters.<br />
I want to visualize the datapoints in 2D plane with color-coded clusters which I want to look like this-</p>
<p><img src="https://... | clustering visualization k means matplotlib seaborn | 1 | What is the most straightforward way to visualize color-coded clusters along with the cluster centers? -- (clustering visualization k means matplotlib seaborn)
<p>I have applied the kMeans Clustering algorithm to a dataframe and have gained cluster labels for each row. I had selected only two features.<br />
There ... | habedi/stack-exchange-dataset |
77,971 | How does the validation set get used in the training phase? | <p>I am confused about how the validation set is used during the training phase (neural network like CNN)?
In a platform like Matlab or python(Keras), I split my dataset into train set, validation set and test set.
I knew that validation set is used to tune hyperparameters(like the number of neurons and learnin... | neural network | 1 | How does the validation set get used in the training phase? -- (neural network)
<p>I am confused about how the validation set is used during the training phase (neural network like CNN)?
In a platform like Matlab or python(Keras), I split my dataset into train set, validation set and test set.
I knew that valid... | habedi/stack-exchange-dataset |
77,975 | How do I read the cord_19_embeddings_2020-07-16.csv from the COVID-19 Open Research Dataset Challenge (CORD-19) on Kaggle? | <p><a href="https://i.stack.imgur.com/nAYB4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nAYB4.png" alt="table view of the file in TAD csv viewer" /></a></p>
<h2>What I'm trying to do</h2>
<p>I wanted to use the <a href="https://www.kaggle.com/allen-institute-for-ai/CORD-19-research-challe... | dataset visualization word embeddings kaggle | 1 | How do I read the cord_19_embeddings_2020-07-16.csv from the COVID-19 Open Research Dataset Challenge (CORD-19) on Kaggle? -- (dataset visualization word embeddings kaggle)
<p><a href="https://i.stack.imgur.com/nAYB4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nAYB4.png" alt="table view of the fi... | habedi/stack-exchange-dataset |
77,981 | Is using samples from the same person in both trainset and testset considers being a data leakage? | <p>Suppose a neural network is built for a binary classification problem such as recognize the face as a smiley face or not, by using a dataset of 1000 persons and each person has ten images of his face.
If the dataset randomly spilt into trainset and testset by a ratio of 70:30, in this case, there is a big chance... | neural network data leakage | 1 | Is using samples from the same person in both trainset and testset considers being a data leakage? -- (neural network data leakage)
<p>Suppose a neural network is built for a binary classification problem such as recognize the face as a smiley face or not, by using a dataset of 1000 persons and each person has ten imag... | habedi/stack-exchange-dataset |
78,014 | Two questions about word2vec and gensim | <p>I've written the code below to try word2vec implementation of gensim. I've two questions:</p>
<ol>
<li>Even though I've removed stop words, the word "the" is listed as one of the most similar words of "friend".</li>
<li>The most similar words of "friend" is not satisfying (a... | word2vec gensim | 1 | Two questions about word2vec and gensim -- (word2vec gensim)
<p>I've written the code below to try word2vec implementation of gensim. I've two questions:</p>
<ol>
<li>Even though I've removed stop words, the word "the" is listed as one of the most similar words of "friend".</li>
<li>The ... | habedi/stack-exchange-dataset |
78,026 | Can anyone verify my NN diagram if it is properly drawn? | <p>I am working on a Neural Network that can estimate building's carbon footprint based on the set of features and an image of urban surroundings (via CNN).</p>
<p><a href="https://i.stack.imgur.com/W4vWa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W4vWa.png" alt="enter image description here... | keras cnn convolution neural | 1 | Can anyone verify my NN diagram if it is properly drawn? -- (keras cnn convolution neural)
<p>I am working on a Neural Network that can estimate building's carbon footprint based on the set of features and an image of urban surroundings (via CNN).</p>
<p><a href="https://i.stack.imgur.com/W4vWa.png" rel="nofollow n... | habedi/stack-exchange-dataset |
78,028 | how to create sklearn pipeline object using predtrained standardscalar object | <p>I am having pretrained Sklearn model and pre-trained Standard scalar object saved as pickle . And now I want to create Sklearn pipeline using both of it.</p>
<p>I need sklearn pipeline to convert it into ONNX format.</p>
<p>I couldnt do it as pipeline takes standard scalar class and then we need fit pipeline... | python scikit learn | 1 | how to create sklearn pipeline object using predtrained standardscalar object -- (python scikit learn)
<p>I am having pretrained Sklearn model and pre-trained Standard scalar object saved as pickle . And now I want to create Sklearn pipeline using both of it.</p>
<p>I need sklearn pipeline to convert it into ONNX f... | habedi/stack-exchange-dataset |
78,030 | Multivariate Time series analysis: When is a CNN vs. LSTM appropriate? | <p>I have multiple features in a time series and want to predict the values of the same features for the next time step. I have already trained an LSTM which is working okay, but takes a bit long to train.</p>
<p>So now my question: is it reasonable to use a CNN instead of an LSTM, even though it is a time series? ... | time series cnn lstm | 1 | Multivariate Time series analysis: When is a CNN vs. LSTM appropriate? -- (time series cnn lstm)
<p>I have multiple features in a time series and want to predict the values of the same features for the next time step. I have already trained an LSTM which is working okay, but takes a bit long to train.</p>
<p>So now... | habedi/stack-exchange-dataset |
78,032 | Confused AUC ROC score | <p>I am working on binary classification problem, I try to evaluate the performance of some classification algorithms (<strong>LR,Decission Tree , Random forest</strong> ...).
I am using a <strong>cross validation</strong> technique (to avoid over-fitting) with <strong>AUC ROC</strong> as scoring function to compa... | classification random forest logistic regression cross validation auc | 1 | Confused AUC ROC score -- (classification random forest logistic regression cross validation auc)
<p>I am working on binary classification problem, I try to evaluate the performance of some classification algorithms (<strong>LR,Decission Tree , Random forest</strong> ...).
I am using a <strong>cross validation</st... | habedi/stack-exchange-dataset |
78,038 | PySpark Crossvalidation error | <p>I want to do a very simple cross validation using LogisticRegression.
Here is my code:</p>
<pre><code>logreg = LogisticRegression(labelCol = "churn", featuresCol = "features") 

pipeline = Pipeline(stages = [logreg])
paramGrid = ParamGridBuilder().addGrid(logreg.regParam, [.1,... | cross validation pyspark | 1 | PySpark Crossvalidation error -- (cross validation pyspark)
<p>I want to do a very simple cross validation using LogisticRegression.
Here is my code:</p>
<pre><code>logreg = LogisticRegression(labelCol = "churn", featuresCol = "features") 

pipeline = Pipeline(stages = [logreg])
... | habedi/stack-exchange-dataset |
78,039 | Does the test set has to be in [0,1] range? | <p>I have standardized training set using</p>
<pre class="lang-py prettyprint-override"><code>mean = XTrain.mean()
XTrain-=mean

std = XTrain.std()
XTrain/=std
</code></pre>
<p>And then used <code>mean</code> and <code>std</code> to standardize validation and test sets. The training and vali... | neural network feature scaling | 1 | Does the test set has to be in [0,1] range? -- (neural network feature scaling)
<p>I have standardized training set using</p>
<pre class="lang-py prettyprint-override"><code>mean = XTrain.mean()
XTrain-=mean

std = XTrain.std()
XTrain/=std
</code></pre>
<p>And then used <code>mean</code> and... | habedi/stack-exchange-dataset |
78,056 | LSTM Sequential Model question re: ValueError: non-broadcastable output operand with shape doesn't match broadcast shape | <p>This is probably a very simplistic question but I have not been able to find resources that directly address this. I know I must be understanding this incorrectly; I'm not quite sure how.</p>
<p>I've noticed that if the number of units in the last Dense output layer of my LSTM sequential model does not equal the... | machine learning neural network keras tensorflow lstm | 1 | LSTM Sequential Model question re: ValueError: non-broadcastable output operand with shape doesn't match broadcast shape -- (machine learning neural network keras tensorflow lstm)
<p>This is probably a very simplistic question but I have not been able to find resources that directly address this. I know I must be under... | habedi/stack-exchange-dataset |
78,065 | Fully-Connected DNN: Compute the numbers of free parameter in a DNN | <p><em>A fully-connected DNN has layer sizes of 3-3-4-2, where the first layer size represents the input layer. We assume that all layers are affine ones (no ReLU). Give the dimensions of all weight matrices and all bias vectors in the network and compute the total number of free parameters in this DNN.</em></p>
<p... | neural network mathematics deep learning | 1 | Fully-Connected DNN: Compute the numbers of free parameter in a DNN -- (neural network mathematics deep learning)
<p><em>A fully-connected DNN has layer sizes of 3-3-4-2, where the first layer size represents the input layer. We assume that all layers are affine ones (no ReLU). Give the dimensions of all weight matrice... | habedi/stack-exchange-dataset |
78,069 | Any useful tips on transfer learning for a text classification task | <p>I am doing a supervised binary text classification task.</p>
<p>I want to classify the texts from site A, site B, and site C.</p>
<p>The in-domain performance looks OK for texts of each site. (92%-94% accuracy).</p>
<p>However, if I applied the model trained on texts of one site directly onto texts of an... | classification nlp transfer learning text classification | 1 | Any useful tips on transfer learning for a text classification task -- (classification nlp transfer learning text classification)
<p>I am doing a supervised binary text classification task.</p>
<p>I want to classify the texts from site A, site B, and site C.</p>
<p>The in-domain performance looks OK for texts o... | habedi/stack-exchange-dataset |
78,084 | Is providing class weight to neural network enough for imbalanced binary classification? | <p>I have a highly imbalanced binary classification problem, probably 95:5 for two classes. I don't want to perform resampling as the data is already huge and training it would just take more time. (I'm also aware of down sampling)</p>
<p>But my question is , is providing class weights (let's say computed by scikit... | machine learning deep learning tensorflow class imbalance | 1 | Is providing class weight to neural network enough for imbalanced binary classification? -- (machine learning deep learning tensorflow class imbalance)
<p>I have a highly imbalanced binary classification problem, probably 95:5 for two classes. I don't want to perform resampling as the data is already huge and training ... | habedi/stack-exchange-dataset |
78,108 | Fitting multiple line | <p><a href="https://i.stack.imgur.com/9omrN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9omrN.png" alt="enter image description here" /></a></p>
<p>Short version:
How can I find a function that maps X to Y when data looks like this.</p>
<p>Note:</p>
<blockquote>
<p>For a pair ... | regression linear regression | 1 | Fitting multiple line -- (regression linear regression)
<p><a href="https://i.stack.imgur.com/9omrN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9omrN.png" alt="enter image description here" /></a></p>
<p>Short version:
How can I find a function that maps X to Y when data looks like this.<... | habedi/stack-exchange-dataset |
78,109 | Should you use random state or random seed in machine learning models? | <p>I'm starting to study machine learning. All the examples I saw, the person that created the ML model used a random state or a random seed to stop the randomness of the process. But, in real life, when you're trying to apply a machine learning model into an actual project of a company, should you use any random state... | machine learning cross validation data science model | 1 | Should you use random state or random seed in machine learning models? -- (machine learning cross validation data science model)
<p>I'm starting to study machine learning. All the examples I saw, the person that created the ML model used a random state or a random seed to stop the randomness of the process. But, in rea... | habedi/stack-exchange-dataset |
78,119 | Pandas copy() different columns from different dataframes to a new dataframe | <p>I have 2 dataframes that are coming from 2 different Excel files. I want to extract some columns from one file and other columns from the second file to print a new dataframe with the copied columns.</p>
<p>I copied 2 columns from different dataframes (df1 and df2) but I get print only one of them (the last one)... | python pandas dataframe | 1 | Pandas copy() different columns from different dataframes to a new dataframe -- (python pandas dataframe)
<p>I have 2 dataframes that are coming from 2 different Excel files. I want to extract some columns from one file and other columns from the second file to print a new dataframe with the copied columns.</p>
<p>... | habedi/stack-exchange-dataset |
78,124 | Product classification according to description | <p>I have some products, along with their description. I wish to assign USPSC code to each product. I have a really basic doubt here. What exactly is my test file and training file? Eg. Should the training file be entries of product description along with <strong>manually</strong> entered codes assigned to each product... | nlp | 1 | Product classification according to description -- (nlp)
<p>I have some products, along with their description. I wish to assign USPSC code to each product. I have a really basic doubt here. What exactly is my test file and training file? Eg. Should the training file be entries of product description along with <strong... | habedi/stack-exchange-dataset |
78,126 | Mathematics: Writing down a three-class classifier confusion matrix | <blockquote>
<p>Confusion matrix 2A three-class classifier is evaluated on a test set
of <strong>900 samples</strong> which containsall three classes in equal
proportions.</p>
<pre><code>• Classes 2 and 3 are always classified correctly
• Class 1 is confused with class 2 in 50% of the cases, 
 ... | confusion matrix mathematics | 1 | Mathematics: Writing down a three-class classifier confusion matrix -- (confusion matrix mathematics)
<blockquote>
<p>Confusion matrix 2A three-class classifier is evaluated on a test set
of <strong>900 samples</strong> which containsall three classes in equal
proportions.</p>
<pre><code>• Classes 2 and... | habedi/stack-exchange-dataset |
78,127 | Handling features with multiple values per instance in Python for Machine Learning model | <p>I have a dataset which contains medical data about children and I am developing a predictive machine learning model to predict adverse pregnancy outcomes. The dataset contains mostly features with a single value per child, e.g. gender = ["Male", "Female].
However, I have some features that have mu... | machine learning python preprocessing | 1 | Handling features with multiple values per instance in Python for Machine Learning model -- (machine learning python preprocessing)
<p>I have a dataset which contains medical data about children and I am developing a predictive machine learning model to predict adverse pregnancy outcomes. The dataset contains mostly fe... | habedi/stack-exchange-dataset |
78,132 | Back propagation through a simple convolutional neural network | <p>Hi I am working on a simple convolution neural network (image attached below). The input image is 5x5, the kernel is 2x2 and it undergoes a ReLU activation function. After ReLU it gets max pooled by a 2x2 pool, these then are flattened and headed off into the fully connected layer. Once through the fully connected l... | cnn backpropagation convolutional neural network | 1 | Back propagation through a simple convolutional neural network -- (cnn backpropagation convolutional neural network)
<p>Hi I am working on a simple convolution neural network (image attached below). The input image is 5x5, the kernel is 2x2 and it undergoes a ReLU activation function. After ReLU it gets max pooled by a... | habedi/stack-exchange-dataset |
78,138 | Random Forest with 2D features | <p>I try to predict the position of a specific point (crest) in a 1D signal (elevation profile). Until now, I computed gradient at every point of my signal and combined that with additional features or heuristics to find approximate position of the expected output (position of the crest).</p>
<p>But there are some ... | random forest | 1 | Random Forest with 2D features -- (random forest)
<p>I try to predict the position of a specific point (crest) in a 1D signal (elevation profile). Until now, I computed gradient at every point of my signal and combined that with additional features or heuristics to find approximate position of the expected output (posi... | habedi/stack-exchange-dataset |
78,145 | Which is the best method for Neural Network Layers in Keras | <p>In keras we can create neural network layers in many ways.</p>
<p><strong>1. Sequential API</strong>.<br />
for example</p>
<pre><code>model=sequential()
</code></pre>
<p><strong>2. Functional</strong><br />
for example</p>
<pre><code>x1=Input(shape=(2,)
x2=Dense(2)(x1)
</code></p... | neural network deep learning keras tensorflow | 1 | Which is the best method for Neural Network Layers in Keras -- (neural network deep learning keras tensorflow)
<p>In keras we can create neural network layers in many ways.</p>
<p><strong>1. Sequential API</strong>.<br />
for example</p>
<pre><code>model=sequential()
</code></pre>
<p><strong>2. Func... | habedi/stack-exchange-dataset |
78,146 | Does label encoding an entire dataset cause data leakage? | <p>I have a dataset on which one of the features has a lot of different categorical values. Trying to use a LabelEncoder, OrdinalEncoder or a OneHotEncoder results in an error, since when splitting the data, the test set ends up having some values that are not present in the train set.</p>
<p>My question is: if I c... | machine learning data cleaning data leakage | 1 | Does label encoding an entire dataset cause data leakage? -- (machine learning data cleaning data leakage)
<p>I have a dataset on which one of the features has a lot of different categorical values. Trying to use a LabelEncoder, OrdinalEncoder or a OneHotEncoder results in an error, since when splitting the data, the t... | habedi/stack-exchange-dataset |
78,156 | how come accuracy_score recognizes the positive label and precision_score does not? | <p>I am executing this code which works perfectly for me:</p>
<p>(I only have 'positive' and 'negative' sentiments):</p>
<pre><code>from sklearn import metrics
print('Accuracy:',metrics.accuracy_score(test_sentiments, predicted_sentiments)) 
print('Precision:',metrics.precision_score(test_sentiments, p... | machine learning text mining accuracy | 1 | how come accuracy_score recognizes the positive label and precision_score does not? -- (machine learning text mining accuracy)
<p>I am executing this code which works perfectly for me:</p>
<p>(I only have 'positive' and 'negative' sentiments):</p>
<pre><code>from sklearn import metrics
print('Accuracy:',met... | habedi/stack-exchange-dataset |
78,166 | Can features negatively correlated with the target be used? | <p>In feature selection (for a regression problem), can features that are negatively correlated with the target variable be chosen to predict the target? <br>
I don't think negative correlation means the predictor does not provide any information about the target.</p>
<p>Some feature selection methods (like <a ... | feature selection correlation | 1 | Can features negatively correlated with the target be used? -- (feature selection correlation)
<p>In feature selection (for a regression problem), can features that are negatively correlated with the target variable be chosen to predict the target? <br>
I don't think negative correlation means the predictor does no... | habedi/stack-exchange-dataset |
78,173 | Logistic regression vs Random Forest on imbalanced data set | <p>I have an imbalanced data set where positives are just 10% of the whole sample. I am using logistic regression and random forest for classification. While comparing the results of these models, I have found that the probability output of logistic regression ranges between [0,1] while that of random forest ranges bet... | random forest logistic regression | 1 | Logistic regression vs Random Forest on imbalanced data set -- (random forest logistic regression)
<p>I have an imbalanced data set where positives are just 10% of the whole sample. I am using logistic regression and random forest for classification. While comparing the results of these models, I have found that the pr... | habedi/stack-exchange-dataset |
78,180 | Pandas/Python - comparing two columns for matches not in the same row | <p>I have this data:</p>
<p><a href="https://i.stack.imgur.com/PMgVh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PMgVh.png" alt="enter image description here" /></a></p>
<p>I wanted to compare A and B for matches not by row but rather search A0 if it is in column B and so on. Moreover, I ... | python pandas dataframe | 1 | Pandas/Python - comparing two columns for matches not in the same row -- (python pandas dataframe)
<p>I have this data:</p>
<p><a href="https://i.stack.imgur.com/PMgVh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PMgVh.png" alt="enter image description here" /></a></p>
<p>I wanted to compa... | habedi/stack-exchange-dataset |
78,187 | Measure correlation for categorical vs continous variable | <p>Given a variable which is categorical that depends on continuous variables, I would like to know how to check wether these continous variable explain the categorical one.</p>
<p>So:</p>
<pre><code>Y = cagetorical 
X1 = continous 
X2 = continous
X3 = continous
</code></pre>
<p>I'd start wi... | python r regression correlation | 1 | Measure correlation for categorical vs continous variable -- (python r regression correlation)
<p>Given a variable which is categorical that depends on continuous variables, I would like to know how to check wether these continous variable explain the categorical one.</p>
<p>So:</p>
<pre><code>Y = cagetorical &... | habedi/stack-exchange-dataset |
78,192 | How to handle sparsely coded features in a dataframe | <p>I have a dataset that contains information regarding diabetes patients, like so:</p>
<pre class="lang-py prettyprint-override"><code> id diabetes diet insulin lifestyle
 0 No NaN NaN NaN
 1 Yes Yes Yes NaN
 2 No NaN NaN Na... | machine learning python missing data data imputation | 1 | How to handle sparsely coded features in a dataframe -- (machine learning python missing data data imputation)
<p>I have a dataset that contains information regarding diabetes patients, like so:</p>
<pre class="lang-py prettyprint-override"><code> id diabetes diet insulin lifestyle
 0 No ... | habedi/stack-exchange-dataset |
78,194 | Is it possible to have stratified train-test split of a set based on two columns? | <p>Consider a dataframe that contains two columns, <code>text</code> and <code>label</code>. I can very easily create a stratified train-test split using <a href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html" rel="nofollow noreferrer">sklearn.model_selection.train_test... | python scikit learn dataset pandas | 1 | Is it possible to have stratified train-test split of a set based on two columns? -- (python scikit learn dataset pandas)
<p>Consider a dataframe that contains two columns, <code>text</code> and <code>label</code>. I can very easily create a stratified train-test split using <a href="https://scikit-learn.org/stable/mod... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.