Pipeline¶
Pipeline
¶
Pipeline(
trust_propagation: TrustPropagation = trust_propagation,
voting_rights: VotingRightsAssignment = voting_rights,
preference_learning: PreferenceLearning = preference_learning,
scaling: Scaling = scaling,
aggregation: Aggregation = aggregation,
post_process: PostProcess = post_process,
)
Instantiates the pipeline components.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
trust_propagation
|
TrustPropagation
|
Algorithm to spread trust based on pretrusts and vouches |
trust_propagation
|
voting_rights
|
VotingRightsAssignment
|
Algorithm to assign voting rights to each user |
voting_rights
|
preference_learning
|
PreferenceLearning
|
Algorithm to learn a user model based on each user's data |
preference_learning
|
scaling
|
Scaling
|
Algorithm to put user models on a common scale |
scaling
|
aggregation
|
Aggregation
|
Algorithm to aggregate the different users' models |
aggregation
|
post_process
|
PostProcess
|
Algorithm to post-process user and global models, and make it readily usable for applications. |
post_process
|
run
¶
Executes the pipeline with the given input and criterion.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
PipelineInput
|
The input data for the pipeline. |
required |
criterion
|
str
|
The criterion used for the pipeline execution. |
required |
output
|
Optional[PipelineOutput]
|
The output object to store results, by default None |
None
|
__call__
¶
__call__(
users: DataFrame,
vouches: DataFrame,
entities: DataFrame,
privacy: PrivacySettings,
judgments: Judgments,
init_user_models: Optional[
dict[int, ScoringModel]
] = None,
output: Optional[PipelineOutput] = None,
) -> tuple[
DataFrame,
VotingRights,
Mapping[int, ScoringModel],
ScoringModel,
]
Run Pipeline
Parameters:
Name | Type | Description | Default |
---|---|---|---|
users
|
DataFrame
|
|
required |
vouches
|
DataFrame
|
|
required |
entities
|
DataFrame
|
|
required |
privacy
|
PrivacySettings
|
privacy[user, entity] in { True, False, None } |
required |
judgments
|
Judgments
|
judgments[user] must yield the judgment data provided by the user |
required |
init_user_models
|
Optional[dict[int, ScoringModel]]
|
user_models[user] is the user's model |
None
|
Returns:
Name | Type | Description |
---|---|---|
users |
DataFrame with columns
|
|
voting_rights |
VotingRights
|
voting_rights[user, entity] is the user's voting right for entity |
user_models |
dict[int, ScoringModel]
|
user_models[user] is the user's model |
global_model |
ScoringModel
|
global model |
DefaultPipeline
¶
Instantiates the default pipeline described in "Solidago: A Modular Pipeline for Collaborative Scaling".
trust_propagation
¶
trust_propagation: TrustPropagation = LipschiTrust(
pretrust_value=0.8,
decay=0.8,
sink_vouch=5.0,
error=1e-08,
)
voting_rights
¶
voting_rights: VotingRightsAssignment = AffineOvertrust(
privacy_penalty=0.5,
min_overtrust=2.0,
overtrust_ratio=0.1,
)
preference_learning
¶
preference_learning: PreferenceLearning = UniformGBT(
prior_std_dev=7,
convergence_error=1e-05,
cumulant_generating_function_error=1e-05,
)
scaling
¶
scaling: Scaling = ScalingCompose(
Mehestan(
lipschitz=0.1,
min_activity=10.0,
n_scalers_max=100,
privacy_penalty=0.5,
p_norm_for_multiplicative_resilience=4.0,
error=1e-05,
),
QuantileZeroShift(
zero_quantile=0.15, lipschitz=0.1, error=1e-05
),
Standardize(
dev_quantile=0.9, lipschitz=0.1, error=1e-05
),
)
aggregation
¶
aggregation: Aggregation = EntitywiseQrQuantile(
quantile=0.2, lipschitz=0.1, error=1e-05
)