Skip to content

Commit

Permalink
Merge 8d6f119 into c9805b4
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdoc committed Aug 10, 2015
2 parents c9805b4 + 8d6f119 commit 91f6a39
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
13 changes: 7 additions & 6 deletions duecredit/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ def __init__(self, entry, description=None, path=None, version=None,
core packages whenever it is reasonable to assume that its import constitute
its use (e.g. numpy)
tags: list of str, optional
Add tags for the reference for this method. Some tags have associated
semantics in duecredit, e.g.
Tags to associate with the given code/reference combination. Some tags have
associated semantics in duecredit, e.g.
- "implementation" [default] tag describes as an implementation of the cited
method
- "reference" tag describes as the original implementation of
the cited method
method
- "reference-implementation" tag describes as the original implementation (ideally
by the authors of the paper) of the cited method
- "another-implementation" tag describes some other implementation of the method
- "use" tag points to publications demonstrating a worthwhile noting use
the method
the method
- "edu" references to tutorials, textbooks and other materials useful to learn
more
- "donate" should be commonly used with Url entries to point to the websites
Expand Down
44 changes: 43 additions & 1 deletion duecredit/injections/mod_sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"""Automatic injection of bibliography entries for numpy module
"""

from ..entries import Doi, BibTeX
from ..entries import Doi, BibTeX, Url

# If defined, would determine from which to which version of the corresponding
# module to care about
Expand All @@ -32,3 +32,45 @@ def inject(injector):
publisher={JMLR. org}
}
"""), description="Machine Learning library")

# sklearn.cluster.affinity_propagation_
injector.add('sklearn.cluster.affinity_propagation_', None, Doi('10.1126/science.1136800'),
description="Affinity propagation clustering algorithm", tags=['implementation'])

# sklearn.cluster.bicluster
injector.add('sklearn.cluster.bicluster', 'SpectralCoclustering', Doi('10.1.1.140.301'),
description="Spectral Coclustering algorithm", tags=['implementation'])
injector.add('sklearn.cluster.bicluster', 'SpectralBiclustering', Doi('10.1.1.135.1608'),
description="Spectral Biclustering algorithm", tags=['implementation'])

# sklearn.cluster.birch
injector.add('sklearn.cluster.birch', 'Birch', Doi('10.1145/233269.233324'),
description="BIRCH clustering algorithm", tags=['implementation'])
injector.add('sklearn.cluster.birch', 'Birch', Url('https://code.google.com/p/jbirch/'),
description="Java implementation of BIRCH clustering algorithm", tags=['another-implementation'])

# sklearn.cluster.dbscan_
injector.add('sklearn.cluster.dbscan_', 'dbscan',
BibTeX("""@inproceedings{ester1996density,
title={A density-based algorithm for discovering clusters in large spatial databases with noise.},
author={Ester, Martin and Kriegel, Hans-Peter and Sander, J{\"o}rg and Xu, Xiaowei},
booktitle={Kdd},
volume={96},
number={34},
pages={226--231},
year={1996}
}"""), description="dbscan clustering algorithm", tags=['implementation'])

# sklearn.cluster.mean_shift_
injector.add('sklearn.cluster.mean_shift_', 'MeanShift', Doi('10.1109/34.1000236'),
description="Mean shift clustering algorithm", tags=['implementation'])

# sklearn.cluster.spectral
injector.add('sklearn.cluster.spectral', 'discretize', Doi('10.1109/ICCV.2003.1238361'),
description="Multiclass spectral clustering", tags=['reference'])
injector.add('sklearn.cluster.spectral', 'spectral_clustering', Doi('10.1.1.160.2324'),
description="Spectral clustering", tags=['implementation'])
injector.add('sklearn.cluster.spectral', 'spectral_clustering', Doi('10.1.1.165.9323'),
description="Spectral clustering", tags=['implementation'])


2 changes: 1 addition & 1 deletion duecredit/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def dump(self, tags=None):

# TODO: all that configuration/options should be done outside
if not tags:
tags = os.environ.get('DUECREDIT_REPORT_TAGS', 'reference,implementation').split(',')
tags = os.environ.get('DUECREDIT_REPORT_TAGS', 'reference-implementation,implementation').split(',')
tags = set(tags)

citations = self.collector.citations
Expand Down

0 comments on commit 91f6a39

Please sign in to comment.