-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decomoposing and code improvement #50
Conversation
2. Tests and other files changed appropriately. 3. Small fix in pyproject.toml.
Networks: decomposing, code improvement; Tests: Update because of new soft structure; New test for models without pickle path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update tutorials files also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update docs, by changing the auto-generated API section.
You can find an instruction on updating documentation here:
https://bamt.readthedocs.io/en/latest/getting_started/contribution.html
bamt/builders.py
Outdated
if type in ['disc_num', 'disc']: | ||
Node = nodes.DiscreteNode(name=vertex) | ||
node = discrete_node.DiscreteNode(name=vertex) | ||
elif type == 'cont': | ||
Node = nodes.GaussianNode(name=vertex, regressor=regressor) | ||
node = gaussian_node.GaussianNode(name=vertex, regressor=regressor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Возможно, вот эту часть стоит переработать в виде Factory.
bamt/networks/base.py
Outdated
@@ -170,7 +169,7 @@ def calculate_weights(self, discretized_data: pd.DataFrame): | |||
""" | |||
import bamt.utils.GraphUtils as gru | |||
if not all([i in ['disc', 'disc_num'] | |||
for i in gru.nodes_types(discretized_data).values()]): | |||
for i in gru.nodes_types(discretized_data).values()]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для большей читаемости лучше gru.nodes_types(discretized_data).values() вынести в переменную.
И переработать в all([node_type in discrete_types for node_type in nodes_types])
Можно в целом вынести такую проверку в функцию вроде is_discrete - явно где-то ещё может понадобится.
Networks and nodes
Classes were separated into files
Test for models implemented.