本文整理了Java中de.lmu.ifi.dbs.elki.logging.Logging.getLogger()
方法的一些代码示例,展示了Logging.getLogger()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logging.getLogger()
方法的具体详情如下:
包路径:de.lmu.ifi.dbs.elki.logging.Logging
类名称:Logging
方法名:getLogger
[英]Retrieve logging utility for a particular class.
[中]检索特定类的日志记录实用程序。
代码示例来源:origin: elki-project/elki
/**
* Retrieve logging utility for a particular class.
*
* @param c Class to retrieve logging for
* @return Logger
*/
public static Logging getLogger(final Class<?> c) {
return getLogger(c.getName());
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-logging
/**
* Retrieve logging utility for a particular class.
*
* @param c Class to retrieve logging for
* @return Logger
*/
public static Logging getLogger(final Class<?> c) {
return getLogger(c.getName());
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki
/**
* Retrieve logging utility for a particular class.
*
* @param c Class to retrieve logging for
* @return Logger
*/
public static Logging getLogger(final Class<?> c) {
return getLogger(c.getName());
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki
/**
* Full constructor - all values.
*
* @param actualMinimum actual minimum
* @param actualMaximum actual maximum
* @param theoreticalMinimum theoretical minimum
* @param theoreticalMaximum theoretical maximum
* @param theoreticalBaseline theoretical baseline
*/
public BasicOutlierScoreMeta(double actualMinimum, double actualMaximum, double theoreticalMinimum, double theoreticalMaximum, double theoreticalBaseline) {
super();
if(Double.isNaN(actualMinimum) || Double.isNaN(actualMaximum)) {
Logging.getLogger(this.getClass()).warning("Warning: Outlier Score meta initalized with NaN values: " + actualMinimum + " - " + actualMaximum);
}
this.actualMinimum = actualMinimum;
this.actualMaximum = actualMaximum;
this.theoreticalMinimum = theoreticalMinimum;
this.theoreticalMaximum = theoreticalMaximum;
this.theoreticalBaseline = theoreticalBaseline;
}
代码示例来源:origin: elki-project/elki
/**
* Full constructor - all values.
*
* @param actualMinimum actual minimum
* @param actualMaximum actual maximum
* @param theoreticalMinimum theoretical minimum
* @param theoreticalMaximum theoretical maximum
* @param theoreticalBaseline theoretical baseline
*/
public BasicOutlierScoreMeta(double actualMinimum, double actualMaximum, double theoreticalMinimum, double theoreticalMaximum, double theoreticalBaseline) {
super();
if(Double.isNaN(actualMinimum) || Double.isNaN(actualMaximum)) {
Logging.getLogger(this.getClass()).warning("Warning: Outlier Score meta initalized with NaN values: " + actualMinimum + " - " + actualMaximum);
}
this.actualMinimum = actualMinimum;
this.actualMaximum = actualMaximum;
this.theoreticalMinimum = theoreticalMinimum;
this.theoreticalMaximum = theoreticalMaximum;
this.theoreticalBaseline = theoreticalBaseline;
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-outlier
/**
* Full constructor - all values.
*
* @param actualMinimum actual minimum
* @param actualMaximum actual maximum
* @param theoreticalMinimum theoretical minimum
* @param theoreticalMaximum theoretical maximum
* @param theoreticalBaseline theoretical baseline
*/
public BasicOutlierScoreMeta(double actualMinimum, double actualMaximum, double theoreticalMinimum, double theoreticalMaximum, double theoreticalBaseline) {
super();
if(Double.isNaN(actualMinimum) || Double.isNaN(actualMaximum)) {
Logging.getLogger(this.getClass()).warning("Warning: Outlier Score meta initalized with NaN values: " + actualMinimum + " - " + actualMaximum);
}
this.actualMinimum = actualMinimum;
this.actualMaximum = actualMaximum;
this.theoreticalMinimum = theoreticalMinimum;
this.theoreticalMaximum = theoreticalMaximum;
this.theoreticalBaseline = theoreticalBaseline;
}
代码示例来源:origin: elki-project/elki
/**
* Redistribute entries according to the given sorting.
*
* @param newNode Node to split to
* @param sorting Sorting to use
* @param splitPoint Split point
*/
public final void splitTo(AbstractNode<E> newNode, List<E> sorting, int splitPoint) {
assert (isLeaf() == newNode.isLeaf());
deleteAllEntries();
StringBuilder msg = LoggingConfiguration.DEBUG ? new StringBuilder(1000) : null;
for(int i = 0; i < splitPoint; i++) {
addEntry(sorting.get(i));
if(msg != null) {
msg.append("n_").append(getPageID()).append(' ').append(sorting.get(i)).append('\n');
}
}
for(int i = splitPoint; i < sorting.size(); i++) {
newNode.addEntry(sorting.get(i));
if(msg != null) {
msg.append("n_").append(newNode.getPageID()).append(' ').append(sorting.get(i)).append('\n');
}
}
if(msg != null) {
Logging.getLogger(this.getClass().getName()).fine(msg.toString());
}
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-index
/**
* Redistribute entries according to the given sorting.
*
* @param newNode Node to split to
* @param sorting Sorting to use
* @param splitPoint Split point
*/
public final void splitTo(AbstractNode<E> newNode, List<E> sorting, int splitPoint) {
assert (isLeaf() == newNode.isLeaf());
deleteAllEntries();
StringBuilder msg = LoggingConfiguration.DEBUG ? new StringBuilder(1000) : null;
for(int i = 0; i < splitPoint; i++) {
addEntry(sorting.get(i));
if(msg != null) {
msg.append("n_").append(getPageID()).append(' ').append(sorting.get(i)).append('\n');
}
}
for(int i = splitPoint; i < sorting.size(); i++) {
newNode.addEntry(sorting.get(i));
if(msg != null) {
msg.append("n_").append(newNode.getPageID()).append(' ').append(sorting.get(i)).append('\n');
}
}
if(msg != null) {
Logging.getLogger(this.getClass().getName()).fine(msg.toString());
}
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki
/**
* Redistribute entries according to the given sorting.
*
* @param newNode Node to split to
* @param sorting Sorting to use
* @param splitPoint Split point
*/
public final void splitTo(AbstractNode<E> newNode, List<E> sorting, int splitPoint) {
assert (isLeaf() == newNode.isLeaf());
deleteAllEntries();
StringBuilder msg = LoggingConfiguration.DEBUG ? new StringBuilder("\n") : null;
for(int i = 0; i < splitPoint; i++) {
addEntry(sorting.get(i));
if(msg != null) {
msg.append("n_").append(getPageID()).append(" ");
msg.append(sorting.get(i)).append("\n");
}
}
for(int i = splitPoint; i < sorting.size(); i++) {
newNode.addEntry(sorting.get(i));
if(msg != null) {
msg.append("n_").append(newNode.getPageID()).append(" ");
msg.append(sorting.get(i)).append("\n");
}
}
if(msg != null) {
Logging.getLogger(this.getClass().getName()).fine(msg.toString());
}
}
代码示例来源:origin: elki-project/elki
/**
* Splits the entries of this node into a new node using the given assignments
*
* @param newNode Node to split to
* @param assignmentsToFirst the assignment to this node
* @param assignmentsToSecond the assignment to the new node
*/
public final void splitTo(AbstractNode<E> newNode, List<E> assignmentsToFirst, List<E> assignmentsToSecond) {
assert (isLeaf() == newNode.isLeaf());
deleteAllEntries();
StringBuilder msg = LoggingConfiguration.DEBUG ? new StringBuilder(1000) : null;
// assignments to this node
for(E entry : assignmentsToFirst) {
if(msg != null) {
msg.append("n_").append(getPageID()).append(' ').append(entry).append('\n');
}
addEntry(entry);
}
// assignments to the new node
for(E entry : assignmentsToSecond) {
if(msg != null) {
msg.append("n_").append(newNode.getPageID()).append(' ').append(entry).append('\n');
}
newNode.addEntry(entry);
}
if(msg != null) {
Logging.getLogger(this.getClass()).fine(msg.toString());
}
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-index
/**
* Splits the entries of this node into a new node using the given assignments
*
* @param newNode Node to split to
* @param assignmentsToFirst the assignment to this node
* @param assignmentsToSecond the assignment to the new node
*/
public final void splitTo(AbstractNode<E> newNode, List<E> assignmentsToFirst, List<E> assignmentsToSecond) {
assert (isLeaf() == newNode.isLeaf());
deleteAllEntries();
StringBuilder msg = LoggingConfiguration.DEBUG ? new StringBuilder(1000) : null;
// assignments to this node
for(E entry : assignmentsToFirst) {
if(msg != null) {
msg.append("n_").append(getPageID()).append(' ').append(entry).append('\n');
}
addEntry(entry);
}
// assignments to the new node
for(E entry : assignmentsToSecond) {
if(msg != null) {
msg.append("n_").append(newNode.getPageID()).append(' ').append(entry).append('\n');
}
newNode.addEntry(entry);
}
if(msg != null) {
Logging.getLogger(this.getClass()).fine(msg.toString());
}
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki
/**
* Splits the entries of this node into a new node using the given assignments
*
* @param newNode Node to split to
* @param assignmentsToFirst the assignment to this node
* @param assignmentsToSecond the assignment to the new node
*/
public final void splitTo(AbstractNode<E> newNode, List<E> assignmentsToFirst, List<E> assignmentsToSecond) {
assert (isLeaf() == newNode.isLeaf());
deleteAllEntries();
StringBuilder msg = LoggingConfiguration.DEBUG ? new StringBuilder() : null;
// assignments to this node
for(E entry : assignmentsToFirst) {
if(msg != null) {
msg.append("n_").append(getPageID()).append(" ").append(entry).append("\n");
}
addEntry(entry);
}
// assignments to the new node
for(E entry : assignmentsToSecond) {
if(msg != null) {
msg.append("n_").append(newNode.getPageID()).append(" ").append(entry).append("\n");
}
newNode.addEntry(entry);
}
if(msg != null) {
Logging.getLogger(this.getClass()).fine(msg.toString());
}
}
代码示例来源:origin: elki-project/elki
/**
* Get the distance function parameter.
*
* @param config Parameterization
*/
protected void getParameterDistanceFunction(Parameterization config) {
ObjectParameter<NumberVectorDistanceFunction<? super V>> distanceFunctionP = new ObjectParameter<>(DistanceBasedAlgorithm.DISTANCE_FUNCTION_ID, PrimitiveDistanceFunction.class, SquaredEuclideanDistanceFunction.class);
if(config.grab(distanceFunctionP)) {
distanceFunction = distanceFunctionP.instantiateClass(config);
if(distanceFunction == null //
|| distanceFunction instanceof SquaredEuclideanDistanceFunction //
|| distanceFunction instanceof EuclideanDistanceFunction) {
return;
}
if(needsMetric() && !distanceFunction.isMetric()) {
Logging.getLogger(this.getClass()).warning("This k-means variants requires the triangle inequality, and thus should only be used with squared Euclidean distance!");
}
else {
Logging.getLogger(this.getClass()).warning("k-means optimizes the sum of squares - it should be used with squared euclidean distance and may stop converging otherwise!");
}
}
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-clustering
/**
* Get the distance function parameter.
*
* @param config Parameterization
*/
protected void getParameterDistanceFunction(Parameterization config) {
ObjectParameter<NumberVectorDistanceFunction<? super V>> distanceFunctionP = new ObjectParameter<>(DistanceBasedAlgorithm.DISTANCE_FUNCTION_ID, PrimitiveDistanceFunction.class, SquaredEuclideanDistanceFunction.class);
if(config.grab(distanceFunctionP)) {
distanceFunction = distanceFunctionP.instantiateClass(config);
if(distanceFunction == null //
|| distanceFunction instanceof SquaredEuclideanDistanceFunction //
|| distanceFunction instanceof EuclideanDistanceFunction) {
return;
}
if(needsMetric() && !distanceFunction.isMetric()) {
Logging.getLogger(this.getClass()).warning("This k-means variants requires the triangle inequality, and thus should only be used with squared Euclidean distance!");
}
else {
Logging.getLogger(this.getClass()).warning("k-means optimizes the sum of squares - it should be used with squared euclidean distance and may stop converging otherwise!");
}
}
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-batik-visualization
if(Logging.getLogger(task.getFactory().getClass()).isDebugging()) {
LOG.exception("Visualization failed.", e);
代码示例来源:origin: elki-project/elki
if(Logging.getLogger(task.getFactory().getClass()).isDebugging()) {
LOG.exception("Visualization failed.", e);
代码示例来源:origin: elki-project/elki
/**
* Test the clustering result by comparing the score with an expected value.
*
* @param database Database to test
* @param clustering Clustering result
* @param expected Expected score
*/
protected <O> void testFMeasure(Database database, Clustering<?> clustering, double expected) {
// Run by-label as reference
ByLabelClustering bylabel = new ByLabelClustering();
Clustering<Model> rbl = bylabel.run(database);
ClusterContingencyTable ct = new ClusterContingencyTable(true, false);
ct.process(clustering, rbl);
double score = ct.getPaircount().f1Measure();
Logging.getLogger(this.getClass()).verbose(this.getClass().getSimpleName() + " score: " + score + " expect: " + expected);
assertEquals(this.getClass().getSimpleName() + ": Score does not match.", expected, score, 0.0001);
}
代码示例来源:origin: elki-project/elki
/**
* Remove the previous relation.
*
* Manually also log index statistics, as we may be removing indexes.
*
* @param relation Relation to remove
*/
protected void removePreviousRelation(Relation<?> relation) {
if(keep) {
return;
}
boolean first = true;
for(It<Index> it = relation.getHierarchy().iterDescendants(relation).filter(Index.class); it.valid(); it.advance()) {
if(first) {
Logging.getLogger(getClass()).statistics("Index statistics when removing initial data relation.");
first = false;
}
it.get().logStatistics();
}
ResultUtil.removeRecursive(relation.getHierarchy(), relation);
}
代码示例来源:origin: elki-project/elki
@Override
public synchronized void doThumbnail() {
pendingThumbnail = null;
try {
VisualizationPlot plot = new VisualizationPlot();
plot.getRoot().setAttribute(SVGConstants.SVG_VIEW_BOX_ATTRIBUTE, "0 0 " + getWidth() + " " + getHeight());
// Work on a clone
Visualization vis = visFactory.makeVisualization(context, task, plot, getWidth(), getHeight(), proj);
plot.getRoot().appendChild(vis.getLayer());
plot.updateStyleElement();
final int tw = (int) (getWidth() * tresolution);
final int th = (int) (getHeight() * tresolution);
thumb = plot.makeAWTImage(tw, th);
thumbid = ThumbnailRegistryEntry.registerImage(thumb);
// The visualization will not be used anymore.
vis.destroy();
svgp.requestRedraw(this.task, this);
}
catch(Exception e) {
final Logging logger = Logging.getLogger(task.getFactory().getClass());
if(logger != null && logger.isDebugging()) {
logger.exception("Thumbnail for " + task.getFactory() + " failed.", e);
}
else {
LoggingUtil.warning("Thumbnail for " + task.getFactory() + " failed - enable debugging to see details.");
}
// TODO: hide the failed image?
}
}
代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-batik-visualization
@Override
public synchronized void doThumbnail() {
pendingThumbnail = null;
try {
VisualizationPlot plot = new VisualizationPlot();
plot.getRoot().setAttribute(SVGConstants.SVG_VIEW_BOX_ATTRIBUTE, "0 0 " + getWidth() + " " + getHeight());
// Work on a clone
Visualization vis = visFactory.makeVisualization(task, plot, getWidth(), getHeight(), proj);
plot.getRoot().appendChild(vis.getLayer());
plot.updateStyleElement();
final int tw = (int) (getWidth() * tresolution);
final int th = (int) (getHeight() * tresolution);
thumb = plot.makeAWTImage(tw, th);
thumbid = ThumbnailRegistryEntry.registerImage(thumb);
// The visualization will not be used anymore.
vis.destroy();
svgp.requestRedraw(this.task, this);
}
catch(Exception e) {
final Logging logger = Logging.getLogger(task.getFactory().getClass());
if(logger != null && logger.isDebugging()) {
logger.exception("Thumbnail for " + task.getFactory() + " failed.", e);
}
else {
LoggingUtil.warning("Thumbnail for " + task.getFactory() + " failed - enable debugging to see details.");
}
// TODO: hide the failed image?
}
}
内容来源于网络,如有侵权,请联系作者删除!