Skip to content

can't use jnk3 and gsk3b models to call oracle functions #372

@HEU2021201622

Description

@HEU2021201622

Describe the bug
now i'm using these model to get the ocacle scores. but i found that the size of current version model is 675B, it seems impossible to store a RF model and in fact , i can't use the model to predict because i met the problem "you need to call fit to get a trained model".

Then i try to use the older version models, but i can't get the right version of scikit-learn. do you have some advices?

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment:

  • OS:Linux
  • Python version:3.8.12
  • TDC version:0.4.1
  • Any other relevant information:

Additional context

ValueError Traceback (most recent call last)
Cell In[8], line 2
1 from tdc import Oracle
----> 2 oracle = Oracle(name = 'JNK3')
3 smi = "O=C([O-])C(CC1=c2cccc(O)c2=[NH+]C1)c1cccc(Br)c1"
4 oracle(smi)

File ~/miniconda3/envs/pmo/lib/python3.8/site-packages/tdc/oracles.py:67, in Oracle.init(self, name, target_smiles, num_max_call, **kwargs)
65 self.name = name
66 self.evaluator_func = None
---> 67 self.assign_evaluator()
68 self.num_called = 0
70 if num_max_call is not None:

File ~/miniconda3/envs/pmo/lib/python3.8/site-packages/tdc/oracles.py:109, in Oracle.assign_evaluator(self)
106 elif "jnk3" in self.name:
107 from .chem_utils import jnk3
--> 109 oracle_object = jnk3()
110 self.evaluator_func = oracle_object
111 elif self.name == "similarity_meta":

File ~/miniconda3/envs/pmo/lib/python3.8/site-packages/tdc/chem_utils/oracle/oracle.py:699, in jnk3.init(self)
697 if SKLEARN_VERSION >= version.parse("0.24.0"):
698 jnk3_model_path = "oracle/jnk3_current.pkl"
--> 699 self.jnk3_model = load_pickled_model(jnk3_model_path)

File ~/miniconda3/envs/pmo/lib/python3.8/site-packages/tdc/chem_utils/oracle/oracle.py:457, in load_pickled_model(name)
455 try:
456 with open(name, "rb") as f:
--> 457 model = pickle.load(f)
458 except EOFError:
459 import sys

File sklearn/tree/_tree.pyx:728, in sklearn.tree._tree.Tree.setstate()

File sklearn/tree/_tree.pyx:1434, in sklearn.tree._tree._check_node_ndarray()

ValueError: node array from the pickle has an incompatible dtype:

  • expected: {'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', 'n_node_samples', 'weighted_n_node_samples', 'missing_go_to_left'], 'formats': ['<i8', '<i8', '<i8', '<f8', '<f8', '<i8', '<f8', 'u1'], 'offsets': [0, 8, 16, 24, 32, 40, 48, 56], 'itemsize': 64}
  • got : [('left_child', '<i8'), ('right_child', '<i8'), ('feature', '<i8'), ('threshold', '<f8'), ('impurity', '<f8'), ('n_node_samples', '<i8'), ('weighted_n_node_samples', '<f8')]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions