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

null pointer exception weighted graph

I'm trying to write a form a Dijkstra’s algorithm, with the weight between two vertices the distance between a set of coordinates taken in from a file. It adds the Vertices fine but when it goes to add in the edges I'm getting a null pointer in my…
user3572515
  • 17
  • 1
  • 7
0
votes
1 answer

Retrieve random object from list based on probability

I have to retrieve a random object from a list based on the weights/probabilities of the objects. I've found different solutions to the problem, but I'd like to share another approach to know if it's a good one or how could it be improved. We should…
konpai
  • 101
  • 3
  • 12
0
votes
2 answers

How to show a weighted unidirect graph to a two dimensional array (in matrix form)?

Hi guys, trying to do a lab here, but I am unable to understand as to how you can show the nodes in the graph (left), in a three by three matrix (G, right). I'm not looking at how to print a matrix in java. It says: Here, the edge between each…
Adz
  • 2,809
  • 10
  • 43
  • 61
0
votes
1 answer

Optimizing weights for average across 3 variables

I am trying to create an ensemble of machine learning and I have code that made predictions based on occupation Ocp, Age Age, and Gender Gender. I want to average the 3 predictions for a final prediction, but I am not sure how I should optimize the…
user2492310
  • 89
  • 1
  • 8
0
votes
1 answer

Ranking/ weighing search result

I am trying to build an application that has a smart adaptive search engine (lets say for cars). If I search for for 4x4 then the DB will return all the 4x4 cars I have (100 cars) - but as time goes by and I start checking out cars, liking them,…
biso
  • 590
  • 1
  • 4
  • 13
0
votes
2 answers

Generating a large undirected weighted graph

A random large connected undirected graph in JAVA with 5K vertices and D density is to be generated. But generating an edge between random V1 and a random V2 is taking a lot of time. I tried eliminating a created edge from the list of all possible…
0
votes
1 answer

sql query to calculate weighted points

I have a database that stores forum posts with a grade of a, b, c. I want to assign 3 points for grade a, 2 points for grade b and 1 point for grade c and get the total points for all users. If the weight is even, I can use this query: select…
Purres
  • 1,271
  • 2
  • 11
  • 12
0
votes
1 answer

Creating a weighted score column from Pandas pivot table

I have the following pivot table in pandas: Rating 1 2 3 4 5 MovieTitle 1-900 (1994) 2 0 1 2 0 101 Dalmatians (1996) 15 17 46 25 6 12 Angry Men (1957) …
user2798444
  • 45
  • 1
  • 1
  • 5
0
votes
1 answer

Are my structs set up correctly for adding cities (vertices) to an undirected weighted graph to find shortest path?

Hello I've made a program to calculate the distances between two cities and now I want to use the data to map the cities on a undirected weighted graph. Then it will use Dikstra's Algorithm to find the shortest path. I'm trying out a adjacency list…
MeesterMarcus
  • 700
  • 1
  • 9
  • 25
0
votes
1 answer

How to use DWD R package in order to remove biases and merge two microarray datasets

I am trying to find a way to use distance weighted discrimination method (DWD) to remove biases from multiple microarray datasets. My starting point is this. The problem is that Matlab version runs only under Windows, needs excel 5 format as input…
gc5
  • 9,468
  • 24
  • 90
  • 151
0
votes
2 answers

How to find the maximum edge-weighted clique?

The maximum clique problem (MC-problem) is a classical NP problem, and we could use branch-bound to solve this problem effectively. Recently, I try to develop an algorithm to find out the clique that has the maximum edge-weighted clique in a graph,…
MinG
  • 57
  • 9
0
votes
2 answers

R - random numbers in a similar distribution to real numbers

This is a very simplified example but hopefully it gives everyone an idea what I'm talking about: real.length = c(10,11,12,13,13,13,13,14,15,50) random.length = vector() for (i in 1:length(real.length)){ random.length[i] =…
Jessica B
  • 321
  • 1
  • 4
  • 15
0
votes
1 answer

Minimal spanning tree using prim's algorithm, don't know what is wrong

First of all I'll state that I'm not asking for any code or complete solutions. I'll describe the problem: You are given number of rooms in a building and number of hallways between them. Every hallway connects 2 rooms and is given a weight. It is…
lcapkovic
  • 3
  • 2
0
votes
1 answer

Ontology Management Program supporting Weighted Relations between nodes

I am looking for ontology management services which can handle "bi-relation" for example, suppose that there are nodes "Tiger" and "Lion" We want to describe quantitive relation between the nodes : i.e) Similar("Tiger", "Lion") = 0.5 I have…
0
votes
4 answers

undirected weighted graph to xml

I want to represent an undirected graph, like this one : http://cnx.org/content/m29399/latest/Picture%202.png into an xml file. I'm not really sure how to begin. EDIT: I want the data in xml format, so I can reconstruct the graph using the…