New answers tagged

0

It should be a single model. Obviously City should be one of the variable fields, if it has importance as predictor. The simple reason behind this decision is that your model gets to see more data when trained on combined data from all cities.


1

High correlation between 2 features, eg $x_1$ and $x_2$ means that there is a linear relation between the two features (ie one is a linear transformation of the other), $x_2 = c_0 + s \cdot x_1 + \epsilon$. That means any linear transformation of one or both features (eg multiplying by random factors), simply leaves the linear relation intact. $x_{21}$ = $a \...


2

can we remove this correlation by multiplying or dividing the values of one of the variables with random factors (E.g., multiplying the first value with 2, the second value with 3, etc.) No you can not decorrelate 2 variables by multiplying or dividing them by a random factors, you can use one of the following methods instead if you want to keep the 2 ...


0

You can use PCA to transform your N correlated features to N uncorrelated features. You can then check for correlation between your N uncorrelated features against your target and choose to drop the ones with very low correlation.


0

Yes but your training and testing sets should be different in each run otherwise I don't see how you can interpret the result. As Jayaram said, the best practice is always do a K-fold cross validation.


0

With Keras, you could use the functional API, to estimate a model with two outputs („multioutput“). Simply train the model on two outputs like: # Outputs out1 = Dense(1)(x) out2 = Dense(1)(x) # Compile/fit the model model = Model(inputs=Input_1, outputs=[out1,out2]) model.compile(optimizer = "rmsprop", loss = 'mse') # Add actual data here in the ...


0

I ran test.shape and train.shape after every modification on the dataset. I missed to apply one hot encoding on two categorical columns on the test data. See the codes and differences on pictures: Dummies Created and test data gets more columns because of categorical columns "auto_make" and "incident_state" Observations on test['...


0

Yes, you can try k-fold validation, where indicidual models are generated from various subsets of the data and performance measured on a validation set. You can the compute the average and variance of model accuracy, other performance metrics to understand how stable your model is.


2

Classical reinforcement learning (e.g. vanilla Q-learning) is not normally applied to games. There are some environments to play (and do research) on classical RL benchmarks (e.g. balancing pole), like OpenAI Gym. It can be extended to your own benchmark environments. Games, nevertheless, are a standard testbed for deep reinforcement learning algorithms. ...


0

Edited my previous comment as there was an Syntax error, This happen as I am new in this join recently(01/04/2021) on this platform you can try replace function with NumPy library which will help to speed up the process. df.replace('^^',np.NaN) or df.replace('not filled in',np.NaN), df.replace('&&', np.NaN), df.replace('values needed', np.NaN), df....


2

The target will still be a form of a return estimation ($V(s_t)$, $Q(a_t,s_t)$, Advantage, n-step reward, etc). For example in your case the $Q_w$ that Critic estimated. You will need to review a bit Policy Gradient methods in this order: PG Theorem, REINFORCE (Actor only method) then AC (Actor-Critic) and then A2C. I will give you a conceptual explanation, ...


1

This is specified in the original paper that led to that video: Policies are optimized using Proximal Policy Optimization (PPO) (Schulman et al., 2017) and Generalized Advantage Estimation (GAE) (Schulman et al., 2015) They, nevertheless, used concepts often used in evolutionary algorithms, specifically competitive co-evolution, as the goal of the seeking ...


1

PCA removes the connection with the original features,so the interpretation of the visualisations in the principle component space is therefore not very meaningful. E.g. cluster A has higher values of PC1, where cluster B has higher values of PC2. If you can clearly see that PC1 is only representative of Feature X, then fine, but this isn't often the case. ...


1

The expressiveness of the gaussian process grows with a number of training points. So, the vapnik-chervonenkis dimension in fact is infinite (pretty much the same way it's infinite for k nearest neighbors) and unfortunately your rule of thumb is not applicable here. You should probably rely on train/validation split to estimate the generalization. From my ...


0

Using momentum is a noise reduction (noisy gradients) and signal amplification strategy. Imagine a large hill with a rough terrain with lots of ups-and-downs. We are trying to navigate to the bottom of the hill by using purely local information. A bad strategy is course correct frequently every time we see a potential new direction with steeper descent. The ...


0

The picture is telling you that test accuracy is improving with higher k, while train accuracy is degrading marginally. You can settle for k=15, because beyond that you have diminishing returns on the test accuracy. In general, you want to select k that shoots for the highest test accuracy (unseen data).


0

A common approach is to use ensemble uncertainty. Train a few versions of your model (say 5 versions), where you initialise each training process with a different seed. For any new data point, you evaluate it using all your 5 trained models and then see how well they agree - if they don't agree well, you can say I don't know. You can measure agreement ...


2

We find some justifications in the Conformer paper: Convolutions are better than Transformers at detecting fine-grained patterns: While Transformers are good at modeling long-range global context, they are less capable to extract fine-grained local feature patterns. Convolution neural networks (CNNs), on the other hand, exploit local information and are ...


0

This appears like a standard multi class classification problem. The features are frequency counts of the basic messages leading up to the fatal message. You would have as many features as there are basic categories. The labels would be the fatal message categories themselves.


0

Actually, your objective here is not clear. Following your example, I belive you want to obtain likeness/relationship between users and places. So basically what you would want to do is to create a domain of users and places. Now for different addresses (eg. A and C), you can treat the same user (eg. One) as different users i.e. "One-A" and "...


0

If you necessarily want to predict a category for an unlabeled product, then you can use TF-IDF Vectorization which is similar to what you are thinking of. Using cosine similarity, you can find the top 5 most similar documents and on the basis of majority of their categories, you can predict the category of the test document.


1

You basically want your model to say - I dont know. For the test set created out of the original dataset with labels, plot a histogram of the probabilities of the predicted class. Are they generally higher than some threshold say 0.2 ? If so experiment using that as a threshold to flag items from your unlabeled dataset for a manual inspection. The hope is ...


0

It is likely that your train variable in kf.split(train): is a list of two lists e.g. train_x and train_y or something similar. I am guessing this because the KFold API is only detecting only two entries in it, which it is unable to partition in 5 subsets (folds).


1

No, Reinforcement Learning and Unsupervised Learning are considered two different paradigms. We can refer to the seminal book Pattern Recognition and Machine Learning by Christopher Bishop for their respective definitions: Unsupervised learning: In other pattern recognition problems, the training data consists of a set of input vectors x without any ...


0

If adding the identifiers (I presume not as discrete values but converted to real numbers) improved the results, then there should be a not obvious correlation between the IDs and the target variable. Maybe IDs reflect the seniority of the rider (the higher the ID, the lower the seniority), and therefore acted as a proxy for it in the model. Despite seeming &...


0

Given that you have only 3 classes and that they closely depend on each other, I think it's worth trying a multiclass setting as WBM said. The idea is to label each video using the full combination of actions, since the maximum number of combinations is 2^3 = 8: R-I-F R-I R-F R I-F I F none Probably some combinations of actions are impossible, so the ...


0

You can use any variable during model training if this variable is available during inference time. This is the only technical restriction. Another question is should you include this column or not. If this column is completely unique and does not have any relevant information in it then you can discard it. Also, categorical columns with high cardinality (...


0

I believe you are just describing standard classification. Take the image below, the model of the classification is the decision boundary found between the two classes. After we have found this model, using a classification algorithm (clustering or otherwise), for new data we can use it to predict which class the new data belongs to.


0

The answer can be found by just printing sample_model.summary() giving Model: "sequential" _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= dense (Dense) (None, 32) 160 ...


0

You can use seller mean buying price, std buying price, max buying price, min buying price, median buying price PLUS include recently user buying power to suggest the totally new product to the user given the current data that's best I can recommend although extensive data can lead to better suggestions.


0

SVM does not learn iteratively unlike Neural Networks that's why they cant possess EPOCH parameters. see: https://scikit-learn.org/stable/modules/svm.html


0

It's not severe overfitting. So, here is my suggestions: 1- Simplify your network! Maybe your network is too complex for your data. If you have a small dataset or features are easy to detect, you don't need a deep network. 2- Add Dropout layers. 3- Use weight regularization. Here is the link for further information: https://keras.io/api/layers/regularizers/


0

Support vector machine model in sklearn support adding max iterations parameter which you can change to a higher value. But they don't have epochs parameters nor do they support batch sizes. To go into more depth, support vectors use an exact convex optimization algorithm, not stochastic gradient descent (like Neural nets). They work on the entire dataset at ...


0

If you're trying too hard, ask yourself if you're enjoying it. If you're asking yourself if you're enjoying it, then maybe you should ask yourself what it is that you really enjoy. Otherwise, try the Schaum series in Calculus, Linear Algebra, Statistics. Those are excellent books for beginners: https://www.amazon.com/Schaums-Outline-Linear-Algebra-Outlines/...


0

Here is what you could try doing: Get a feel of the shape of your data. Split your time-series by day. Compare the time-series across multiple days. Plot time in X-axis and the target variable (for forecast) on the Y-axis. Do the shapes look similar or different ? Can you eyeball N-Distinct shapes that the curve takes ? Find out the "daily mean" ...


0

Looking at your data - the easiest way is to create a Last-N Days hourly average of the binary indicator - and then use a threshold (based on experimentation) to binarize it. e.g. if your Last 10 Day hourly average looks like this: 0, 0, 0.6, 0.8, 0.9, 1, 0.9, 0.7, 0, 1, 1, 1, 0 Then, a threshold of 0.8 to binarize would result in the following: 0, 0, 0, 1, ...


3

The problem is that, by definition, your target variable is not available at inference time, and that is why you want to predict it. If your target variable was available at inference time, then there is no point in predicting it. Therefore, if you use the target variable (or a transformation of it) as input to your model, what data are you going to feed to ...


1

Neural Networks try to approximate the function which maps the given image to its label. Changing the number of hidden layers essentially means changing the number of parameters, which would be used to approximate that input-label mapping. These parameters include weights and biases ( in the case of Dense layers ). Depending upon the number of parameters, ...


1

More data could potentially lead to more epochs required to find the best model. The number of epochs to reach the minimum loss will vary depending on your hyperparameters, dataset, and initial weights. I would get out of the mindset of trying to find the exact number of epochs required. Most popular deep learning libraries will allow you to stop training if ...


2

If your objective is to convert non-normal data into something that looks more normal / gaussian - try the Box-Cox Transform here. It is a family of transforms that looks at your data - and provides the best possible transformation.


0

As you add more parameters, your model is probably overfitting to the training data, that is, it is memorizing the training data and therefore is worse at generalizing when used on the test/validation data.


1

A brute-force method is simply to try all rotation angles and decide if 2 images are a rotation of one another. However, there are features (eg fourier coefficients) which are rotation-invariant. So comparing these rotation-invariant features is a similarity metric for determining if 2 images are a rotation of one another. References: Rotation Invariance in ...


1

Here is a code I have written to handle Multicollinearity in a dataset. This code snippet is able to handle the following listed items: Multicollinearity using Variable Inflation Factor (VIF), set to a default threshold of 5.0 You just need to pass the dataframe, containing just those columns on which you want to test multicollinearity. This function will ...


1

They used Distributional Proximal Policy Optimization (DPPO). In the article that video is associated to, they provide a brief overview of it: In order to learn effectively in these rich and challenging domains, it is necessary to have a reliable and scalable reinforcement learning algorithm. We leverage components from several recent approaches to deep ...


1

Suppose you have a question like: "How does car weight affect miles per gallon (mpg)?" Load and plot the "car data". In the first plot you can clearly see that there is a (more or less) linear relation between $weight$ and $mpg$. Now you can ask: is there a difference in time? You can add a "dummy" for the years $\leq$ 1975 to ...


1

We just encode the categorical variable to some sort of numerical representation (like one-hot encoding) The choice of representation matters, because it has to preserve the properties of a categorical variable: one-hot-encoding is a standard option, but directly encoding categorical values as integers is a mistake because it introduces order where there is ...


0

This is explained in the original article where deterministic policy gradient theorem was first proposed, in section 3.3: The deterministic policy gradient theorem does not at first glance look like the stochastic version (Equation 2). However, we now show that, for a wide class of stochastic policies, including many bump functions, the deterministic policy ...


0

Linear Regression is Linear Regression regardless of how you calculate/estimate the parameters. The question becomes significant in case of a large multi-variate dataset where it is not easy/fast/possible to compute the parameters using algebraic equations (aka fitting simple line). In such cases Machine Learning techniques such as Stochastic Gradient ...


4

Reinforcement learning differs from Unsupervised learning as it uses additional information regarding the expected behavior of the agent in the form of a reward function. However, it also differs from Supervised learning as it does not require any labelled data for training or testing. So, it is neither of them. You may also refer to the wiki page of ...


0

With a straightforward approach, you can just oversample one of the classes to get the imbalance. You can achieve it with using SMOTE for example. Usually this technique is used to get a balanced set from imbalanced, but it can also work vice-versa, just oversample only once class. Some links to check: https://imbalanced-learn.org/stable/over_sampling.html ...


Top 50 recent answers are included