Skip to content

Umap generation failed for tanimoto count metric #11

@julianpollmann

Description

@julianpollmann

Umap generation with CPU for tanimoto_distance_unfolded_count fails:

data_plot = create_chem_space_umap(
    data_compounds,  # dataframe with smiles and class/subclass etc. information
    col_smiles="smiles",
    inplace=False,
    x_col="x",
    y_col="y",
    fpgen = rdFingerprintGenerator.GetMorganGenerator(radius=9, fpSize=4096),
)

Stacktrace:

UMAP.fit(self, X, y, ensure_all_finite, **kwargs)
   2554     _m = self.metric if self._sparse_data else self._input_distance_func
-> 2555     dmat = pairwise_distances(X[index], metric=_m, **self._metric_kwds)
   2556 except (ValueError, TypeError) as e:
   2557     # metric is numba.jit'd or not supported by sklearn,
   2558     # fallback to pairwise special
...
TypeError: not enough arguments: expected 4, got 2

During handling of the above exception, another exception occurred:
...
TypingError: Failed in nopython mode pipeline (step: nopython frontend)
non-precise type pyobject
During: typing of argument at /xxx/chemap/lib/python3.13/site-packages/umap/distances.py (1283)

File "xxx/chemap/lib/python3.13/site-packages/umap/distances.py", line 1283:
def pairwise_special_metric(
    <source elided>

        @numba.njit(fastmath=True)
        ^

During: Pass nopython_type_inference 

This error may have been caused by the following argument(s):
- argument 0: Cannot determine Numba type of <class 'scipy.sparse._csr.csr_matrix'>
- argument 1: Cannot determine Numba type of <class 'scipy.sparse._csr.csr_matrix'>

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