# Tag Info

### Derivative of MSE Cost Function

Any term $f$ that is not a function of $\theta_j$ in any equation will have a partial derivative $\frac{\partial}{\partial\theta_j}(f) = 0$. Importantly, no $x_i$, $y$ or $\theta_{i \ne j}$ depend in ...
• 27.1k

### Which data mining or machine learning algorithm would be appropriate for learning ordered frequent patterns?

Sequence mining seems the thing you are looking for. Used quite extensively in problems with ordered data, e.g. mapping DNA sequence -> disease. There are algorithms like SPADE and PrefixSpan.
• 161
1 vote

### Entity Embeddings of email address

Well, it's possible but it wouldn't work: NER models rely on indications in the text close to the entity, for example it finds X to be a location in the sentence "Peter went to X by train" ...
• 20.7k
1 vote

### Need an example of a custom class whose instance is fed to sklearn Pipeline / make_pipeline to use with GridSearchCV

Originally, I wanted to create a (SelectFromModel, LogisticRegression) pipeline. SelectFromModel object is constructed based on a pre-selected RandomForestClassifier. The problem is that GridSearchCV ...
• 131
1 vote

### How can I export the best classifier from my code to a model for real future usage?

The logic seems completely fine. In your place, I would save all the model's performances inside a dictionary to keep track and use any of them in case I need them. ...
• 2,232

### Feasibility study of machine learning

A feasibility study often keeps company with business value analysis, and in your case the study entails the following steps: ML problem definition and desired outcome Firstly, define your problem ...
• 346

### CNN not learning properly

Late answer, but I was running into a similar issue. I set the learning rate of my Adam optimizer to a lower value (e.g. 3e-5) and voila! The model started fitting.
• 101

### Why does accuracy remain the same

be carefull: you shouldn't consider sigmoid & softmax activation functions to be interchangeable, because the first is Only for BinaryClf, the second is Only for MultiClassClf -- because having ...

### I am getting (loss: nan - accuracy: 0.0000e+00) for all epochs after training the model

you should one_hot target(y) before model.fit & give it in training in such a form y= tf.one_hot(y,10,) you've got ok, just display results of each batch ...
1 vote
Accepted

### Interpreting the variance of feature importance outputs with each random forest run using the same parameters

Random Forests are full of 'randomness', from selecting and resampling the actual data (bootstrapping) to selection of the best features that go into the individual decision trees. So with all of this ...

### How to count words in a dataframe?

The Series.str.contains method will return True for str elements in a series that contain a substring. So ...
• 111

### Approaches to fit a theoretical model on a physical device

If you have a physical model of which you do not know the exact parameters, then the following should work: Generate a series of $T(f)$ functions, with repeated data points by setting $S_{in}(f)$ and ...
Accepted

### How to set the same number of datapoints in the different ranges in correlation chart

You can bin your variables to prevent overplotting and make the output cleaner. Here is an example from StackOverflow: https://stackoverflow.com/questions/16947210/making-binned-scatter-plots-for-two-...

### What is Typical Variation Normalization?

I suggest going straight to the source and giving the Google paper a read on it (including the TVN paragraph in the appendix), as well as the CORAL paper which underlies it: https://www.biorxiv.org/...

### experience replay memory: saving the next state required when state does not depend on action?

For question one; if you look at Q-learning for example the next state is retrieved from the replay buffer and used in value estimation / loss calculation during critic training: ...
• 101

### Can clustering results based on probability be used for supervised learning?

It's perfectly possible to use the results of clustering as features to train a supervised model... but this is not what you're asking, as far as I understand. To have any kind of supervised learning, ...
• 20.7k
1 vote
Accepted

### Random kernels in multivariate Rocket sktime

Looking at the source code, the sktime implementation randomly selects the number of features to use for each kernel and then randomly chooses the input features. For example, if your dataset contains ...

### Why should the data be shuffled for machine learning tasks

Most of the ML algorithms are likely to pick up patterns even in the order you feed data, to avoid picking inadvertently pattern which does not exist, it is important to feed the model with shuffled ...

### Should I remove the trend from timeseries when using DeepAR

Yes, you should. The main reason you should do this is because when data is trending up/down, it's more difficult to sample the useful data when training the model as the data is changing constantly, ...

### How "similarity" is measured in image retrieval?

There is no single best similarity metric, unless a query and found images are near identical. Similarity is not a universal concept. Perception depends on a person. Similarity is trained. Maybe it ...
1 vote

### What to do if the model is not performing well on a validation dataset

Just a few comments: You probably don't need SMOTE if your data is only slightly imbalanced. It can be a source of bias. 30% accuracy is extremely low: there's probably a mistake somewhere, your ...
• 20.7k
1 vote

### How to train a machine learning model for named entity recognition

There are actually many libraries for training NER models. It's useful to know that this type of model/task is called sequence labeling because it consists in predicting a label for every word, ...
• 20.7k

### Model Performance on external validation Set really low?

First, an AUC less than 50% is terrible: it means that you get better performance by switching the positive and negative labels! So the model is doing worse than nothing on this data. In general there ...
• 20.7k
Accepted

### Linear models to deal with non-linear problems

Actually, a model such as $Y = b_0 + b_1X + b_2X^2$ is not a 3D parabola, but a 2D parabola. There are only two variables ($Y$ and $X$), in other words, the function is still $Y = f(X)$. A 3D parabola ...

### Anomaly Detection

This is a pretty simple example and I would not rely on ANY automatic detection algorithm until I manually looked at this or historical data and labelled data points as "unusual" according ...

### Restrictions on my skewed validation data

It is best practice to not make any restrictions or manipulations just on a validation dataset, this includes removing categories or downsampling. Changing just the validation dataset has the ...
• 16.2k
Accepted

### How to interpret a linear regression effects graph?

Note: you didn't mention what this is for, i.e. the target variable that this model is supposed to predict. Anyway this graph shows for each independent variable (feature) its effect on predicting the ...
• 20.7k

### class weighted classification

Accuracy is by definition "weighted" according to the classes proportions: it counts the number of correct instances in the full dataset, so a class with N% of the instances represents N% of ...
• 20.7k

### Integration of NLP and Angular application

When deploying a model into production, similar data transformation steps have to be taken during training and prediction. Scikit-learn has a Pipeline class that makes it more straightforward to do ...
• 16.2k

### Linear models to deal with non-linear problems

You can also take the log10() or log() of your class/predictor variable to linearize any nonlinear relationship. This would be a ...
• 580

### Linear models to deal with non-linear problems

Let's say you want to plot the parabola $x²$ with a linear model. This won't work on it's own, as a standard linear model can only create a function of the form $ax+b$. So what you can do is, you not ...
• 70

### Difference between regret and pseudo-regret definitions in multi-armed bandits

There is confusion because there is no consensus in the community. While I think the definitions are well-explained in your references, here I try to phrase them in my own words hoping that it can ...

### Distribution Shift vs Transfer Learning

Actually, Transfer Learning has a broader definition. It includes distribution shift (covariate shift, sample bias etc..) as well. You could apply a TL method using a model which has been trained on a ...

### Is my model overfitting ? Training Acc :93 % test accuracy 82%

You can perform a cross validation and observe the values you get for the accuracy in the different folds. If they differ a lot, your model is overfitting. If they are close enough, your model is fine....
• 320

### I cannot work out the benefits of a pipeline over a linear sequence of code instructions

In general the preporocessing must be done after the train test split. So, always fit and transform on train data and ...
1 vote

### How is the probability prediction of a binary classifier predicted

y is beta0 + beta1*x1 + beta2*x2 .....+ epsilong probability = ((e power y)/(1 + e power y)) ...

### Is my model overfitting ? Training Acc :93 % test accuracy 82%

How can we ask this question? Results doesn't simply depends on 'what is the accuracy on training and test sets', there are others side to consider. What about your data? Is it balanced or not? What ...
• 68
1 vote

### Standardization in combination with scaling

Once you standardize the data, the data falls in the range -3.14 to +3.14 in ...

### Is my model overfitting ? Training Acc :93 % test accuracy 82%

Just asking whether you have controlled the parameters with a proper range. Controlling the parameters like Gamma, max depth, min child weight, subsample, objective, learning rate, n estimators. These ...

### Should I be using y_pred or y_pred_proba for binary Classification?

It depends on what Client want as an outcome. Two cases to be mentioned here. Case-1: If client wants just the Predicted Class go with y_pred, as it outputs the class. Case-2: If client wants the ...

### Categorical data preprocessing for training a algorithm

You can try using other encoder like Mean Encoder, Ordered Label Encoder, Weight Of Evidence Encoder, Propbability Ratio Encoder, Binary Encoder

### Deploy final model from train dataset or train + test dataset

Below are the steps followed. Split data to train and OOT. Model on train data. Evaluate on Test set. Pickle the model Create an API. Use the model that you have trained from train dataset and ...

### What kind of neural network am I using? How can I build a specific kind of network?

Here you have designed a simple ANN architecture. Anyhow if you want to build CNN architecture(Refer https://keras.io/api/layers/convolution_layers/) RNN architecture(Refer https://keras.io/api/layers/...

### could not convert string to float: 'YELLOW'

I guess this is the data you are working on. Attribute Information: (Classes Inflated T or F) Color yellow, purple size large, small act stretch, dip age ...

### Data preprocessing methods

Here are some. Dealing with the variable Types. Dealing with Missing data Encoding categorical variables Categorical variable — cardinality Categorical variable — rare labels Dealing with Outliers ...
1 vote

### Any alternative to Google Colab?

I suggest you can give a try in JOVIAN. Even you can go with Kaggle Notebooks. Also, suggest to activate GPU Runtime in Google Colab.

### Should I Impute target values?

Data Imputation of the target variable makes the model BIAS. A small correction is not to use label encoder for predictors. Label Encoder to be used for only target variables if they are categorical. ...