GithubHelp home page GithubHelp logo

jacobf18 / active-semi-supervised-clustering Goto Github PK

View Code? Open in Web Editor NEW

This project forked from datamole-ai/active-semi-supervised-clustering

1.0 0.0 0.0 49 KB

Active semi-supervised clustering algorithms for scikit-learn with sample weights

Python 100.00%

active-semi-supervised-clustering's Introduction

active-semi-supervised-clustering

Active semi-supervised clustering algorithms for scikit-learn.

Algorithms

Semi-supervised clustering

  • Seeded-KMeans
  • Constrainted-KMeans
  • COP-KMeans
  • Pairwise constrained K-Means (PCK-Means)
  • Metric K-Means (MK-Means)
  • Metric pairwise constrained K-Means (MPCK-Means)

Active learning of pairwise clustering

  • Explore & Consolidate
  • Min-max
  • Normalized point-based uncertainty (NPU) method

Installation

pip install active-semi-supervised-clustering

Usage

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
X, y = datasets.load_iris(return_X_y=True)

First, obtain some pairwise constraints from an oracle.

# TODO implement your own oracle that will, for example, query a domain expert via GUI or CLI
oracle = ExampleOracle(y, max_queries_cnt=10)

active_learner = MinMax(n_clusters=3)
active_learner.fit(X, oracle=oracle)
pairwise_constraints = active_learner.pairwise_constraints_

Then, use the constraints to do the clustering.

clusterer = PCKMeans(n_clusters=3)
clusterer.fit(X, ml=pairwise_constraints[0], cl=pairwise_constraints[1])

Evaluate the clustering using Adjusted Rand Score.

metrics.adjusted_rand_score(y, clusterer.labels_)

active-semi-supervised-clustering's People

Contributors

jakubsvehla avatar

Stargazers

Jacob Feitelberg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.