getAttrWeights: Weights calculating function

Description Usage Arguments Details Value Examples

Description

This function gives you an interface to all weight calculating functions in this package. The different methods and functions are: weight.differenceToIdeal, weight.entropy, weight.differenceToIdeal, weight.highAndStandard, weight.standard. You also have the ability to enter your own weights for each userid. This can be done through a list with the exacht same length as the number of users you input. If you want to use the same weight vector for all users you can enter it as a numeric vector, ideally with length(weight) == length(attr).

Usage

1
2
3
getAttrWeights(dataset = NULL, userid = NULL, weight = NULL,
  attr = NULL, rounds = NULL, cost_ids = NULL,
  weightFUN = "differenceToIdeal", gamma = 0.5)

Arguments

dataset

data.frame with the user generated data from a product configurator. See decisionMatrix for specifications of the dataset.

userid

a vector of integers that gives the information of which users the matrix should be calculated. Vectorised.

weight

numeric vector. Represents the importance or relevance that an attribute has and the weight it should have in the calculation of the prospect value. Alternatively, you can enter a list of numeric vectors, each element of the list corresponding to one user in userid.

attr

attributes IDs, vector of integer numbers corresponding to the attributes you desire to use; attr are assumed to be 1-indexed. This function will calculate with all attributes and do the subsetting a posteriori.

If you want to get the weights for only two attributes you will have to first use decisionMatrix and then pass it on to normalize.altMethod and differenceToIdeal.

rounds

integer vector or text option. Which steps of the configuration process should be taken into account? Defaults are "all" in order to have more data to calculate with. If "first" or "last" are entered there will be only one rounds to gather data from, consequently all attribtues will have the same weight.

cost_ids

argument used to convert selected cost attributes into benefit attributes. Integer vector.

weightFUN

indicated which weight function should be used to calculate the weight vector, the options are "differenceToIdeal", "entropy", "highAndStandard", "standard". Default ist differencetoIdeal.

gamma

numeric and between 0 and 1. It is a parameter used for the function weight.highAndStandard and highAndStandard, please the former to know its use.

Details

The function is vectorised on userid. If you decide to enter your own weights, and not calculating them, note that the function accepts a weight vector with negative values and not adding up to 1. It is up to the user to check if that makes sense.

Lastly, this function is called from within overallPV and as in that function, the attr parameter does not sort its input, so check that if and when inputting your weights they correspond to the order you entered the attributes.

Default value of FUN uses differenceToIdeal to get the weight vector.

attr This function does handles different amount of attributes.

cost_ids Are passed along to the function you chosee, not directly handled here.

If you want to know more about the other parameters, look at decisionMatrix.

Value

Calculated weights according to the chosen weight function

Examples

1
2
3
4
5
6
#Not Runnable yet
getAttrWeights(pc_data, 11)
getAttrWeights(myData, 11, weightFUN = "entropy")
getAttrWeights(my_data, userid = 10:10, attr=1:3, cost_ids = 3)
getAttrWeights(monitor_data, 50, rounds="all", weightFUN="highAndStandard", gamma=0.8)
getAttrWeights(myData, userid = 9, attr= 1:5, weight=c(0.20, 0.10, 0.05, 0.40, 0.25))

avilesd/productConfig documentation built on May 11, 2019, 4:08 p.m.