Skip to content

Commit

Permalink
feat: refactor verbosity & update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonjr committed Jun 8, 2023
1 parent b044d88 commit ee0e576
Show file tree
Hide file tree
Showing 10 changed files with 1,120 additions and 2,601 deletions.
20 changes: 13 additions & 7 deletions humap/humap.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
import numpy as np

from scipy.optimize import curve_fit

from sklearn.utils import check_array

import logging

class HUMAP(object):
"""
Class for wrapping the pybind11 interface of HUMAP C++ implementation
Expand All @@ -34,19 +35,24 @@ class HUMAP(object):
* FLANN (Python instalation required)
init (str): (optional, default 'Spectral')
init (str): (optional, default 'Random')
Initialization method for the low dimensional embedding. Options include:
* Spectral
* Spectral
* random
reproducible (bool): (optional, default 'False')
If the results among different runs need to be reproducible. It affects the runtime execution.
verbose (bool): (optional, default True)
verbose (bool): (optional, default False)
Controls logging.
"""
def __init__(self, levels=np.array([0.2, 0.2]), n_neighbors=100, min_dist=0.15, knn_algorithm='NNDescent', init="Random", verbose=True, reproducible=False):
def __init__(self, levels=np.array([0.2, 0.2]), n_neighbors=100, min_dist=0.15, knn_algorithm='NNDescent', init="Random", verbose=False, reproducible=False):

if init != 'Random':
logging.warn("Sorry, only Random initialization is available at this time.")
init = 'Random'

self.levels = levels
self.n_levels = len(levels)+1
self.n_neighbors = n_neighbors
Expand Down Expand Up @@ -358,11 +364,11 @@ class UMAP(HUMAP):
* Spectral
* random
verbose (bool): (optional, default True)
verbose (bool): (optional, default False)
Controls logging.
"""
def __init__(self, n_neighbors=100, min_dist=0.15, knn_algorithm='NNDescent', init="Spectral", verbose=True, reproducible=False):
def __init__(self, n_neighbors=100, min_dist=0.15, knn_algorithm='NNDescent', init="Spectral", verbose=False, reproducible=False):
super().__init__(np.array([]), n_neighbors, min_dist, knn_algorithm, init, verbose, reproducible)

def fit_transform(self, X):
Expand Down
266 changes: 0 additions & 266 deletions notebooks/Generating UMAP projections.ipynb

This file was deleted.

740 changes: 0 additions & 740 deletions notebooks/Hierarchical-Exploration-with-HUMAP.ipynb

This file was deleted.

Loading

0 comments on commit ee0e576

Please sign in to comment.