There is colt.
Answer from miku on Stack OverflowThe Colt library provides fundamental general-purpose data structures optimized for numerical data, such as resizable arrays, dense and sparse matrices (multi-dimensional arrays), linear algebra, associative containers and buffer management.
The Jet library contains mathematical and statistical tools for data analysis, powerful histogramming functionality, Random Number Generators and Distributions useful for (event) simulations, and more.
The CoreJava library contains C-like print formatting. The Concurrent library contains standardized, efficient utility classes commonly encountered in parallel & concurrent programming.
Videos
There is colt.
The Colt library provides fundamental general-purpose data structures optimized for numerical data, such as resizable arrays, dense and sparse matrices (multi-dimensional arrays), linear algebra, associative containers and buffer management.
The Jet library contains mathematical and statistical tools for data analysis, powerful histogramming functionality, Random Number Generators and Distributions useful for (event) simulations, and more.
The CoreJava library contains C-like print formatting. The Concurrent library contains standardized, efficient utility classes commonly encountered in parallel & concurrent programming.
Apache Commons Math might be helpful. So might JAMA.
UPDATE: In the 2.5 years since I last answered this, I've become aware of Apache's Mahout and WEKA. Both are excellent Java libraries for data analysis.
Both are more appropriate answers for the narrower concern of data mining.
You can use the Symja - Java computer algebra and symbolic math library.
import org.matheclipse.core.eval.ExprEvaluator;
import org.matheclipse.core.expression.F;
import org.matheclipse.core.interfaces.IAST;
import org.matheclipse.core.interfaces.IExpr;
import org.matheclipse.core.interfaces.ISymbol;
import org.matheclipse.parser.client.SyntaxError;
public class Example {
public static void main(String[] args) {
try {
ExprEvaluator util = new ExprEvaluator(false, (short) 100);
// Convert an expression to the internal Java form:
// Note: single character identifiers are case sensitive
// (the "D()" function identifier must be written as upper case character)
String javaForm = util.toJavaForm("4*x + x - 20 + 10");
// prints: Plus(ZZ(-20L),x,Times(C4,x),C10)
System.out.println("Out[1]: " + javaForm.toString());
// Use the Java form to create an expression with F.* static methods:
ISymbol x = F.Dummy("x");
IAST function = F.Plus(F.ZZ(-20L), x, F.Times(F.C4, x), F.C10);
IExpr result = util.eval(function);
// print: -10+5*x
System.out.println("Out[2]: " + result.toString());
} catch (SyntaxError e) {
// catch Symja parser errors here
System.out.println(e.getMessage());
} catch (RuntimeException rex) {
System.out.println(rex.getMessage());
}
}
}
DataMelt (http://jwork.org/dmelt) does this. Here is an example (I use Jython, but you can use Java too)
from jhplot.math import *
from jhplot import *
j=Symbolic("jscl") # using jscl engine
print j.simplify("(x + 1)^(1/x)") == "(1+x)^(1/x)"
print j.simplify("(x^2-1)/(x-1)") == "1+x"
This code returns "true" for all such simplifications