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
72,483
How to extract data from an API every hour in Python?
<p>I am new to Python and I tried writing a script that extracts air quality json data from an API every hour and logs it into a same excel file. My code doesn't return anything.&#xA;Is my code correct ? and how can I make it log into the excel file every hour please ? Thank you very much.</p>&#xA;&#xA;<p>Here is the s...
python
1
How to extract data from an API every hour in Python? -- (python) <p>I am new to Python and I tried writing a script that extracts air quality json data from an API every hour and logs it into a same excel file. My code doesn't return anything.&#xA;Is my code correct ? and how can I make it log into the excel file ever...
habedi/stack-exchange-dataset
72,489
Is this correlation between distance matrices?
<p>I have a set of objects. I have calculated two distance matrices: <span class="math-container">$X$</span> defining distance between each objects pair using metric <span class="math-container">$f1$</span>, and <span class="math-container">$Y$</span> -- using metric <span class="math-container">$f2$</span>. Now, I wou...
correlation
1
Is this correlation between distance matrices? -- (correlation) <p>I have a set of objects. I have calculated two distance matrices: <span class="math-container">$X$</span> defining distance between each objects pair using metric <span class="math-container">$f1$</span>, and <span class="math-container">$Y$</span> -- u...
habedi/stack-exchange-dataset
72,500
How to compare supervised learning algorithm and it's technique ensemble learning algorithm?
<p>I have to compare Support Vector Machine and Random Forest algorithm , but i'm confused how it can be compared, like support vector machine is supervised learning algorithm and random forest is ensemble learning .&#xA;Help me out how i can compare it on which point like - in clasification , in regression .</p>&#xA;
machine learning random forest svm supervised learning evaluation
1
How to compare supervised learning algorithm and it's technique ensemble learning algorithm? -- (machine learning random forest svm supervised learning evaluation) <p>I have to compare Support Vector Machine and Random Forest algorithm , but i'm confused how it can be compared, like support vector machine is supervised...
habedi/stack-exchange-dataset
72,503
Having and issue plotting horizontal chart
<p>So for some weird reason I can't manage to fix the plotting issue</p>&#xA;&#xA;<p>Any suggestions? </p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/aiCTA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aiCTA.jpg" alt="enter image description here"></a></p>&#xA;&#xA;<pre><code>from sklearn.metri...
python matplotlib plotting
1
Having and issue plotting horizontal chart -- (python matplotlib plotting) <p>So for some weird reason I can't manage to fix the plotting issue</p>&#xA;&#xA;<p>Any suggestions? </p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/aiCTA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aiCTA.jpg" alt="en...
habedi/stack-exchange-dataset
72,514
How to generate plot of reward and its variance?
<p>I am new to reinforcement learning and I would like know how to generate a learning curve plot such as that shown below (taken from this <a href="https://www.xomnia.com/blog/speed-up-deep-reinforcement-learning/" rel="nofollow noreferrer">blog post</a>), that illustrates the reward (return) and its variance (shaded ...
reinforcement learning plotting
1
How to generate plot of reward and its variance? -- (reinforcement learning plotting) <p>I am new to reinforcement learning and I would like know how to generate a learning curve plot such as that shown below (taken from this <a href="https://www.xomnia.com/blog/speed-up-deep-reinforcement-learning/" rel="nofollow nore...
habedi/stack-exchange-dataset
72,515
How to define discrete action space with continuous values in OpenAI Gym?
<p>I am trying to use a reinforcement learning solution in an OpenAI Gym environment that has 6 discrete actions with continuous values, e.g. increase parameter 1 with 2.2, decrease parameter 1 with 1.6, decrease parameter 3 with 1 etc.</p>&#xA;&#xA;<p>I have seen in this <a href="https://github.com/notadamking/Stock-T...
reinforcement learning openai gym implementation
1
How to define discrete action space with continuous values in OpenAI Gym? -- (reinforcement learning openai gym implementation) <p>I am trying to use a reinforcement learning solution in an OpenAI Gym environment that has 6 discrete actions with continuous values, e.g. increase parameter 1 with 2.2, decrease parameter ...
habedi/stack-exchange-dataset
72,516
List of keywords as features
<p>I'm new to machine learning, being this the first time I'm involved in a project in the area. I have a dataset of news articles and have extracted the keywords present on the news title such as <code>['china factory activity shrinks', 'first time', '2 years']</code>. Note, the list size varies.</p>&#xA;&#xA;<p>I wou...
machine learning python scikit learn feature extraction
1
List of keywords as features -- (machine learning python scikit learn feature extraction) <p>I'm new to machine learning, being this the first time I'm involved in a project in the area. I have a dataset of news articles and have extracted the keywords present on the news title such as <code>['china factory activity sh...
habedi/stack-exchange-dataset
72,523
Intuition behind Adagrad optimization
<p>The following paper <a href="https://arxiv.org/abs/1212.5701" rel="nofollow noreferrer">ADADELTA: AN ADAPTIVE LEARNING RATE METHOD</a> gives a method called Adagrad where we we have the following update rule : <span class="math-container">$$ X_{n+1} = X_n -[Lr/\sqrt{\sum_{i=0}^ng_i^2}]*g_n $$</span>&#xA;Now I unders...
neural network optimization learning rate
1
Intuition behind Adagrad optimization -- (neural network optimization learning rate) <p>The following paper <a href="https://arxiv.org/abs/1212.5701" rel="nofollow noreferrer">ADADELTA: AN ADAPTIVE LEARNING RATE METHOD</a> gives a method called Adagrad where we we have the following update rule : <span class="math-cont...
habedi/stack-exchange-dataset
72,556
Gradient Checking: MeanSquareError. Why huge epsilon improves discrepancy?
<p>I am using custom C++ code, and coded a simple "Mean Squared Error" layer.&#xA;Temporarily using it for the 'classification task', not a simple regression. ...maybe this causes the issues?</p>&#xA;&#xA;<p>I don't have anything else before this layer - not even a simple Dense layer. It's just MSE on its own.&#xA;Its ...
gradient descent backpropagation gradient
1
Gradient Checking: MeanSquareError. Why huge epsilon improves discrepancy? -- (gradient descent backpropagation gradient) <p>I am using custom C++ code, and coded a simple "Mean Squared Error" layer.&#xA;Temporarily using it for the 'classification task', not a simple regression. ...maybe this causes the issues?</p>&#x...
habedi/stack-exchange-dataset
72,559
Different activation function in same layer of a Neural network
<p>My question is that what will happen if I arrange different activation functions in the same layer of a neural network and continue the same trend for the other hidden layers.</p>&#xA;&#xA;<p>Suppose I have 3 <code>relu</code> units in the starting and 3 <code>tanh</code> after that and other activation function I t...
machine learning neural network deep learning activation function mathematics
1
Different activation function in same layer of a Neural network -- (machine learning neural network deep learning activation function mathematics) <p>My question is that what will happen if I arrange different activation functions in the same layer of a neural network and continue the same trend for the other hidden la...
habedi/stack-exchange-dataset
72,584
Is it suitable to change a feature by itself to generate an another feature?
<p>Hi all I would love to hear your answers on this. Lets say I have two variables, voltage and current, in my data set. I could add another feature by squaring current (so as to calculate power). </p>&#xA;&#xA;<p>Is this an example of feature engineering?</p>&#xA;&#xA;<p>Recently I tried to predict on a diameter predi...
feature engineering feature construction
1
Is it suitable to change a feature by itself to generate an another feature? -- (feature engineering feature construction) <p>Hi all I would love to hear your answers on this. Lets say I have two variables, voltage and current, in my data set. I could add another feature by squaring current (so as to calculate power). ...
habedi/stack-exchange-dataset
72,596
Changing the default scale of a plot to a "custom scale"
<p>I am trying to change the scale of the x_axis for a plot.</p>&#xA;&#xA;<p>The default is generating divisions of 20 units (0-20-40-60-80-100-120).</p>&#xA;&#xA;<p>I tried changing to log, but then I get 0-10-100, which helps understand the data, but I would like to try to see divisions with 10 units because my data ...
python matplotlib jupyter
1
Changing the default scale of a plot to a "custom scale" -- (python matplotlib jupyter) <p>I am trying to change the scale of the x_axis for a plot.</p>&#xA;&#xA;<p>The default is generating divisions of 20 units (0-20-40-60-80-100-120).</p>&#xA;&#xA;<p>I tried changing to log, but then I get 0-10-100, which helps unde...
habedi/stack-exchange-dataset
72,604
Dummy Variable Trap
<p>In my course about machine learning I'm studying multiple linear regression and we talked about dummy variable trap. I have a data set which contains country, height, weight, gender of every person where country is encoded with letters such as us, uk, fr, ge for united states, united kingdom, france and germany resp...
machine learning statistics linear regression data cleaning
1
Dummy Variable Trap -- (machine learning statistics linear regression data cleaning) <p>In my course about machine learning I'm studying multiple linear regression and we talked about dummy variable trap. I have a data set which contains country, height, weight, gender of every person where country is encoded with lett...
habedi/stack-exchange-dataset
72,638
Handling Numerical Categorical Column in ML models in Python
<p>When I was exploring the titanic dataset to estimate the probability of a person of surviving using the Logistic Model, I realized there are two ways of handling numerical categorical variables :</p>&#xA;&#xA;<ol>&#xA;<li><p>Use them as is in the dataset ie don't convert them into dummy variables. See the PClass bel...
scikit learn logistic regression categorical data dummy variables
1
Handling Numerical Categorical Column in ML models in Python -- (scikit learn logistic regression categorical data dummy variables) <p>When I was exploring the titanic dataset to estimate the probability of a person of surviving using the Logistic Model, I realized there are two ways of handling numerical categorical v...
habedi/stack-exchange-dataset
72,642
LSTM Time-series classification - derived feature
<p>I have a time-series dataset and I want to derive a new feature based on a date column which I believe might improve my predictive model. The feature is if it's weekday or weekend.</p>&#xA;&#xA;<p>I am not sure how to create this for modeling purposes. Do I represent it as a boolean function or a numerical one (1/0)...
classification lstm categorical data labels
1
LSTM Time-series classification - derived feature -- (classification lstm categorical data labels) <p>I have a time-series dataset and I want to derive a new feature based on a date column which I believe might improve my predictive model. The feature is if it's weekday or weekend.</p>&#xA;&#xA;<p>I am not sure how to ...
habedi/stack-exchange-dataset
72,655
Effecient way to decompose multiple time series in a data frame and compare the fit of additive and multiplicative models?
<p>I have a data frame in R that contains time series data of 7 variables that were taken on several hundred different individuals. I want to know if it would be more appropriate to use an additive model or a multiplicative model for each variable. </p>&#xA;&#xA;<p>To give an example, the data is structured something l...
r time series model selection
1
Effecient way to decompose multiple time series in a data frame and compare the fit of additive and multiplicative models? -- (r time series model selection) <p>I have a data frame in R that contains time series data of 7 variables that were taken on several hundred different individuals. I want to know if it would be ...
habedi/stack-exchange-dataset
72,662
Conditionally replace values in column with value from another column
<p>I have a 5 column dataframe where one column has some NaN's. My goal is to replace these NaN's with the corresponding value in another column.</p>&#xA;&#xA;<p>So if my DF looks like this:</p>&#xA;&#xA;<pre><code>YearBuilt LastModified&#xA;&#xA;1993 2004&#xA;&#xA;1994 NaN&#xA;&#xA;1995 ...
python pandas
1
Conditionally replace values in column with value from another column -- (python pandas) <p>I have a 5 column dataframe where one column has some NaN's. My goal is to replace these NaN's with the corresponding value in another column.</p>&#xA;&#xA;<p>So if my DF looks like this:</p>&#xA;&#xA;<pre><code>YearBuilt La...
habedi/stack-exchange-dataset
72,666
How to fix spelling mistakes in data?
<p>I have an input data file which contains list of drug names.</p>&#xA;&#xA;<p>I have more than 1000 unique drug names. However, the drug names has spelling mistakes and space character issues.</p>&#xA;&#xA;<p>For ex: we have ISONIAZID 300MG TAB , ISONAZID300MG TAB, ISNIAZID 300MG</p>&#xA;&#xA;<p>You can see how the a...
machine learning deep learning data mining data cleaning labels
1
How to fix spelling mistakes in data? -- (machine learning deep learning data mining data cleaning labels) <p>I have an input data file which contains list of drug names.</p>&#xA;&#xA;<p>I have more than 1000 unique drug names. However, the drug names has spelling mistakes and space character issues.</p>&#xA;&#xA;<p>Fo...
habedi/stack-exchange-dataset
72,668
Creating bar plot with frequency distribution based
<p>I have a dataframe with this kind of structure:</p>&#xA;&#xA;<pre><code>ID | Size | Value&#xA;1 | 1 | 10&#xA;2 | 2 | 20&#xA;3 | 1 | 10&#xA;4 | 1 | 10&#xA;5 | 1 | 15 &#xA;6 | 1 | 12&#xA;7 | 1 | 20&#xA;</code></pre>&#xA;&#xA;<p>I want to create bar plot of the distribuition of column "Value...
python jupyter
1
Creating bar plot with frequency distribution based -- (python jupyter) <p>I have a dataframe with this kind of structure:</p>&#xA;&#xA;<pre><code>ID | Size | Value&#xA;1 | 1 | 10&#xA;2 | 2 | 20&#xA;3 | 1 | 10&#xA;4 | 1 | 10&#xA;5 | 1 | 15 &#xA;6 | 1 | 12&#xA;7 | 1 | 20&#xA;</code></pre>&#xA...
habedi/stack-exchange-dataset
72,676
How to present Market Basket Analysis Results?
<p>I am working on a Retail Company's in-store transactions for 3 months. I have performed the Market Basket Analysis on the same and I'm getting hundreds if not thousands of association rules. I am using the apriori algorithm from <code>mlxtend.frequent_patterns import apriori</code> in Python and I have used differen...
machine learning python 3.x market basket analysis
1
How to present Market Basket Analysis Results? -- (machine learning python 3.x market basket analysis) <p>I am working on a Retail Company's in-store transactions for 3 months. I have performed the Market Basket Analysis on the same and I'm getting hundreds if not thousands of association rules. I am using the apriori ...
habedi/stack-exchange-dataset
72,682
Random forest minimum number of observations
<p>I have around 5000-6000 observations of nearly 8-10 variables (of which 2 are discrete, categorical) and a single numerical target parameter. As per initial evaluation, random forest regression might be a good algorithm for the current case. </p>&#xA;&#xA;<p>Is the current observations/variables count adequate for t...
machine learning regression random forest
1
Random forest minimum number of observations -- (machine learning regression random forest) <p>I have around 5000-6000 observations of nearly 8-10 variables (of which 2 are discrete, categorical) and a single numerical target parameter. As per initial evaluation, random forest regression might be a good algorithm for t...
habedi/stack-exchange-dataset
72,686
How to create a Time Series Training Dataset with variable sequence length
<p>I have time series data with variable sequence lengths.&#xA;So something like:</p>&#xA;&#xA;<pre><code>date value label&#xA;2020-01-01 2 0 # first input time series&#xA;2020-01-02 1 0 # first input time series&#xA;2020-01-03 1 0 # first input time series&#xA;2020-01-01 3 1 ...
python time series dataset training
1
How to create a Time Series Training Dataset with variable sequence length -- (python time series dataset training) <p>I have time series data with variable sequence lengths.&#xA;So something like:</p>&#xA;&#xA;<pre><code>date value label&#xA;2020-01-01 2 0 # first input time series&#xA;2020-01-02 1 ...
habedi/stack-exchange-dataset
72,723
Get a prediction from the new data inputted against the model, but an error is produced, how to adapt the R code for it to work?
<p>In the R code below, I included the sentences when looking to compare the manually classified with lexicon dictionary results by positive, negative and neutral (in matrixdata1), the algorithms results for the model produces different outcome in the tables, which is good. However, when executing.. </p>&#xA;&#xA;<pre>...
machine learning r text mining
1
Get a prediction from the new data inputted against the model, but an error is produced, how to adapt the R code for it to work? -- (machine learning r text mining) <p>In the R code below, I included the sentences when looking to compare the manually classified with lexicon dictionary results by positive, negative and ...
habedi/stack-exchange-dataset
72,734
Apply multivariable linear regression to a dataset in pandas with sklearn
<p>I'm trying to predict the population for states and the country in 2050. My current dataset has values for each state from 1951,1961...2011 in the same table. Here is a sample view: </p>&#xA;&#xA;<pre><code>Row States/Union Territories 1951 1961 1971 1981 1991 2001 2011&#xA;0 Andaman and N...
scikit learn pandas linear regression
1
Apply multivariable linear regression to a dataset in pandas with sklearn -- (scikit learn pandas linear regression) <p>I'm trying to predict the population for states and the country in 2050. My current dataset has values for each state from 1951,1961...2011 in the same table. Here is a sample view: </p>&#xA;&#xA;<pre...
habedi/stack-exchange-dataset
72,770
why we sample when predicting with Recurent Neural Network
<p>I trained a Recurrent Neural Network to predict the next word in a sentence.</p>&#xA;&#xA;<p>I trained and now I want to predict, but there is something I am not getting well.</p>&#xA;&#xA;<p>I saw it in many tutorials even in the <a href="https://keras.io/examples/lstm_text_generation/" rel="nofollow noreferrer">Ke...
lstm statistics rnn prediction probability
1
why we sample when predicting with Recurent Neural Network -- (lstm statistics rnn prediction probability) <p>I trained a Recurrent Neural Network to predict the next word in a sentence.</p>&#xA;&#xA;<p>I trained and now I want to predict, but there is something I am not getting well.</p>&#xA;&#xA;<p>I saw it in many t...
habedi/stack-exchange-dataset
72,778
XGBoost and Random Forest: ntrees vs. number of boosting rounds vs. n_estimators
<p>So I understand the main difference between Random Forests and GB Methods. Random Forests grow parallel trees and GB Methods grow one tree for each iteration. However, I am confused on the vocab used with scikit's RF regressor and xgboost's Regressor. Specifically the part about tuning for the number of trees/iterat...
python random forest decision trees xgboost hyperparameter
1
XGBoost and Random Forest: ntrees vs. number of boosting rounds vs. n_estimators -- (python random forest decision trees xgboost hyperparameter) <p>So I understand the main difference between Random Forests and GB Methods. Random Forests grow parallel trees and GB Methods grow one tree for each iteration. However, I am...
habedi/stack-exchange-dataset
72,815
Why linear regression feature coefficients become super large?
<h2>Introduction</h2>&#xA;&#xA;<p>I've implemented linear regression using <code>sklearn</code> and after all calculations I've got results like this: </p>&#xA;&#xA;<pre><code>Feature: 0, coef: -9985335237.46533&#xA;Feature: 1, coef: 417387013140.39661&#xA;Feature: 2, coef: -2.85809&#xA;Feature: 3, coef: 1.50522&#xA;Fe...
python scikit learn feature selection linear regression features
1
Why linear regression feature coefficients become super large? -- (python scikit learn feature selection linear regression features) <h2>Introduction</h2>&#xA;&#xA;<p>I've implemented linear regression using <code>sklearn</code> and after all calculations I've got results like this: </p>&#xA;&#xA;<pre><code>Feature: 0,...
habedi/stack-exchange-dataset
72,820
Dealing with large data: selecting a sample
<p>I'm given a data set to create a model that would predict whether a certain supply chain would be able to deliver the goods without delay or not. I'm doing this in Python. </p>&#xA;&#xA;<p>The data set has 93000 data points has at least 100 features as given. What's worse, most of these features are categorical data...
python sampling
1
Dealing with large data: selecting a sample -- (python sampling) <p>I'm given a data set to create a model that would predict whether a certain supply chain would be able to deliver the goods without delay or not. I'm doing this in Python. </p>&#xA;&#xA;<p>The data set has 93000 data points has at least 100 features as...
habedi/stack-exchange-dataset
72,830
Is there a machine learning model suited well for longitudinal data?
<p>I have a fairly large (>100K rows) dataset with multiple (daily) measurements per individual, for a few thousand individuals. The number of measurements per individual vary, and there are many null values (that is, one row may have missing values for certain variables/measurements, but not for all). I also have a da...
machine learning logistic regression
1
Is there a machine learning model suited well for longitudinal data? -- (machine learning logistic regression) <p>I have a fairly large (>100K rows) dataset with multiple (daily) measurements per individual, for a few thousand individuals. The number of measurements per individual vary, and there are many null values (...
habedi/stack-exchange-dataset
72,852
How to find from which row and column the value belong?
<p>Suppose I created the below data frame</p>&#xA;&#xA;<pre><code>data = {'Height_1': [4.3,6.7,5.4,6.2], &#xA; 'Height_2': [5.1, 6.9, 5.1, 5.2], &#xA; 'Height_3': [4.9,6.2,6.5,6.4]}&#xA;&#xA;df = pd.DataFrame(data) &#xA;</code></pre>&#xA;&#xA;<p>Suppose someone comes and asks me</p>&#xA;&#xA;<ol>&#xA;<li>...
python pandas python 3.x
1
How to find from which row and column the value belong? -- (python pandas python 3.x) <p>Suppose I created the below data frame</p>&#xA;&#xA;<pre><code>data = {'Height_1': [4.3,6.7,5.4,6.2], &#xA; 'Height_2': [5.1, 6.9, 5.1, 5.2], &#xA; 'Height_3': [4.9,6.2,6.5,6.4]}&#xA;&#xA;df = pd.DataFrame(data) &#xA;...
habedi/stack-exchange-dataset
72,853
Estimating a metric of a mixture
<p>I'm looking for a general approach to solve a problem that is best demonstrated by the following example.</p>&#xA;&#xA;<p>You mix six different batches of orange juice and you know the acidity, the sugar content, the concentration of volatile particles in each batch of the juice, the growing location of the fruits, ...
regression
1
Estimating a metric of a mixture -- (regression) <p>I'm looking for a general approach to solve a problem that is best demonstrated by the following example.</p>&#xA;&#xA;<p>You mix six different batches of orange juice and you know the acidity, the sugar content, the concentration of volatile particles in each batch o...
habedi/stack-exchange-dataset
72,864
Understanding SVM Kernels
<p>Following Andrew Ng's machine learning course, he explains SVM kernels by manually selecting 3 landmarks and defining 3 gaussian function based on them. Then he says that we are actually defining 3 new features which are <span class="math-container">$f_1$</span>, <span class="math-container">$f_2$</span> and <span c...
machine learning svm kernel self study
1
Understanding SVM Kernels -- (machine learning svm kernel self study) <p>Following Andrew Ng's machine learning course, he explains SVM kernels by manually selecting 3 landmarks and defining 3 gaussian function based on them. Then he says that we are actually defining 3 new features which are <span class="math-containe...
habedi/stack-exchange-dataset
72,865
reduction of sample from videos sample
<p>Well, I post the same question in the main stack before finding the right place, sorry.</p>&#xA;&#xA;<p>A friend of mine is working with more than a 100 videos as sample for his neural network. Each video last more than a couple of minutes with around 24 frames per second. The objective, using deep learning, is to d...
python deep learning data stream mining
1
reduction of sample from videos sample -- (python deep learning data stream mining) <p>Well, I post the same question in the main stack before finding the right place, sorry.</p>&#xA;&#xA;<p>A friend of mine is working with more than a 100 videos as sample for his neural network. Each video last more than a couple of m...
habedi/stack-exchange-dataset
72,870
How to find the size of a tensor in bytes?
<p>Supposing I have a tensor named <code>encoding</code> which is of the shape <code>(1,32)</code> Now I would like to find out the <em>size</em> of the tensor in <strong>bytes</strong> not the shape of it. So basically I want to know how much memory it takes. </p>&#xA;&#xA;<p>I found this StackOverflow question wh...
python tensorflow
1
How to find the size of a tensor in bytes? -- (python tensorflow) <p>Supposing I have a tensor named <code>encoding</code> which is of the shape <code>(1,32)</code> Now I would like to find out the <em>size</em> of the tensor in <strong>bytes</strong> not the shape of it. So basically I want to know how much memory it ...
habedi/stack-exchange-dataset
72,895
Which ML classifier is appropriate for me if all of my features are categorical?
<p>My dataset contains four features. All of the features are categorical. There are 150 categories in the value of 1st and 2nd features. There are 8 categories in the value of 3rd and 4th feature. I replaced the categories with numeric values and applied Random forest. However, performance is not still up to the mark....
classification categorical encoding
1
Which ML classifier is appropriate for me if all of my features are categorical? -- (classification categorical encoding) <p>My dataset contains four features. All of the features are categorical. There are 150 categories in the value of 1st and 2nd features. There are 8 categories in the value of 3rd and 4th feature. ...
habedi/stack-exchange-dataset
72,904
How do I iterate over my images in dataset?
<p>I am building an autoencoder with help from <a href="https://blog.keras.io/building-autoencoders-in-keras.html" rel="nofollow noreferrer">this</a> site. There I was trying to build an autoencoder for my own custom data. My images are stored in a folder IMG and have names like <code>0.jpg, 1.jpg, 2.jpg.....</code> ...
keras tensorflow data data cleaning autoencoder
1
How do I iterate over my images in dataset? -- (keras tensorflow data data cleaning autoencoder) <p>I am building an autoencoder with help from <a href="https://blog.keras.io/building-autoencoders-in-keras.html" rel="nofollow noreferrer">this</a> site. There I was trying to build an autoencoder for my own custom data. ...
habedi/stack-exchange-dataset
72,911
Change format of table
<p>How can I change the table format from this:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/uOl78.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uOl78.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>To This?:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/VUIyh.png" rel="nofo...
python dataset pandas feature engineering data analysis
1
Change format of table -- (python dataset pandas feature engineering data analysis) <p>How can I change the table format from this:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/uOl78.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uOl78.png" alt="enter image description here"></a></p>&#xA;&#xA;...
habedi/stack-exchange-dataset
72,922
Does small batch size improve the model?
<p>I'm training an <code>LSTM</code> with <code>Keras</code>.</p>&#xA;&#xA;<p>I've noticed that the smaller the batch size, the more the loss decreases during periods: so this makes me think that the network can process fewer items better at a time.</p>&#xA;&#xA;<p>Is it a normal behavior in general?</p>&#xA;
keras loss function mini batch gradient descent
1
Does small batch size improve the model? -- (keras loss function mini batch gradient descent) <p>I'm training an <code>LSTM</code> with <code>Keras</code>.</p>&#xA;&#xA;<p>I've noticed that the smaller the batch size, the more the loss decreases during periods: so this makes me think that the network can process fewer ...
habedi/stack-exchange-dataset
72,929
Displaying network error as a single value
<p>I've been writing a neural network from scratch. I've completed the feedforward, backpropagation, and mini-batch gradient descent methods, so I can train the network. Other neural networks I've worked with usually display the error/loss after each batch as a single decimal value, and I'd like to implement this funct...
neural network gradient descent mini batch gradient descent implementation
1
Displaying network error as a single value -- (neural network gradient descent mini batch gradient descent implementation) <p>I've been writing a neural network from scratch. I've completed the feedforward, backpropagation, and mini-batch gradient descent methods, so I can train the network. Other neural networks I've ...
habedi/stack-exchange-dataset
72,949
PCA - what do I do with its results?
<p>I have a data set with more than 20 features, and I applied PCA:</p>&#xA;&#xA;<pre><code>M.fit_transform(all_data)&#xA;variance = M.explained_variance_ratio_&#xA;var = np.cumsum(np.round(M.explained_variance_ratio_, decimals=3)*100)&#xA;plt.ylabel('% Variance Explained')&#xA;plt.xlabel('# of Features')&#xA;plt.title...
python pca jupyter
1
PCA - what do I do with its results? -- (python pca jupyter) <p>I have a data set with more than 20 features, and I applied PCA:</p>&#xA;&#xA;<pre><code>M.fit_transform(all_data)&#xA;variance = M.explained_variance_ratio_&#xA;var = np.cumsum(np.round(M.explained_variance_ratio_, decimals=3)*100)&#xA;plt.ylabel('% Varia...
habedi/stack-exchange-dataset
72,972
Find the longest palindrome substring of a piece of DNA
<p>I have to make a function that prints the longest palindrome substring of a piece of DNA. I already wrote a function that checks whether a piece of DNA is a palindrome itself. See the function below.</p>&#xA;&#xA;<pre><code>def make_complement_strand(DNA):&#xA; complement=[]&#xA; rules_for_complement={"A":"T",...
python 3.x
1
Find the longest palindrome substring of a piece of DNA -- (python 3.x) <p>I have to make a function that prints the longest palindrome substring of a piece of DNA. I already wrote a function that checks whether a piece of DNA is a palindrome itself. See the function below.</p>&#xA;&#xA;<pre><code>def make_complement_s...
habedi/stack-exchange-dataset
72,974
Reason for capping Learning Rate (alpha) up to 1 for Gradient Descent
<p>I am learning to implement Gradient Descent algorithm in Python and came across the problem of selecting the right learning rate. </p>&#xA;&#xA;<p>I have learned that learning rates are usually selected up to 1 (Andrew Ng's Machine Learning course). But for curiosity reasons, I have tried <code>alpha = 1.1</code> an...
machine learning gradient descent cost function
1
Reason for capping Learning Rate (alpha) up to 1 for Gradient Descent -- (machine learning gradient descent cost function) <p>I am learning to implement Gradient Descent algorithm in Python and came across the problem of selecting the right learning rate. </p>&#xA;&#xA;<p>I have learned that learning rates are usually ...
habedi/stack-exchange-dataset
72,975
WEKA Random Forest and numerical attributes
<p>I am working with Random Forests in Weka. I thought the ID3 algorithm is used to find the best split attribute at each level. But after reading a bit I noticed that ID3 can not handle numerical attributes (one needs for instance C4.5 for that). Random Forests in Weka do have no problems with numerical features as in...
classification random forest weka
1
WEKA Random Forest and numerical attributes -- (classification random forest weka) <p>I am working with Random Forests in Weka. I thought the ID3 algorithm is used to find the best split attribute at each level. But after reading a bit I noticed that ID3 can not handle numerical attributes (one needs for instance C4.5 ...
habedi/stack-exchange-dataset
73,009
Pruning in Decision trees
<p>Following is what I learned about the process followed during building and pruning a decision tree, mathematically (from <em>Introduction to Machine Learning</em> by Gareth James et al.):</p>&#xA;&#xA;<ol>&#xA;<li>Use recursive binary splitting to grow a large tree on the training&#xA;data, stopping only when each t...
classification regression decision trees pruning
1
Pruning in Decision trees -- (classification regression decision trees pruning) <p>Following is what I learned about the process followed during building and pruning a decision tree, mathematically (from <em>Introduction to Machine Learning</em> by Gareth James et al.):</p>&#xA;&#xA;<ol>&#xA;<li>Use recursive binary sp...
habedi/stack-exchange-dataset
73,016
Split data into linear regression
<p>I am looking for a way that could help me create more precise models.</p>&#xA;&#xA;<p>Let's say these are real estate prices for different areas. Only in the data I do not have a clear division into these areas I suppose this is the relationship.</p>&#xA;&#xA;<p>At present I have one model (red line) and I would lik...
linear regression
1
Split data into linear regression -- (linear regression) <p>I am looking for a way that could help me create more precise models.</p>&#xA;&#xA;<p>Let's say these are real estate prices for different areas. Only in the data I do not have a clear division into these areas I suppose this is the relationship.</p>&#xA;&#xA;...
habedi/stack-exchange-dataset
73,057
Suitable sample data set to test machine learning algorithms
<p>I'm new to Machine Learning and I just came across the sci-kit package. On <a href="https://scikit-learn.org/stable/auto_examples/cluster/plot_cluster_comparison.html" rel="nofollow noreferrer">this interesting page</a> there are many toy data sets used to test different clustering algorithms. Each data set has a un...
dataset clustering
1
Suitable sample data set to test machine learning algorithms -- (dataset clustering) <p>I'm new to Machine Learning and I just came across the sci-kit package. On <a href="https://scikit-learn.org/stable/auto_examples/cluster/plot_cluster_comparison.html" rel="nofollow noreferrer">this interesting page</a> there are ma...
habedi/stack-exchange-dataset
73,072
sklearn NearestNeighbors returning misaligned results
<p>I'm using NearestNeighbors to do name matching and at a certain point the results become misaligned. My standardized list of names is 100s of millions. My list of names coming in to be matched is considerably smaller but still could be in the 250k to 500k range. After a certain point it appears the index begins to...
machine learning python scikit learn pandas
1
sklearn NearestNeighbors returning misaligned results -- (machine learning python scikit learn pandas) <p>I'm using NearestNeighbors to do name matching and at a certain point the results become misaligned. My standardized list of names is 100s of millions. My list of names coming in to be matched is considerably smal...
habedi/stack-exchange-dataset
73,075
Considering the output of a BLSTM in pytorch, what's the order of the elements?
<p>I am currently using pytorch to implement a BLSTM-based neural network. I understand that the output of the BLSTM is two times the hidden size. However, I am currently unable to find out whether this is ordered as <code>[forward_state_0, backward_state_n, forward_state_1, backward_state_n-1,..., forward_state_n, bac...
lstm pytorch
1
Considering the output of a BLSTM in pytorch, what's the order of the elements? -- (lstm pytorch) <p>I am currently using pytorch to implement a BLSTM-based neural network. I understand that the output of the BLSTM is two times the hidden size. However, I am currently unable to find out whether this is ordered as <code...
habedi/stack-exchange-dataset
73,093
What does from_logits=True do in SparseCategoricalcrossEntropy loss function?
<p>In the documentation it has been mentioned that <code>y_pred</code> needs to be in the range of [-inf to inf] when <code>from_logits=True</code>. I truly didn't understand what this means, since the probabilities need to be in the range of 0 to 1! Can someone please explain in simple words the effect of using <code>...
machine learning python keras tensorflow loss function
1
What does from_logits=True do in SparseCategoricalcrossEntropy loss function? -- (machine learning python keras tensorflow loss function) <p>In the documentation it has been mentioned that <code>y_pred</code> needs to be in the range of [-inf to inf] when <code>from_logits=True</code>. I truly didn't understand what th...
habedi/stack-exchange-dataset
73,098
Mini Batch Gradient Descent shuffling
<p>My data set is of shape (60,784,1000) with mini batches for input and (60,10,1000) for labels, should I shuffle only the 60 mini batches or the training examples themselves?</p>&#xA;
machine learning gradient descent mini batch gradient descent
1
Mini Batch Gradient Descent shuffling -- (machine learning gradient descent mini batch gradient descent) <p>My data set is of shape (60,784,1000) with mini batches for input and (60,10,1000) for labels, should I shuffle only the 60 mini batches or the training examples themselves?</p>&#xA;
habedi/stack-exchange-dataset
73,110
Measuring the success of text summarization
<p>I am trying to make a text summarization program that will take a text article and reduce it to a para or 2.</p>&#xA;&#xA;<p>Since I am a newbie with no idea of NLP, it is hard to approach and break down the problem. So I was wondering if there was a measure that is used to check for effectiveness and correctness of...
nlp automatic summarization
1
Measuring the success of text summarization -- (nlp automatic summarization) <p>I am trying to make a text summarization program that will take a text article and reduce it to a para or 2.</p>&#xA;&#xA;<p>Since I am a newbie with no idea of NLP, it is hard to approach and break down the problem. So I was wondering if t...
habedi/stack-exchange-dataset
73,114
How can I fix regression model interpretation of feature?
<p>I'm building a regression model to predict the values of a feature <span class="math-container">$Y$</span> given a set of other features <span class="math-container">$X_{1}, X_{2}, X_{3}..X_{n}$</span>.</p>&#xA;&#xA;<p>Onde of these other features, let's say <span class="math-container">$X_1$</span>, is known to be ...
python regression multivariate distribution
1
How can I fix regression model interpretation of feature? -- (python regression multivariate distribution) <p>I'm building a regression model to predict the values of a feature <span class="math-container">$Y$</span> given a set of other features <span class="math-container">$X_{1}, X_{2}, X_{3}..X_{n}$</span>.</p>&#xA...
habedi/stack-exchange-dataset
73,116
When is z-normalization not needed when using DTW?
<p>I'm hoping to get some answers to a question I have regarding normalization of DTW datasets, in particular datasets in which two time-series shapes with similar shapes but differences in magnitude are misclassified under z-normalization. </p>&#xA;&#xA;<p>One reason is simply empirical. When I z-normalize my data it...
classification time series normalization
1
When is z-normalization not needed when using DTW? -- (classification time series normalization) <p>I'm hoping to get some answers to a question I have regarding normalization of DTW datasets, in particular datasets in which two time-series shapes with similar shapes but differences in magnitude are misclassified under...
habedi/stack-exchange-dataset
73,138
Relu with not gradient vanishing function is possible?
<p>I'm beginner in ML. &#xA;In the ANN, relu has the gradient of 1 in x>0</p>&#xA;&#xA;<p>how ever, i wonder in x=&lt;0 relu has gradient of 0 and may have gradient vanishing problem&#xA;in deep neural networks.</p>&#xA;&#xA;<p>if activation function like <strong>y=x(for the all the x)</strong> has no gradient vanishin...
machine learning activation function
1
Relu with not gradient vanishing function is possible? -- (machine learning activation function) <p>I'm beginner in ML. &#xA;In the ANN, relu has the gradient of 1 in x>0</p>&#xA;&#xA;<p>how ever, i wonder in x=&lt;0 relu has gradient of 0 and may have gradient vanishing problem&#xA;in deep neural networks.</p>&#xA;&#x...
habedi/stack-exchange-dataset
73,143
will increasing threshold always increase precision?
<p><a href="https://i.stack.imgur.com/KSLqV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KSLqV.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>here precision at threshold 0.85 > precision at threshold 0.90. shouldnt it be the other way round? increasing threshold will reduce False pos...
machine learning deep learning classification statistics data science model
1
will increasing threshold always increase precision? -- (machine learning deep learning classification statistics data science model) <p><a href="https://i.stack.imgur.com/KSLqV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KSLqV.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>here pre...
habedi/stack-exchange-dataset
73,151
How to identify topic transition in consecutive sentences using Python?
<p>I'm new to data mining. I want to detect topic transition among consecutive sentences. For instance, I have a paragraph (this could be a collection of dozens of sentences, sometimes without transitional words) as follows:</p>&#xA;<blockquote>&#xA;<p>As I really like Mickey Mouse, I was hopping to go to Florida. But ...
python data mining similarity bert topic model
1
How to identify topic transition in consecutive sentences using Python? -- (python data mining similarity bert topic model) <p>I'm new to data mining. I want to detect topic transition among consecutive sentences. For instance, I have a paragraph (this could be a collection of dozens of sentences, sometimes without tra...
habedi/stack-exchange-dataset
73,158
Filling missing values for Embedded List in Python3
<p>I searched for a similar question but I didn't come across. And I'm new in this area, I hope I explained my question well enough.</p>&#xA;&#xA;<p>I have a dataset consist of text data. I store them in a list and every row of a list consists of a string value. But every row length is not equal. I want them to be equa...
pandas data cleaning feature engineering dataframe python 3.x
1
Filling missing values for Embedded List in Python3 -- (pandas data cleaning feature engineering dataframe python 3.x) <p>I searched for a similar question but I didn't come across. And I'm new in this area, I hope I explained my question well enough.</p>&#xA;&#xA;<p>I have a dataset consist of text data. I store them ...
habedi/stack-exchange-dataset
73,163
Un-learning a single training example from a trained model
<p>I was going through the paper "<a href="https://research.google/pubs/pub46555/" rel="nofollow noreferrer">The ML Test Score: A Rubric for ML Production Readiness and Technical Debt Reduction</a>" by google on which suggests best practices for models in production. In a section about privacy controls in the data pipe...
machine learning data privacy
1
Un-learning a single training example from a trained model -- (machine learning data privacy) <p>I was going through the paper "<a href="https://research.google/pubs/pub46555/" rel="nofollow noreferrer">The ML Test Score: A Rubric for ML Production Readiness and Technical Debt Reduction</a>" by google on which suggests...
habedi/stack-exchange-dataset
73,168
Predicting time series, with few historical samples based on similar series
<p>I'm trying to build a model with Keras to predict the time series of a sensor, based on its type and historic data of sensors of the same type. </p>&#xA;&#xA;<p>The figure below shows 3 time series, generated from 3 sensors of the same type, the green dashed line is the new sensor data and the vertical line is where...
python keras time series
1
Predicting time series, with few historical samples based on similar series -- (python keras time series) <p>I'm trying to build a model with Keras to predict the time series of a sensor, based on its type and historic data of sensors of the same type. </p>&#xA;&#xA;<p>The figure below shows 3 time series, generated fr...
habedi/stack-exchange-dataset
73,189
Does BERT use GLoVE?
<p>From all the docs I read, people push this way and that way on how BERT uses or generates embedding. I GET that there is a key and a query and a value and those are all generated.</p>&#xA;&#xA;<p>What I don't know is if the original embedding - the original thing you put into BERT - could or should be a vector. Peop...
nlp bert transformer attention mechanism
1
Does BERT use GLoVE? -- (nlp bert transformer attention mechanism) <p>From all the docs I read, people push this way and that way on how BERT uses or generates embedding. I GET that there is a key and a query and a value and those are all generated.</p>&#xA;&#xA;<p>What I don't know is if the original embedding - the o...
habedi/stack-exchange-dataset
73,193
How to choose best model for Regression?
<p>I'm building a model to predict the flight delay. My dataset contains the following columns:</p>&#xA;&#xA;<p>FL_DATE (contains months(1-12)), OP_CARRIER (One hot encoded data of Carrier names), ORIGIN(One hot encoded data of Origin Airport), Dest(one-hot encoded data of Dest Airport), CRS_DEP_TIME(Intended time of d...
machine learning python regression predictive modeling
1
How to choose best model for Regression? -- (machine learning python regression predictive modeling) <p>I'm building a model to predict the flight delay. My dataset contains the following columns:</p>&#xA;&#xA;<p>FL_DATE (contains months(1-12)), OP_CARRIER (One hot encoded data of Carrier names), ORIGIN(One hot encoded...
habedi/stack-exchange-dataset
73,197
A Machine learning model that has a undefined input size but a fixed output?
<p>I don't know too much about ML but I can seem to figure out how to train something like this. If you guys could list some possible ways to do this, thank you.</p>&#xA;
machine learning python tensorflow
1
A Machine learning model that has a undefined input size but a fixed output? -- (machine learning python tensorflow) <p>I don't know too much about ML but I can seem to figure out how to train something like this. If you guys could list some possible ways to do this, thank you.</p>&#xA;
habedi/stack-exchange-dataset
73,211
Getting the positive impacting features using SHAP
<p>I'm attempting to use SHAP to automatically extract feature names that have a positive impact on my regression models. On inspection of the <a href="https://github.com/slundberg/shap/blob/master/shap/plots/summary.py" rel="nofollow noreferrer">code</a> I see that the bar plot, for example, determines these by taking...
features shap
1
Getting the positive impacting features using SHAP -- (features shap) <p>I'm attempting to use SHAP to automatically extract feature names that have a positive impact on my regression models. On inspection of the <a href="https://github.com/slundberg/shap/blob/master/shap/plots/summary.py" rel="nofollow noreferrer">cod...
habedi/stack-exchange-dataset
73,223
Why is n-grams language independent?
<p>I don't understand how n-grams are language independent. I've read that by using character n-grams of a word than the word itself as dimensions of a vector space model, we can skip the language-dependent pre-processing such as stemming and stop word removal. </p>&#xA;&#xA;<p>Can someone please provide reasoning for ...
nlp stanford nlp vector space models ngrams
1
Why is n-grams language independent? -- (nlp stanford nlp vector space models ngrams) <p>I don't understand how n-grams are language independent. I've read that by using character n-grams of a word than the word itself as dimensions of a vector space model, we can skip the language-dependent pre-processing such as stem...
habedi/stack-exchange-dataset
73,255
What is the purpose of reward threshold in OpenAI Gym?
<p>I've seen that OpenAI Gym environments can be registered with an optional reward threshold (<code>reward_threshold</code>) which represents:</p>&#xA;&#xA;<blockquote>&#xA; <p>The reward threshold before the task is considered solved</p>&#xA;</blockquote>&#xA;&#xA;<p>How does this value affect the learning process? ...
reinforcement learning openai gym
1
What is the purpose of reward threshold in OpenAI Gym? -- (reinforcement learning openai gym) <p>I've seen that OpenAI Gym environments can be registered with an optional reward threshold (<code>reward_threshold</code>) which represents:</p>&#xA;&#xA;<blockquote>&#xA; <p>The reward threshold before the task is conside...
habedi/stack-exchange-dataset
73,265
predict_proba to print specific class probablity
<p>I am having 16 labels and predict_proba is giving me probablities of all 16 categories in an array. Is there any way if I pass specific label to predict_proba it can only print me probablity of that category?</p>&#xA;&#xA;<pre><code>preds = model.predict(dataframe)&#xA;# getting predicted class , am interested in kn...
machine learning python
1
predict_proba to print specific class probablity -- (machine learning python) <p>I am having 16 labels and predict_proba is giving me probablities of all 16 categories in an array. Is there any way if I pass specific label to predict_proba it can only print me probablity of that category?</p>&#xA;&#xA;<pre><code>preds ...
habedi/stack-exchange-dataset
73,271
Google DataFlow
<p>I'm trying to build a Google dataflow pipeline through one of the posts in Medium.</p>&#xA;&#xA;<p><a href="https://levelup.gitconnected.com/scaling-scikit-learn-with-apache-beam-251eb6fcf75b" rel="nofollow noreferrer">https://levelup.gitconnected.com/scaling-scikit-learn-with-apache-beam-251eb6fcf75b</a></p>&#xA;&#...
python pipelines google cloud
1
Google DataFlow -- (python pipelines google cloud) <p>I'm trying to build a Google dataflow pipeline through one of the posts in Medium.</p>&#xA;&#xA;<p><a href="https://levelup.gitconnected.com/scaling-scikit-learn-with-apache-beam-251eb6fcf75b" rel="nofollow noreferrer">https://levelup.gitconnected.com/scaling-scikit...
habedi/stack-exchange-dataset
73,275
What is the gradient descent rule using binary cross entropy (BCE) with tanh?
<p>Similar to <a href="http://How%20to%20implement%20gradient%20descent%20for%20a%20tanh()%20activation%20function%20for%20a%20single%20layer%20perceptron?" rel="nofollow noreferrer">this post</a>, I need the gradient descent step of tanh but now with binary cross entropy (BCE). </p>&#xA;&#xA;<p>So we have </p>&#xA;&#x...
gradient descent activation function
1
What is the gradient descent rule using binary cross entropy (BCE) with tanh? -- (gradient descent activation function) <p>Similar to <a href="http://How%20to%20implement%20gradient%20descent%20for%20a%20tanh()%20activation%20function%20for%20a%20single%20layer%20perceptron?" rel="nofollow noreferrer">this post</a>, I ...
habedi/stack-exchange-dataset
73,289
Which target variable should I use?
<p>I have a problem where I want an LSTM to predict the resistance of a body. This value can also be calculated if we know the drag coefficient and the speed of that body. In my case, at inference time, the speed is known, meaning that I can do the following:</p>&#xA;&#xA;<ul>&#xA;<li>predict the drag coefficient, and ...
machine learning lstm feature selection
1
Which target variable should I use? -- (machine learning lstm feature selection) <p>I have a problem where I want an LSTM to predict the resistance of a body. This value can also be calculated if we know the drag coefficient and the speed of that body. In my case, at inference time, the speed is known, meaning that I c...
habedi/stack-exchange-dataset
73,311
Which of the scikit learn classification algorithms accept Sparse matrices?
<p>If I have to use scikit-learn(sklearn) library for classification and the feature matrix is a sparse matrix then which of the classification algorithms of this library can be used by me?</p>&#xA;
classification scikit learn
1
Which of the scikit learn classification algorithms accept Sparse matrices? -- (classification scikit learn) <p>If I have to use scikit-learn(sklearn) library for classification and the feature matrix is a sparse matrix then which of the classification algorithms of this library can be used by me?</p>&#xA;
habedi/stack-exchange-dataset
73,324
Why is the input to an activation function a linear combination of the input features?
<p>I'm new to deep learning, and there is something about the calculations I do not understand:&#xA;For a standard neural network, why is it that only the activation function is not linear, but the input to the activation function is a linear combination of each of the <span class="math-container">$x_i$</span>'s? For e...
neural network
1
Why is the input to an activation function a linear combination of the input features? -- (neural network) <p>I'm new to deep learning, and there is something about the calculations I do not understand:&#xA;For a standard neural network, why is it that only the activation function is not linear, but the input to the ac...
habedi/stack-exchange-dataset
73,326
Tensorflow 2.0 - Layer with fixed input
<p>I'm trying to use Tensorflow to optimize a few variables to be used in a KNN algorithm, however, I'm running into an issue where I'm unable to have a layer work properly if it is not connected to an <code>Input</code> layer.</p>&#xA;&#xA;<p>What I'm trying to do below is pass in <code>[[1]]</code> as a static tensor...
python tensorflow
1
Tensorflow 2.0 - Layer with fixed input -- (python tensorflow) <p>I'm trying to use Tensorflow to optimize a few variables to be used in a KNN algorithm, however, I'm running into an issue where I'm unable to have a layer work properly if it is not connected to an <code>Input</code> layer.</p>&#xA;&#xA;<p>What I'm tryi...
habedi/stack-exchange-dataset
73,338
Selecting most relevant word from lists of candidate words
<p>Let's suppose I have 1000's of training examples where each consists of a bucket e.g. <code>'engineering'</code> or <code>'management'</code> and a list of tags e.g. <code>['software', 'python', 'product']</code> where a human has selected the most relevant tag for the use case e.g.<code>'software'</code>.</p>&#xA;&...
machine learning nlp
1
Selecting most relevant word from lists of candidate words -- (machine learning nlp) <p>Let's suppose I have 1000's of training examples where each consists of a bucket e.g. <code>'engineering'</code> or <code>'management'</code> and a list of tags e.g. <code>['software', 'python', 'product']</code> where a human has s...
habedi/stack-exchange-dataset
73,343
Why is my model accuracy decreasing after the second epoch?
<p>This is my training log for ten epoch for a sentiment analysis model:</p>&#xA;&#xA;<pre><code>Train on 5487 samples, validate on 610 samples&#xA;Epoch 1/10&#xA;5487/5487 [==============================] - 23s 4ms/sample - loss: 1.4769 - accuracy: 0.5216 - val_loss: 2.4135 - val_accuracy: 0.6164&#xA;Epoch 2/10&#xA;54...
deep learning tensorflow lstm
1
Why is my model accuracy decreasing after the second epoch? -- (deep learning tensorflow lstm) <p>This is my training log for ten epoch for a sentiment analysis model:</p>&#xA;&#xA;<pre><code>Train on 5487 samples, validate on 610 samples&#xA;Epoch 1/10&#xA;5487/5487 [==============================] - 23s 4ms/sample - ...
habedi/stack-exchange-dataset
73,349
Help improving my "read_excel" execution time in python. My code reads slowly
<p>My first question here so please bare with me.</p>&#xA;&#xA;<p>I'm trying to feed my neural network with training data read in from an excel file. It works perfectly fine when i have less than 50 rows in the sheet. But when i try with the real excel file containing almost 4.000 rows it suddenly takes forever. Althou...
python excel time
1
Help improving my "read_excel" execution time in python. My code reads slowly -- (python excel time) <p>My first question here so please bare with me.</p>&#xA;&#xA;<p>I'm trying to feed my neural network with training data read in from an excel file. It works perfectly fine when i have less than 50 rows in the sheet. B...
habedi/stack-exchange-dataset
73,354
(De-)Scaling/normalizing input and output data inside Keras model as layer
<p>I am building a 2-hidden layer MLP using Keras.&#xA;I'm using a SciKit learn wrapper to be able to use the <code>GridSearchCV</code> functionality.&#xA;My sample-size is limited, forcing me to use K-fold verification as well for trustworthy results.</p>&#xA;&#xA;<p>However, it is to my understanding that for every i...
keras cross validation normalization feature scaling mlp
1
(De-)Scaling/normalizing input and output data inside Keras model as layer -- (keras cross validation normalization feature scaling mlp) <p>I am building a 2-hidden layer MLP using Keras.&#xA;I'm using a SciKit learn wrapper to be able to use the <code>GridSearchCV</code> functionality.&#xA;My sample-size is limited, f...
habedi/stack-exchange-dataset
73,356
Trying to understand the result provided by np.linalg.norm function in numpy (normalisation)
<p>I'm new to data science with a moderate math background. I'm playing around with numpy and can across the following:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/sXjqD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sXjqD.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>So after ...
python deep learning numpy normalization matrix
1
Trying to understand the result provided by np.linalg.norm function in numpy (normalisation) -- (python deep learning numpy normalization matrix) <p>I'm new to data science with a moderate math background. I'm playing around with numpy and can across the following:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/sXj...
habedi/stack-exchange-dataset
73,359
Are weights of a neural network reset between epochs?
<p>If an epoch is defined as the neural network training process after seeing the whole training data once. How is it that when starting the next epoch, the loss is almost always smaller than the first one? Does this mean that after an epoch the weights of the neural network are not reset? and each epoch is not a stand...
neural network training mlp epochs
1
Are weights of a neural network reset between epochs? -- (neural network training mlp epochs) <p>If an epoch is defined as the neural network training process after seeing the whole training data once. How is it that when starting the next epoch, the loss is almost always smaller than the first one? Does this mean that...
habedi/stack-exchange-dataset
73,368
What is the objective that is optimized with Random Search?
<p>I have recently learned about Random Search (or sklearn.model_selection.RandomizedSearchCV in Python) and was thinking about the theory behind the optimization process. In particular my question is, given that one performs Random Search on a certain algorithm (let's say random forest), what are the best hyperparamet...
optimization hyperparameter tuning randomized algorithms
1
What is the objective that is optimized with Random Search? -- (optimization hyperparameter tuning randomized algorithms) <p>I have recently learned about Random Search (or sklearn.model_selection.RandomizedSearchCV in Python) and was thinking about the theory behind the optimization process. In particular my question ...
habedi/stack-exchange-dataset
73,370
Time series regression forecast next month from now (random forest,Lasso,Ridge)
<p>I have a dataset about hedge funds. Its include data from 2010 january to 2019 december. This data are monthly financial ratios of hedge funds such as sharpe,alpha,beta,sortino and monthly returns of hedge funds. I normalized the relative returns of each fund. And I want to estimate these monthly returns. Using thes...
machine learning time series regression random forest
1
Time series regression forecast next month from now (random forest,Lasso,Ridge) -- (machine learning time series regression random forest) <p>I have a dataset about hedge funds. Its include data from 2010 january to 2019 december. This data are monthly financial ratios of hedge funds such as sharpe,alpha,beta,sortino a...
habedi/stack-exchange-dataset
73,376
Cross Correlation Between Input-Output Sine Waves
<p>I am writing an algorithm to estimate the frequency transfer function of the system. For this, I want to use the Cross-correlation Between Input-Output Sine Waves method. There are a few things I don't understand about method:&#xA;I - What does capital N mean?&#xA;II - Is and Ic scalar or vector(depend on N)?&#xA;Th...
correlation
1
Cross Correlation Between Input-Output Sine Waves -- (correlation) <p>I am writing an algorithm to estimate the frequency transfer function of the system. For this, I want to use the Cross-correlation Between Input-Output Sine Waves method. There are a few things I don't understand about method:&#xA;I - What does capit...
habedi/stack-exchange-dataset
73,377
Building a content-based music recommendation system
<p>I am trying to build a recommendation system in Python that recommends songs based on a playlist. </p>&#xA;&#xA;<p>What I have is two datasets:<br>&#xA;1. One dataset consists of 350 songs from my playlist and 13 acoustic features for each one like timber, energy, key, tempo, etc. that I extracted using the Spotify ...
machine learning python data recommender system similarity
1
Building a content-based music recommendation system -- (machine learning python data recommender system similarity) <p>I am trying to build a recommendation system in Python that recommends songs based on a playlist. </p>&#xA;&#xA;<p>What I have is two datasets:<br>&#xA;1. One dataset consists of 350 songs from my pla...
habedi/stack-exchange-dataset
73,390
Is my loss function right? WGAN
<p>I am new to GANs, but I was able to train a DCGAN decently. I decided to try a WGAN (not the improved one). I seem to get outputs, but my loss doesn't seem to converge for the generator.</p>&#xA;&#xA;<p>I am using the loss function</p>&#xA;&#xA;<pre><code>from keras import backend as K&#xA;def wasserstein_loss(y_tru...
machine learning gan
1
Is my loss function right? WGAN -- (machine learning gan) <p>I am new to GANs, but I was able to train a DCGAN decently. I decided to try a WGAN (not the improved one). I seem to get outputs, but my loss doesn't seem to converge for the generator.</p>&#xA;&#xA;<p>I am using the loss function</p>&#xA;&#xA;<pre><code>fro...
habedi/stack-exchange-dataset
73,393
MAE estimation for k-fold cross-validation
<p>I have code that estimates RMSE for k-fold cross-validation and I think it is correct (from book: Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow, 2nd Edition by Aurélien Géron)</p>&#xA;&#xA;<pre><code>scores = cross_val_score(forest_reg, a, b, scoring="neg_mean_squared_error", cv=10)&#xA;print(pd...
machine learning machine learning model
1
MAE estimation for k-fold cross-validation -- (machine learning machine learning model) <p>I have code that estimates RMSE for k-fold cross-validation and I think it is correct (from book: Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow, 2nd Edition by Aurélien Géron)</p>&#xA;&#xA;<pre><code>scores =...
habedi/stack-exchange-dataset
73,404
Error using image: Error when checking input: expected dense_56_input to have 2 dimensions, but got array with shape
<p>I am trying to train a Sequential model using simple flow_from_directory() but i am getting this error , I have tried using lesser layers but the error dose not go away.</p>&#xA;&#xA;<pre><code>from keras.preprocessing.image import ImageDataGenerator&#xA;from keras.models import Sequential&#xA;from keras.layers impo...
machine learning neural network deep learning image classification
1
Error using image: Error when checking input: expected dense_56_input to have 2 dimensions, but got array with shape -- (machine learning neural network deep learning image classification) <p>I am trying to train a Sequential model using simple flow_from_directory() but i am getting this error , I have tried using less...
habedi/stack-exchange-dataset
73,408
What information does output of [SEP] token captures in BERT?
<p>After reading around on the web I came to understand that the output representation of the special token [CLS] captures the representation of a sentence (am I correct?).</p>&#xA;&#xA;<p>My primary question is what information does the output embedding of [SEP] token (T_SEP) captures?</p>&#xA;&#xA;<p>My other doubt i...
nlp word embeddings bert
1
What information does output of [SEP] token captures in BERT? -- (nlp word embeddings bert) <p>After reading around on the web I came to understand that the output representation of the special token [CLS] captures the representation of a sentence (am I correct?).</p>&#xA;&#xA;<p>My primary question is what information...
habedi/stack-exchange-dataset
73,418
Discretisation Using Decision Trees
<p>I'm new to the machine learning and working on a supervised classification problem. I used discretization process to transform continuous variables into discrete variables. So I followed <a href="https://towardsdatascience.com/discretisation-using-decision-trees-21910483fa4b" rel="nofollow noreferrer">this article...
decision trees feature engineering
1
Discretisation Using Decision Trees -- (decision trees feature engineering) <p>I'm new to the machine learning and working on a supervised classification problem. I used discretization process to transform continuous variables into discrete variables. So I followed <a href="https://towardsdatascience.com/discretisati...
habedi/stack-exchange-dataset
73,424
Classifying boat images
<p>I trying to get some experience by exploring <a href="https://www.kaggle.com/clorichel/boat-types-recognition/version/1" rel="nofollow noreferrer">this Kaggle dataset</a>.</p>&#xA;<p>It consists of 1500 pictures of boats classified in 9 categories. The data is as follows :</p>&#xA;<pre><code>#x_train consists of 115...
python deep learning keras cnn image classification
1
Classifying boat images -- (python deep learning keras cnn image classification) <p>I trying to get some experience by exploring <a href="https://www.kaggle.com/clorichel/boat-types-recognition/version/1" rel="nofollow noreferrer">this Kaggle dataset</a>.</p>&#xA;<p>It consists of 1500 pictures of boats classified in 9...
habedi/stack-exchange-dataset
73,427
How to create a matrix from two given vectors in R in RStudio?
<p>Suppose, <span class="math-container">$c(1, 2, 3, 4)$</span> and <span class="math-container">$c(2, 4, 5, 6)$</span> are two vectors. Then in R or RStudio,</p>&#xA;&#xA;<blockquote>&#xA; <p>How to create a <span class="math-container">$4\times 2$</span> matrix from these two vectors?</p>&#xA;</blockquote>&#xA;&#xA;...
r rstudio matrix
1
How to create a matrix from two given vectors in R in RStudio? -- (r rstudio matrix) <p>Suppose, <span class="math-container">$c(1, 2, 3, 4)$</span> and <span class="math-container">$c(2, 4, 5, 6)$</span> are two vectors. Then in R or RStudio,</p>&#xA;&#xA;<blockquote>&#xA; <p>How to create a <span class="math-contain...
habedi/stack-exchange-dataset
73,445
Getting a best k in KNN Algorithm
<p>So, i was learning the KNN Algorithm and there i learnt cross Validation to find a optimal value of k.Now i want to apply grid search to get the optimal value.I found an <a href="https://stackoverflow.com/a/57785242/12210002">answer</a> on stack overflow where both standardScaler and KNN are passed as estimator.</p>...
machine learning machine learning model data science model k nn grid search
1
Getting a best k in KNN Algorithm -- (machine learning machine learning model data science model k nn grid search) <p>So, i was learning the KNN Algorithm and there i learnt cross Validation to find a optimal value of k.Now i want to apply grid search to get the optimal value.I found an <a href="https://stackoverflow.c...
habedi/stack-exchange-dataset
73,451
How to calculate events per day in R including dates when no events occurred?
<p>I would like to create a data frame in which in the first column I will have all the dates from a certain period of time and in the second the number of events that occurred on each date including dates when no events occurred. I would also like to count the events to which specific factors have been assigned</p>&#x...
r
1
How to calculate events per day in R including dates when no events occurred? -- (r) <p>I would like to create a data frame in which in the first column I will have all the dates from a certain period of time and in the second the number of events that occurred on each date including dates when no events occurred. I wo...
habedi/stack-exchange-dataset
73,459
Positive or negative impact of features in prediction with Random Forest
<p>In classification, when we want to get the importance of each variable in the random forest algorithm we usually use Mean Decrease in Gini or Mean Decrease in Accuracy metrics. Now is there a metric which computes the positive or negative effects of each variable <strong>not</strong> on the predictive accuracy of th...
machine learning classification random forest predictor importance
1
Positive or negative impact of features in prediction with Random Forest -- (machine learning classification random forest predictor importance) <p>In classification, when we want to get the importance of each variable in the random forest algorithm we usually use Mean Decrease in Gini or Mean Decrease in Accuracy metr...
habedi/stack-exchange-dataset
73,465
Sort dataframe by date column stored as string
<p>I have dataframe named <code>df1</code>.</p>&#xA;&#xA;<p>I want to <strong>sort</strong> data frame <em>month</em> column according to month (Jan, Feb, March..). </p>&#xA;&#xA;<p>For that I used code:</p>&#xA;&#xA;<pre><code>sorted_df = df1.sort_values(by='month')&#xA;print(sorted_df)&#xA;</code></pre>&#xA;&#xA;<p>b...
python time series pandas dataframe
1
Sort dataframe by date column stored as string -- (python time series pandas dataframe) <p>I have dataframe named <code>df1</code>.</p>&#xA;&#xA;<p>I want to <strong>sort</strong> data frame <em>month</em> column according to month (Jan, Feb, March..). </p>&#xA;&#xA;<p>For that I used code:</p>&#xA;&#xA;<pre><code>sort...
habedi/stack-exchange-dataset
73,473
Intuition of LDA
<p>Can anyone explain how the LDA-topic model assigns words to topics? &#xA;I understand the generative property of the LDA model but how does the model recognize that "Labrador" and "dog" are similar words/ in the same cluster/topic? Is there kind of a similarity measure? The learning parameters of LDA are the the ass...
machine learning nlp unsupervised learning topic model lda
1
Intuition of LDA -- (machine learning nlp unsupervised learning topic model lda) <p>Can anyone explain how the LDA-topic model assigns words to topics? &#xA;I understand the generative property of the LDA model but how does the model recognize that "Labrador" and "dog" are similar words/ in the same cluster/topic? Is t...
habedi/stack-exchange-dataset
73,485
Find the time between two events by customer id
<p>I need to find a customer has bought P1, and after how many days customer will buy P2. &#xA;I am unable to find the days between order of P1 and the next order of P2 by the same customer.</p>&#xA;&#xA;<p>I have data as shown below. </p>&#xA;&#xA;<pre><code>Customer ID Order_Date Product &#xA; C-87 11/20...
machine learning python data mining pandas pattern recognition
1
Find the time between two events by customer id -- (machine learning python data mining pandas pattern recognition) <p>I need to find a customer has bought P1, and after how many days customer will buy P2. &#xA;I am unable to find the days between order of P1 and the next order of P2 by the same customer.</p>&#xA;&#xA;...
habedi/stack-exchange-dataset
73,491
In neural networks model, which number of hidden units to select?
<p>In the neural networks model, how many numbers of hidden units need to keep to get an optimal result, as per <strong>Cybenko theorem</strong> which demonstrates that <strong>only one hidden layer</strong> is sufficient to solve any <strong>regression/classification</strong> problem but the selection of the number of...
machine learning neural network deep learning ann
1
In neural networks model, which number of hidden units to select? -- (machine learning neural network deep learning ann) <p>In the neural networks model, how many numbers of hidden units need to keep to get an optimal result, as per <strong>Cybenko theorem</strong> which demonstrates that <strong>only one hidden layer<...
habedi/stack-exchange-dataset
73,502
Confidence interval interpretation in linear regression when errors are not normally distributed
<p>I've read that "<em>If the error distribution is significantly non-normal, confidence intervals may be too wide or too narrow</em>" (<a href="http://people.duke.edu/~rnau/testing.htm" rel="nofollow noreferrer">source</a>). So, can anyone elaborate on this? When are the confidence intervals narrow and when are they w...
regression linear regression
1
Confidence interval interpretation in linear regression when errors are not normally distributed -- (regression linear regression) <p>I've read that "<em>If the error distribution is significantly non-normal, confidence intervals may be too wide or too narrow</em>" (<a href="http://people.duke.edu/~rnau/testing.htm" re...
habedi/stack-exchange-dataset
73,518
how does word variety depend on total words?
<p>I want to compare the word variety of several books. But some are short, while others are long. So how can I correct for the fact that longer books will generally contain a larger number of unique words. I tried simply dividing the number of unique words in each book by the number of total words in each book. But I ...
nlp
1
how does word variety depend on total words? -- (nlp) <p>I want to compare the word variety of several books. But some are short, while others are long. So how can I correct for the fact that longer books will generally contain a larger number of unique words. I tried simply dividing the number of unique words in each ...
habedi/stack-exchange-dataset
73,550
Question on ANOVA and Correlation/Association
<p>I've been working on examining statistical relationships between variable:</p>&#xA;&#xA;<ol>&#xA;<li>Pearsons, Spearman's for continuous variables</li>&#xA;<li>Kendall's Tau, Cramer's V for ordinal/nominal variables.</li>&#xA;</ol>&#xA;&#xA;<p>I know there's many more ways. Recently I read about ANOVA and hypothesis...
statistics correlation statsmodels anova
1
Question on ANOVA and Correlation/Association -- (statistics correlation statsmodels anova) <p>I've been working on examining statistical relationships between variable:</p>&#xA;&#xA;<ol>&#xA;<li>Pearsons, Spearman's for continuous variables</li>&#xA;<li>Kendall's Tau, Cramer's V for ordinal/nominal variables.</li>&#xA...
habedi/stack-exchange-dataset
73,553
How is the "base value" of SHAP values calculated?
<p>I'm trying to understand how the base value is calculated. So I used an example from SHAP's github notebook, <a href="https://github.com/slundberg/shap/blob/master/notebooks/tree_explainer/Census%20income%20classification%20with%20LightGBM.ipynb" rel="nofollow noreferrer">Census income classification with LightGBM</...
lightgbm explainable ai shap
1
How is the "base value" of SHAP values calculated? -- (lightgbm explainable ai shap) <p>I'm trying to understand how the base value is calculated. So I used an example from SHAP's github notebook, <a href="https://github.com/slundberg/shap/blob/master/notebooks/tree_explainer/Census%20income%20classification%20with%20L...
habedi/stack-exchange-dataset