Skip to content

added sub components to bias components - #35

Open
surbhir08 wants to merge 3 commits into
mainfrom
bias_new_components
Open

added sub components to bias components#35
surbhir08 wants to merge 3 commits into
mainfrom
bias_new_components

Conversation

@surbhir08

Copy link
Copy Markdown

No description provided.

@brownsarahm brownsarahm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs a few small changes (I have not yet run it though)

Comment thread mlsim/bias/bias_components.py Outdated
Comment on lines +327 to +340
'''
sample P(X|A) using distribution and parameters initialized for
a.

Parameters
----------
a : list-like length n
demographic variables

Returns
--------
x : list like, length n
featuers, same shape as a
'''

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to the function, not the class

Comment thread mlsim/bias/bias_components.py Outdated
Comment thread mlsim/bias/bias_components.py Outdated
x = np.asarray(x)

return x
######

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remvoe these lines

Comment thread mlsim/bias/bias_components.py Outdated

############

class FeatureConditionerA(Feature):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conditioners should not inherit fromFeature, they should have only the sample method

Comment thread mlsim/bias/bias_components.py Outdated

mvn = lambda mu,var :np.random.multivariate_normal(mu,var*np.eye(len(mu)))

class FeatureSharedParam(Feature):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the parameter mixins won't inherit from Feature anymore either, they should have only a constructor.

surbhir08 and others added 2 commits July 30, 2026 21:39
@surbhir08

Copy link
Copy Markdown
Author

needs a few small changes (I have not yet run it though)

correction done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants