Drivers (Brand Analysis)¶
Drivers Core¶
adele.modeling.drivers.core.DriversS3
¶
Drivers Single¶
adele.modeling.drivers.single.core.DriversSingle (DriversS3Data)
¶
Base class for a single driver estimation
Examples:
>>> from adele.modeling.drivers.single.core import DriversSingle
>>> ds = DriversSingle("dev")
>>> setattr(ds, "drivers_id", DriverId)
>>> setattr(ds, "job_id", JobId)
>>> ds.read_impact()
read_impact(self)
¶
Read impact scores from the drivers run
adele.modeling.drivers.single.estimation.core.DriversLoad (DriversSingle)
¶
Load the payload information and assign the attributes
data_stacked_filtered_T2B
property
readonly
¶
data_stacked filtered as specified by the model_payload's filter and only T2B columns
adele.modeling.drivers.single.estimation.aggregates.DriversAggregates (DriversLoad)
¶
Calculate aggregate statistics off the stacked data specific to the drivers run
Examples:
>>> from adele.modeling.drivers.job.payload_generator import DriversJobPayloadGenerator
>>> from adele.modeling.drivers.single.estimation.aggregates import DriversAggregates
>>> gen = DriversJobPayloadGenerator(JobId,"dev")
>>> DriverId = list(gen.all_payloads.keys())[10]
>>> _payload = gen.all_payloads[DriverId]
>>> aggregates = DriversAggregates("dev")
>>> setattr(aggregates, "payload", _payload)
>>> aggregates.retrieve_tables(["correlation_table",
"performance_table",
"brand_base_table",
"double_centered_table",
"subgroup_base_table"])
correlation_table
property
readonly
¶
Correlation Table
performance_table
property
readonly
¶
Performance Table
brand_base_table
property
readonly
¶
Base Table
double_centered_table
property
readonly
¶
Double centered table
subgroup_base_table
property
readonly
¶
Subgroup base
read_aggregates(self, which_tables)
¶
Specify which tables to retrieve
adele.modeling.drivers.single.estimation.impacts.DriversImpact (DriversLoad)
¶
Driver class for a single model
Examples:
>>> from adele.processing.stacking.process.core import StackerProcess
>>> from adele.modeling.drivers.job.payload_generator import DriversJobPayloadGenerator
>>> from adele.modeling.drivers.single.estimation.impacts import DriversImpact
>>> m = StackerProcess('dev','enctest', username, password)
>>> setattr(m, "payload", spec)
>>> m.stack()
>>> gen = DriversJobPayloadGenerator(JobId,"dev")
>>> for DriverId in list(gen.all_payloads.keys()):
print(DriverId)
_payload = gen.all_payloads[DriverId]
driver = DriversImpact(_payload, "dev")
driver.execute_impact()
execute_impact(self)
¶
Shortcut to get the right model to run and save results to S3
Drivers Job¶
adele.modeling.drivers.job.core.DriversJob (DriversS3Data)
¶
Create payloads for individual models based off stacked data/dictionary info
Examples:
>>> from adele.modeling.drivers.job.core import DriversJob
>>> JobId = '2805ff44-c710-4212-97de-4c6eed8db37c'
>>> job = DriversJob(JobId,"dev")
>>> job.poll_job()
adele.modeling.drivers.job.payload_generator.DriversJobPayloadGenerator (DriversJob)
¶
Create payloads for individual models based off stacked data/dictionary info
Examples:
>>> from adele.modeling.drivers.job.payload_generator import DriversJobPayloadGenerator
>>> JobId = '2805ff44-c710-4212-97de-4c6eed8db37c'
>>> gen = DriversJobPayloadGenerator(JobId,"dev")
>>> gen.all_payloads
read_payloads(self)
¶
Read payloads from S3 if they've been run already
generate_payloads(self)
¶
Wrapper for the internal methods
create_combos(self, fix_t2b=True)
¶
Create all combinations of IV/DV recodes, IVs, Dvs, Subgroups, Filters, Model Types and Estimators
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fix_t2b |
bool |
this will fix the performance and double centered table to top 2 box for all drivers runs |
True |
prepare_payloads_from_combos(self)
¶
Convert combos from dataframe to dictionary row-wise