|
Java example source code file (ml.xml)
The ml.xml Java example source code
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<?xml-stylesheet type="text/xsl" href="./xdoc.xsl"?>
<document url="ml.html">
<properties>
<title>The Commons Math User Guide - Machine Learning
</properties>
<body>
<section name="16 Machine Learning">
<subsection name="16.1 Overview" href="overview">
<p>
Machine learning support in commons-math currently provides operations to cluster
data sets based on a distance measure.
</p>
</subsection>
<subsection name="16.2 Clustering algorithms and distance measures" href="clustering">
<p>
The <a href="../apidocs/org/apache/commons/math3/ml/clustering/Clusterer.html">
Clusterer</a> class represents a clustering algorithm.
The following algorithms are available:
<ul>
<li>KMeans++:
It is based on the well-known kMeans algorithm, but uses a different method for
choosing the initial values (or "seeds") and thus avoids cases where KMeans sometimes
results in poor clusterings. KMeans/KMeans++ clustering aims to partition n observations
into k clusters in such that each point belongs to the cluster with the nearest center.
</li>
<li>Fuzzy-KMeans:
A variation of the classical K-Means algorithm, with the major difference that a single
data point is not uniquely assigned to a single cluster. Instead, each point i has a set
of weights u<sub>ij which indicate the degree of membership to the cluster j. The fuzzy
variant does not require initial values for the cluster centers and is thus more robust, although
slower than the original kMeans algorithm.
</li>
<li>DBSCAN:
Density-based spatial clustering of applications with noise (DBSCAN) finds a number of
clusters starting from the estimated density distribution of corresponding nodes. The
main advantages over KMeans/KMeans++ are that DBSCAN does not require the specification
of an initial number of clusters and can find arbitrarily shaped clusters.
</li>
<li>Multi-KMeans++:
Multi-KMeans++ is a meta algorithm that basically performs n runs using KMeans++ and then
chooses the best clustering (i.e., the one with the lowest distance variance over all clusters)
from those runs.
</li>
</ul>
</p>
<p>
An comparison of the available clustering algorithms:<br/>
<img src="../images/userguide/cluster_comparison.png" alt="Comparison of clustering algorithms"/>
</p>
</subsection>
<subsection name="16.3 Distance measures" href="distance">
<p>
Each clustering algorithm requires a distance measure to determine the distance
between two points (either data points or cluster centers).
The following distance measures are available:
<ul>
<li>Canberra distance
<li>ChebyshevDistance distance
<li>EuclideanDistance distance
<li>ManhattanDistance distance
<li>Earth Mover's distance
</ul>
</p>
</subsection>
<subsection name="16.3 Example" href="example">
<p>
Here is an example of a clustering execution. Let us assume we have a set of locations from our domain model,
where each location has a method <code>double getX() and
Other Java examples (source code examples)Here is a short list of links related to this Java ml.xml source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.