Questions tagged [weighted]

questions about problems that use a weight function, e.g. weighted mean, weighted sampling

A weight function is a mathematical device used when performing a sum, integral, or average to give some elements more "weight" or influence on the result than other elements in the same set. The result of this application of a weight function is a weighted sum or weighted average.

Weight functions occur frequently in statistics and analysis, and are closely related to the concept of a measure. Weight functions can be employed in both discrete and continuous settings.

615 questions
0
votes
1 answer

Spreading one matrix elements to another with weighted random numbers MATLAB

So I was trying to spread one matrix elements, which were generated with poissrnd, to another with using some bigger (wider?) probability function (for example 100 different possibilities with different weights) to plot both of them and see if the…
Warner
  • 23
  • 3
0
votes
1 answer

Prove that the Weighted Feedback Vertex Set is NP-Complete

I need to show that the Weighted Feedback Vertex Set (WFVS) is NP-Complete. How do I do this, I got confused. I'm not sure how to do this. Thanks! :)
0
votes
1 answer

Implementing a weighted BFS to find shortest path

I'm using an adjacency list and my addEdge function looks like this: void Graph::addEdge(int start, int end, int weight) { adj[start].push_back(end); } Which would be fine except I need to know the weight of the edge. Just can't wrap my head…
user2963379
  • 155
  • 1
  • 12
0
votes
1 answer

Weighted Sampling with multiple probability vectors in R

I have a similar question like this: Weighted sampling with 2 vectors I now have a dataset which contains 1000 observations and 4 columns for each observation. I want to sample 200 observations from the original dataset with replacement. But the…
0
votes
0 answers

How can I call the number of all edges of my weighted graph in R?

I only found this code, but my graph is weighted: ecount(g) [1] 17468 Thank you in advance!
Übel Yildmar
  • 491
  • 1
  • 9
  • 24
0
votes
1 answer

Form with weighted answers

I need help creating a weighted form - which seems to means a lot of things to different people. Essentially, we want to walk a customer through a 20 question - questionnaire. A Question may have 2, 3, 4, or 5 answers in a radial button format,…
0
votes
0 answers

How to implement weighted data property in protege 4

I am implementing an ontology to check for semantic similarity between individuals of different classes of animals. Say Cow is exactly similar to Cow and nearly similar to buffalo/bull etc. but cow is not similar to dog. i have different data…
learner
  • 757
  • 2
  • 14
  • 35
0
votes
0 answers

WordPress query multiple post_types/categories with weighted results

For a WordPress project I'm looking for a better solution to this problem: The query should get a set of different post_types and taxonomies (like categories), based on the site visitors choice. For example, the user want to get results from normal…
0
votes
1 answer

Mathematical formulation of sklearn weighted classification tree

I'd like to weight each sample differently when growing a simple classification tree. I understand that you can specify a vector of sample weights when fitting the tree. I'd like to know, however, what the mathematical forumltion of the impurity…
0
votes
3 answers

Weighted random choice from a variable length text file

I have a series of text files of various (and often changing) lengths. The data stored in the file is in a particular order from most common (top) to least (bottom). I want to randomly select a line from the file weighted towards the top entries -…
Groundhog
  • 55
  • 1
  • 6
0
votes
0 answers

Setting edge thickness in igraph's tkplot using a weighted network

Fairly straightforward, I'm working with a lot of network data represented as adjacency matrices. I've been using R's igraph package with some success and I'm just trying to figure out a way to set the width of the edges in the tkplot output to…
Sue Doh Nimh
  • 165
  • 2
  • 7
0
votes
1 answer

SPSS Form questions weight

I have an issue with SPSS. I have a survey with about 20 questions, and about 40 people who answered it. I want to explain my 2nd question of the survey with the result of others. In fact, i want to extract the weight of each question regarding the…
Aloys Fortier
  • 21
  • 2
  • 7
0
votes
2 answers

Weighted Least Squares in R

My dataset is quite big so I'm just using 10 lines of data as an example (I've worked out the answer in excel but can't replicate it in R-as i need help with the…
0
votes
3 answers

weighted random for one value only

The following line returns a pair of coordinates coordinates = random.random()*640.0, random.random()*480.0 How to get a particular pair of coordinates for example (100.0, 100.0) with probability 0.03. Coordinates are generated in a loop, a number…
Olga
  • 982
  • 1
  • 11
  • 17
0
votes
0 answers

getting usable values from statsmodels WLS

I'm using statsmodels' weighted least squares regression, but getting some really huge values. Here's my code: X = np.array([[1,2,3],[1,2,3],[4,5,6],[1,2,3],[4,5,6],[1,2,3],[1,2,3],[4,5,6],[4,5,6],[1,2,3]]) y = np.array([1, 1, 0, 1, 0, 1, 1, 0, 0,…
user961627
  • 12,379
  • 42
  • 136
  • 210