Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
node_params.update({
node[0]: 'nice_node' if weights[node] >= 0 else 'bad_node',
})
node_weights.update({
node[0]: val
})
edge_cols = [i for i in test_sample.columns if len(i) == 2]
if len(edge_cols) == 0:
print("Sorry, you use only unigrams, change ngram_range to (1, 2) or greater")
return
data = []
for key in edge_cols:
data.append([key[0], key[1], weights.get(key)])
plot.graph(pd.DataFrame(data), node_params, node_weights=node_weights, is_model=True, **kwargs)
'norm': norm,
})
if node_params is None:
_node_params = {
'positive_target_event': 'nice_target',
'negative_target_event': 'bad_target',
'source_event': 'source',
}
node_params = {}
for key, val in _node_params.items():
name = self.retention_config.get(key)
if name is None:
continue
node_params.update({name: val})
node_weights = node_weights or self._obj[self._event_col()].value_counts().to_dict()
path = plot.graph(self._obj.trajectory.get_edgelist(**kwargs), node_params, node_weights=node_weights, **kwargs)
return path