Skip to content

Commit

Permalink
Remove SCCL from repo
Browse files Browse the repository at this point in the history
  • Loading branch information
viswavi committed Oct 26, 2023
1 parent 23647dd commit 4f9637a
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 270 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ pip install active-semi-supervised-clustering

```python
from sklearn import datasets, metrics
from active_semi_clustering.semi_supervised.pairwise_constraints import PCKMeans
from active_semi_clustering.active.pairwise_constraints import ExampleOracle, ExploreConsolidate, MinMax
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.semi_supervised.pairwise_constraints import PCKMeans
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.active.pairwise_constraints import ExampleOracle, ExploreConsolidate, MinMax
```

```python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from .example_oracle import MaximumQueriesExceeded
from .explore_consolidate import ExploreConsolidate
from active_semi_clustering.semi_supervised.labeled_data.kmeans import KMeans
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.semi_supervised.labeled_data.kmeans import KMeans

class MinMaxFinetune(ExploreConsolidate):
def set_initial_clusterer(self, initial_clusterer):
Expand Down
2 changes: 1 addition & 1 deletion active_semi_clustering/active/pairwise_constraints/npu.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from sklearn.ensemble import RandomForestClassifier

from .example_oracle import MaximumQueriesExceeded
from active_semi_clustering.exceptions import EmptyClustersException
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.exceptions import EmptyClustersException


class NPU:
Expand Down
4 changes: 2 additions & 2 deletions active_semi_clustering/semi_supervised/labeled_data/dec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

from active_semi_clustering.exceptions import EmptyClustersException
from active_semi_clustering.semi_supervised.labeled_data.kmeans import KMeans
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.exceptions import EmptyClustersException
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.semi_supervised.labeled_data.kmeans import KMeans

from collections import namedtuple
import numpy as np
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from active_semi_clustering.exceptions import EmptyClustersException
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.exceptions import EmptyClustersException
import math
import numpy as np
from ortools.linear_solver import pywraplp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
from .mpckmeansmf import MPCKMeansMF
from .mkmeans import MKMeans
from .rcakmeans import RCAKMeans
from .sccl import SCCL, DeepSCCL
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from ortools.linear_solver import pywraplp
import time

from active_semi_clustering.semi_supervised.pairwise_constraints.pckmeans import PCKMeans
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.semi_supervised.pairwise_constraints.pckmeans import PCKMeans

import sys
sys.path.append("cmvc")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from tqdm import tqdm

from active_semi_clustering.exceptions import InconsistentConstraintsException
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.exceptions import InconsistentConstraintsException

# Taken from https://github.com/Behrouz-Babaki/COP-Kmeans/blob/master/copkmeans/cop_kmeans.py
def preprocess_constraints(ml, cl, n):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from active_semi_clustering.exceptions import EmptyClustersException, ClusteringNotFoundException
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.exceptions import EmptyClustersException, ClusteringNotFoundException
from .constraints import preprocess_constraints


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
from tqdm import tqdm


from active_semi_clustering.exceptions import EmptyClustersException
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.exceptions import EmptyClustersException
from .constraints import preprocess_constraints
from active_semi_clustering.semi_supervised.labeled_data.kmeans import KMeans
from active_semi_clustering.semi_supervised.pairwise_constraints.pckmeans import PCKMeans
from active_semi_clustering.semi_supervised.pairwise_constraints.gptclustering_prompts import select_keyphrase_expansion_prompt
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.semi_supervised.labeled_data.kmeans import KMeans
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.semi_supervised.pairwise_constraints.pckmeans import PCKMeans
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.semi_supervised.pairwise_constraints.gptclustering_prompts import select_keyphrase_expansion_prompt
from InstructorEmbedding import INSTRUCTOR
from sentence_transformers import SentenceTransformer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from sklearn.preprocessing import normalize
from tqdm import tqdm

from active_semi_clustering.active.pairwise_constraints import ExampleOracle
from active_semi_clustering.active.pairwise_constraints.example_oracle import MaximumQueriesExceeded
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.active.pairwise_constraints import ExampleOracle
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.active.pairwise_constraints.example_oracle import MaximumQueriesExceeded

class KMeansCorrection:
def __init__(self, oracle, cluster_predictions, cluster_centers, labels):
Expand Down Expand Up @@ -179,7 +179,7 @@ def fit(self, X, num_corrections):
print(f"Num Correct Corrections: {num_correct_corrections_made}")

'''
from active_semi_clustering.active.pairwise_constraints import ExampleOracle
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.active.pairwise_constraints import ExampleOracle
oracle = ExampleOracle(labels, max_queries_cnt=100000)
from dataloaders import load_dataset, generate_synthetic_data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import numpy as np
import scipy

from active_semi_clustering.exceptions import EmptyClustersException
from active_semi_clustering.farthest_first_traversal import weighted_farthest_first_traversal
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.exceptions import EmptyClustersException
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.farthest_first_traversal import weighted_farthest_first_traversal
from .constraints import preprocess_constraints

np.seterr('raise')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import numpy as np
import scipy

from active_semi_clustering.exceptions import EmptyClustersException
from active_semi_clustering.farthest_first_traversal import weighted_farthest_first_traversal
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.exceptions import EmptyClustersException
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.farthest_first_traversal import weighted_farthest_first_traversal
from .constraints import preprocess_constraints


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from sklearn.metrics.pairwise import euclidean_distances
import time

from active_semi_clustering.exceptions import EmptyClustersException
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.exceptions import EmptyClustersException
from .constraints import preprocess_constraints, preprocess_constraints_no_transitive_closure
from active_semi_clustering.semi_supervised.labeled_data.kmeans import KMeans
from few_shot_clustering.active_semi_supervised_clustering.active_semi_clustering.semi_supervised.labeled_data.kmeans import KMeans

import sys
sys.path.append("cmvc")
Expand Down
244 changes: 0 additions & 244 deletions active_semi_clustering/semi_supervised/pairwise_constraints/sccl.py

This file was deleted.

Loading

0 comments on commit 4f9637a

Please sign in to comment.