Questions tagged [weighted-data]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
217
votes
9answers
280k views

How to set class weights for imbalanced classes in Keras?

I know that there is a possibility in Keras with the class_weights parameter dictionary at fitting, but I couldn't find any example. Would somebody so kind to ...
28
votes
3answers
37k views

xgboost: give more importance to recent samples

Is there a way to add more importance to points which are more recent when analyzing data with xgboost?
13
votes
2answers
23k views

Sample Importance (Training Weights) in Keras

How do you add more importance to some samples than others (sample weights) in Keras? I'm not looking for class_weightwhich is a fix for unbalanced datasets. ...
9
votes
1answer
5k views

CNN - imbalanced classes, class weights vs data augmentation

I have a set of data with a few strongly imbalanced classes, eg the smallest class is about 54 times smaller than the largest. Therefore, data augmentation in order to equalize the size of classes ...
8
votes
1answer
3k views

Why doesn't class weight resolve the imbalanced classification problem?

I know that in imbalanced classification, the classifier tends to predict all the test labels as larger class label, but if we use class weight in loss function, it would be reasonable to expect the ...
8
votes
4answers
10k views

How to apply class weight to a multi-output model?

I have a model with 2 categorical outputs. The first output layer can predict 2 classes: [0, 1] and the second output layer can predict 3 classes: [0, 1, 2]. How can I apply different class weight ...
8
votes
4answers
5k views

Unbalanced class: class_weight for ML algorithms in Spark MLLib

In python sklearn, there are multiple algorithms (e.g. regression, random forest ... etc.) that have the class_weight parameter to handle unbalanced data. However, I do not find such parameter for ...
6
votes
1answer
12k views

Machine learning technique to calculate weighted average weights?

I'm just starting to investigate machine learning concepts, so I'm sorry if this question is very naive, but I'm hoping that it will be an easy one to answer! I have a document matching algorithm ...
6
votes
3answers
4k views

using sklearn class weight to increase number of positive guesses in extremely unbalanced data set?

Hi I have a poorly correlated and unbalanced data set I have to work with. The set is 2 classes, 0 has 96,000 values and 1 has about 200. When I run random forest or other methods I get an output like:...
5
votes
1answer
2k views

Purpose of weights in neural networks

I'm beginner at Neural Networks. After reading multiple articles on wikipedia, i've seen the term "weight" being used a lot, although it is a little confusing. I know, that before the inputs are ...
5
votes
2answers
616 views

How to use class_weight parameter for validation set?

I am using Keras' class_weight parameter to deal with an imbalanced class problem. I am doing this to define the weights : ...
4
votes
1answer
83 views

Range to define emotions

We are capturing emotions as survey responses. We need to assign values for the responses(emotions) for analysis purposes. Is there an optimum range that can be assigned to achieve this? (like from -...
4
votes
1answer
790 views

Sklearn Linear Regression examples

Could someone give an example of the application of Tf-idf with sparse data (lots of zeros) in sklearn? I am not quite sure where to insert the weight of Tf-idf and how to rightly obtain the weight. ...
3
votes
2answers
2k views

How can give weight to feature before PCA

I wonder how can I give weight to my feature before employing PCA. I mean somehow weighted PCA. Because I know that one of the features is better than others and want to give importance to it in ...
3
votes
1answer
2k views

How can the process of hypertuning of XGBoost parameters be automated?

I'm using xgboost for training a model on a data with extreme class imbalance. After referring from here. After performing grid search and some manual settings, I ...
3
votes
2answers
37 views

Understanding Weighted learning in Ensemble Classifiers

I'm currently studying Boosting techniques in Machine Learning and I happened to understand that in Algorithms like Adaboost, each of the training samples is given a weight depending on whether it was ...
3
votes
1answer
466 views

Weighted loss functions vs weighted sampling?

For image classification tasks, is there a practical difference between using weighted loss functions vs. using weighted sampling? (I would appreciate theoretical arguments, experience or published ...
2
votes
2answers
250 views

Sort by average votes/ratings

I have a data set that's a dictionary of tuples. Each key represents an ID number and each tuple is (yesvotes, totalvotes). Example: ...
2
votes
2answers
142 views

Creating validation data for model comparison

I am working on building a scoring algorithm for student data, say the attributes are : name, location, age, class, school_name, skill1, skill2, skill3 based ...
2
votes
1answer
9k views

How to set class-weight for imbalanced classes in KerasClassifier while it is used inside the GridSearchCV?

Could you please let me know how to set class-weight for imbalanced classes in KerasClassifier while it is used inside the ...
2
votes
2answers
722 views

emphasise some observation weights more than the others

I want to emphasise (increase the weight) of only a subset of data. Lets say I have old and fresh data, I would like to say that old data has to have more weight and therefore has more influence in ...
2
votes
0answers
490 views

XGBoost predicting everything as null when sample weights are passed

I am trying to build an Uplift model using observational data. The data is consists of collections calls to customers and my objective is to predict the incremental probability due to the treatment (...
2
votes
1answer
70 views

Training a model where each response in the observation data has a different known varience

I have a dataset where each response variable is the number of successes of N Bernoulli trials with N and p (the probability of success) being different for each observation. The goal is to train a ...
2
votes
1answer
700 views

Calculate weighted mean for two columns and hundreds of rows?

I'm trying to teach myself basics of R and I couldn't find the answer: Say, I have a csv file and I want to calculate weighted mean for each subject such that I have a mean mu = 0.015*1030+0.16*26930+...
1
vote
1answer
28 views

Reducing (Variance) | the gap between my weights

I have ML ready samples. And each sample has a weight. The weights distribute between [0-1] My problem arise because there are a lot of samples which are ...
1
vote
1answer
21 views

Integer encoding and weighing when one feature consists of more names [closed]

Hello I am trying to make a content based movie recommendation system and one feature is genre of the movie. I will give an integer number to each genre randomly. However, some movies are of more than ...
1
vote
1answer
27 views

On assiging weights for unbalanced classes

Consider a dataset that will be split into train and test. The model will be learned using the train set and evaluated using the unseen test set. Now the dataset is unbalanced -- it contains more ...
1
vote
1answer
597 views

How are weights calculated in a feed-forward neural network before they are summed up with bias?

I have read a lot of papers and watched different videos, it seems like they explain how they are summed up with bias before entering the activation function. What I am trying to understand is the ...
1
vote
1answer
33 views

Specifying class or sample weights in Keras for one-hot encoded labels in a TF Dataset

I am trying to train an image classifier on an unbalanced training set. In order to cope with the class imbalance, I want either to weight the classes or the individual samples. Weighting the classes ...
1
vote
0answers
13 views

Class weights in RSNSS package?

New to ML in general and have been Googling on this. I am working on a dataset that will rate each customer features to a credit worthiness class attribute. Is it possible to add class weights in the '...
1
vote
1answer
79 views

Assign more importance to recent records during training

My goal is to build a classification model in order to predict if a customer will buy a product or not (binary classification). Since in the last months (let's say 3-4) I know that the advertising of ...
1
vote
0answers
14 views

Non-monotone missing data, and inverse probability weighting

I'm having difficulty identifying whether or not my missing data pattern is 'monotone'. I have two variables with missing data, and the missing data patterns in each variable do not completely ...
1
vote
1answer
46 views

Heterogeneous clustering with text data

I have a dataset which consists of multiple user ratings. Each rating looks similarly to: ...
1
vote
0answers
147 views

Grouping by 2 Columns in R to Sum, Count, Percentage, Weighted mean, mode [closed]

I am trying to use dplyr or data.table to calculate sums, percentages, counts, and weighted means for various sub groups. Each Name can have subgroups High Medium and low, and potentially others, and ...
1
vote
1answer
171 views

Counting Number of Parameters in Neural Networks [closed]

Note: This is an academics based problem. So in a recent in-class quiz, we were asked that if we have an input layer consisting of 20 nodes along with 2 hidden layers (one of size 10 and the other of ...
1
vote
0answers
246 views

How to weight loss in regression

I've got a regression problem where a model is required to predict a value in the range [0, 1]. I've tried to look at the distribution of the data and and it seems that there are more examples with ...
0
votes
2answers
36 views

Do we have any method which handles the imbalanced classification with sample weighting instead of class weighting?

I am looking for methods that use sample weighting instead of class weighting for the imbalanced classification. I think sample weighting is more precise than weighting all the samples from one class ...
0
votes
1answer
65 views

Differentiating roadmap of a loss function

Let's say I'm performing Stochastic Gradient Descent (SGD) on binary cross entropy error while optimizing weight $w_{2}$. Binary cross entropy error: $$L(y|p(x_{i}))=-y_{i}*ln(p(x_{i}))-(1-y_{i})*...
0
votes
3answers
4k views

@RISK Vs R. Monte Carlo simulation in R?

Are there any cheaper or open source alternatives to @RISK or are there packages for R that would be able to perform the same tasks? http://www.palisade.com/risk/ @RISK (pronounced “at risk”) ...
0
votes
1answer
69 views

How to interpret the sample_weight parameter in MiniBatchKMeans?

I am using scikit-learn MiniBatchKMeans to do text clustering. In the fit() function there is a parameter sample_weight described as follows: The weights for each ...
0
votes
1answer
117 views

How and where to set weights in case of imbalanced cost sensitive learning in machine learning?

I confront with a binary classification machine learning task which is both slightly imbalanced and cost sensitive. I wonder what (and where in the modeling pipeline, say, in sklearn) is the best way ...
0
votes
1answer
42 views

Closed form of Weighted Ordinary Least Squares calculation of the trend line

I would like to know if there is a closed form version of this equation: $\beta = \frac{n\sum{xy}-\sum{x}\sum{y}}{n\sum{x^2}-(\sum{x})^2}$ But for weighted data, where the weight $w_i$ is the value ...
0
votes
1answer
123 views

How to generate 12 independent random weights which all add up to one

I'm using Palisade's @Risk software with a triangular distribution to generate 12 random weights which must add up to one, but I get a lot of negative numbers. Is there a straightforward way to set ...
0
votes
2answers
634 views

Calculate feature weight vector for one-hot-encoded data frame in R

I have the following data frame with one categorical and two numerical columns: V1 V2 V3 1 A 1 3 2 A 3 5 3 B 3 3 4 C 2 3 I have ...
0
votes
0answers
12 views

target encoding and weighting

I am working on a project in which I use data of movies and I represent each movie as a vector of length of 15. So there are 15 features ranging from genre to director. Most of the features are ...
0
votes
0answers
7 views

Qunatify total time saved by prioritizing tasks based on the failure rate probability of each task

I am trying to solve a problem where I am trying to prioritize the tasks in a job based on the failure rates of each task. For ex: ...
0
votes
0answers
20 views

Weighted accuracy, sensitivity and specificity

I have a confusion matrix TN= 27 FP=20 FN =11 TP=6 I want to calculate the weighted average for accuracy, sensitivity and specificity. I know the equation but unsure how to do the weighted averages.
0
votes
0answers
4 views

Vector dimensionality seems to be implemented incorrectly

I'm trying to implement a fuzzy topic modeling approach in Python based on a paper, which is accommodated with an R implementation from GitHub. In one of the first steps a document term matrix is ...
0
votes
0answers
11 views

Can a term weighting function used in text retrieval be compared to one used in text classification?

I came up with a modified version of TF-IDF function for text retrieval task. I want to do retrieval experiments using Vector Space Model and compare my function to some of those proposed in the ...
0
votes
1answer
28 views

Methods of disaggregating data to smaller units?

I have a relatively straightforward question that I know poses some difficult challenges. Let's say I have a state-level rate of X. I would like to disaggregate the state-level rate to the county-...