The library contains a number of interconnected Java packages that implement machine learning and artificial intelligence algorithms. These are artificial intelligence algorithms implemented for the kind of people that like to implement algorithms themselves.
*For discrete optimization problems see java examples /src/opt/test or jython versions /jython
*For jython | csv | python and grid search examples see /jython
*Also see Wiki, FAQ
Here is a simple example of how to import data and build a neural network using the iris data set (taken from IrisTest.java). Train and test error will be exported in csv format to the current working directory.
//import data
DataSetReader dsr = new CSVDataSetReader((new File("src/opt/test/iris.txt")).getAbsolutePath());
DataSet ds = dsr.read();
//split last attribute for label
LabelSplitFilter lsf = new LabelSplitFilter();
lsf.filter(ds);
//encode label as one-hot array and get outputLayerSize
DiscreteToBinaryFilter dbf = new DiscreteToBinaryFilter();
dbf.filter(ds.getLabelDataSet());
outputLayerSize=dbf.getNewAttributeCount();
//test-train split
int percentTrain=75;
RandomOrderFilter randomOrderFilter = new RandomOrderFilter();
randomOrderFilter.filter(ds);
TestTrainSplitFilter testTrainSplit = new TestTrainSplitFilter(percentTrain);
testTrainSplit.filter(ds);
train=testTrainSplit.getTrainingSet();
test=testTrainSplit.getTestingSet();
//standardize data
StandardMeanAndVariance smv = new StandardMeanAndVariance();
smv.fit(train);
smv.transform(train);
smv.transform(test);
//create backprop network using builder
BackPropagationNetwork network = new BackpropNetworkBuilder()
.withLayers(new int[] {25,10,outputLayerSize})
.withDataSet(train, test)
.withIterations(5000)
.train();
//create opt network using builder
FeedForwardNetwork optNetwork = new OptNetworkBuilder()
.withLayers(new int[] {25,10,outputLayerSize})
.withDataSet(train, test)
.withSA(100000, .975)
.withIterations(1000)
.train();
- Fork it.
- Create a branch (
git checkout -b my_branch
) - Commit your changes (
git commit -am "Awesome feature"
) - Push to the branch (
git push origin my_branch
) - Open a Pull Request
- Enjoy a refreshing Diet Coke and wait
Hidden Markov Models
- Baum-Welch reestimation algorithm, scaled forward-backward algorithm, Viterbi algorithm
- Support for Input-Output Hidden Markov Models
- Write your own output or transition probability distribution or use the provided distributions, including neural network based conditional probability distributions
- Neural Networks
- Configurable error functions with sum of squares, weighted sum of squares
- Multiple activation functions with logistic sigmoid, linear, tanh, and soft max
- Choose your weight update rule with standard update rule, standard update rule with momentum, Quickprop, RPROP
- Online and batch training
- Support Vector Machines
- Support for linear, polynomial, tanh, radial basis function kernels
- Decision Trees
- Binary or all attribute value splitting
- Chi-square signifigance test pruning with configurable confidence levels
- Boosted decision stumps with AdaBoost
- K Nearest Neighbors
- KNN Classifier with weighted or non-weighted classification, customizable distance function
- Linear Algebra Algorithms
- Solve square systems, upper triangular systems, lower triangular systems, least squares
- Singular Value Decomposition, QR Decomposition, LU Decomposition, Schur Decomposition, Symmetric Eigenvalue Decomposition, Cholesky Factorization
- Make your own matrix decomposition with the easy to use Householder Reflection and Givens Rotation classes
- Optimization Algorithms
Randomized hill climbing, simulated annealing, genetic algorithms, and discrete dependency tree MIMIC
- Make your own crossover functions, mutation functions, neighbor functions, probability distributions, or use the provided ones.
- Optimize the weights of neural networks and solve travelling salesman problems
- Graph Algorithms
- Clustering Algorithms
- Data Preprocessing
- Convert from continuous to discrete, discrete to binary
- Reinforcement Learning