class_docstr: Test behaviour of the from_numpy_lasso method
docstr: Poisson structure learned should have good f1 score
docstr_tok: ["Poisson","structure","learned","should","have","good","f1","score"]
code: def test_f1score_generated_poisson(self):
      """Poisson structure learned should have good f1 score"""
      np.random.seed(10)
      sm = generate_structure(5, 3.0)
      df = generate_count_dataframe(
          sm, 1000, intercept=False, zero_inflation_factor=0.0, seed=10
      )
      df = np.asarray(df)
  
      dist_type_schema = {i: "poiss" for i in range(df.shape[1])}
      sm_fitted = from_numpy(
          df,
          dist_type_schema=dist_type_schema,
          lasso_beta=0.1,
          ridge_beta=0.0,
          w_threshold=0.1,
          use_bias=False,
      )
  
      right_edges = sm.edges
      n_predictions_made = len(sm_fitted.edges)
      n_correct_predictions = len(
          set(sm_fitted.edges).intersection(set(right_edges))
      )
      n_relevant_predictions = len(right_edges)
  
      precision = n_correct_predictions / n_predictions_made
      recall = n_correct_predictions / n_relevant_predictions
      f1_score = 2 * (precision * recall) / (precision + recall)
  
      assert f1_score > 0.7
  
imports: import logging
  import networkx
  import numpy
  import pandas
  import pytest
  import scipy.optimize
  from mock import patch
  from causalnex.structure import StructureModel
  from causalnex.structure.data_generators import generate_binary_data, generate_binary_dataframe, generate_continuous_dataframe, generate_count_dataframe, generate_structure
  from causalnex.structure.pytorch.notears import from_numpy, from_pandas
label_desc: Use image node_id 20 for calling the TestFromNumpy obj's underlying member method code with example usage: obj.test_f1score_generated_poisson() without return types