Skip to content

Latest commit

 

History

History
259 lines (162 loc) · 11 KB

faq.md

File metadata and controls

259 lines (162 loc) · 11 KB

Frequently Asked Questions

Table of contents

Getting Started

Usage Questions

Other questions


What is ABAGAIL?

ABAGAIL is an acronym of Absolute Best Andrew Guillory Artificial Intelligence Library.

from src > abagail.html:

This library is the result of close to a year of research and class work in artificial intelligence (AI). It 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.

Back to top


How to get started with ABAGAIL?

Start by download the source code from github You can use git to clone the repository:

git clone https://github.com/pushkar/ABAGAIL.git

or download the .zip file from github

After downloading the source code, decide how you want to work with the library, the most common options are listed here.

VERY BASIC INSTRUCTIONS FOR COMMAND LINE

  1. Install Java 8 SDK from here http://www.oracle.com/technetwork/java/javase/downloads/index.html
  2. Install Ant http://ant.apache.org/
  3. Clone or download source files from Git
  4. Go with command line to where the build.xml file is and run: ant (note: the ant executable should be in your path somehow if you installed ant correctly.. so will java and javac)
  5. Now run your scripts

Back to top


How is ABAGAIL project organized?

At a high-level, the project structure is organized as follows:

dist

  • Contains classes to generate distributions

func

  • Contains superviced learning algorithms
  • Contains clustering algorithms

opt

  • Contains random search algorithms
  • Contains optimization test functions

rl

  • Contains reinforcement learning algorithms

shared

  • Contains filters
  • Contains IO and test running functions

util

  • Contains utility methods and data structures

Back to top


What are the different ways to work with ABAGAIL?

There are several options:

  • use terminal or command line interface to compile and execute Java code
  • use Java-compatible IDE with ABAGAIL as a library   examples: Eclipse
  • use Scala console with ABAGAIL as a library
  • use Jython

Back to top


How to use ABAGAIL with Eclipse?

  1. fork https://github.com/pushkar/ABAGAIL.git

  2. From the terminal clone your forked repo to a directory of your choice.

  3. Create an Eclipse project, let's say it's "AbagailProject"

  4. With the following steps you will convert the directory where you copied Abagail into an Eclipse Project

a. Go to File->New->Project.

b. On the menu double click on Java and select "Java Project from Existing Ant Build file". Click Next.

c. Browse to the Abagail folder and select the xml file. Click Finish.

  1. Now you need to include this new Eclipse project to the build folder of your project.

a. Right click on "AbagailProject" and select Properties.

b. On the left pane of the window select "Java Build Path."

c. Select the "Projects" tab.

d. Click Add...

e. Select the abagail project you just created (note that when you create the Eclipse project, the name of the project is "project" by default)

  1. To use any of the Abagail classes just use import. For instance, if you want to use the class ArffDataSetReader, you need to add the following import statement: import shared.reader.ArffDataSetReader;

Back to top


Is there a tutorial or documentation for ABAGAIL?

At this time the documentation is very limited. ABAGAIL comes with some documentation for you to look through when you build the project as well as a few examples. Users are actively encouraged to contribute to project documentation.

Back to top


Can you generate graphs out of ABAGAIL library?

Currently no. There are several external libraries and software you can use to visualize results:

  • Microsoft Excel
  • R
  • matplotlib
  • JFreeChart
  • matlab
  • mathematica
  • ...etc.

Back to top


How can I find out the actual number of iterations performed in ABAGAIL?

When you work with random search optimization problems, the number of iterations in the example problems is fixed.

For example:

FixedIterationTrainer fit = new FixedIterationTrainer(algorithm, 200000);`

will train the algorithm 200,000 times.

Alternatively, you can use ConvergenceTrainer which will train until convergence, or up to set number of maximum iterations, whichever occurs earlier:

ConvergenceTrainer trainer = new ConvergenceTrainer(algorithm);`

Back to top


Could someone help explain the training_iterations in ABAGAIL? When I increase it, I get better accuracy.

In short, the more you train, the more accurate your weights become. This leads to better accuracy

Back to top


My neural network classifier is performing very poorly, how to fix it?

Make sure your dataset values are normalized. See this article for more details.

Back to top


How does the neural network get its weights updated?

Q:I was looking through the AbaloneTest.java code, and notice that each of the randomized algorithm has a train function that, in the case of SA for e.g., picks a neighbor and its fitness value (or sticks with the current point). However, I wasn't able to figure out how the NN gets updated with the new weights? I don't see anything where the train the SA code passes anything back to the concrete class of HillClimbingProblem.

Under ABAGAIL/src/func/nn/backprop/: BackPropagationNetworkFactory.java

private static BackPropagationNetworkFactory factory = new BackPropagationNetworkFactory();

/*********/

// returns instance of BackPropagationNetwork which has updateWeights method.
networks[i] = factory.createClassificationNetwork(new int[] {inputLayer, hiddenLayer, outputLayer});

/*********/

networks[i].setWeights(optimalInstance.getData());

Networks is an instance of BackPropagationNetwork.java, which has a method updateWeights(), which in turn extends class FeedForwardNetwork.java > LayeredNetwork.java > NeuralNetwork.java. The last one has setWeights() method.

Back to top


I am trying to understand what the count ones optimization function is doing, but I am not sure...

Q: I am trying to understand what the count ones optimization function is doing. From the test class in ABAGAIL, I see that an array is created and filled up with all int=2. I think i understand the concept of counting all of the 1s in the vector, but I do not see how the array of all 2s turns into an array of 1s and 0s?

If you dig through the classes that uses the ranges variable, it will become clear. The 2 specifies how many different values are possible at any point in the vector (0 and 1).

Back to top


TravelingSalesmanRouteEvaluationFunction - why the 1/total distance?

The object of the Traveling Salesman problem is to minimize the distance in a route. However, the optimization algorithms maximize their fitness functions. So it returns the inverse of the distance, which gets larger as the distance gets smaller.

Returning the normal distance would result in the algorithms finding the longest routes, which isn't what we're interested in.

Back to top


My dataset has categorical features, can I use ABAGAIL?

Convert the categorical features to binary, e.g., if you have Country as a variable, then each value of country will have its own column with 1 for the country that's present, and 0 for values that isn't.

Back to top


Getting ant build error: /home/unazi/ABAGAIL/build.xml:40: Unexpected attribute "additionalparam", how do I fix this?

Make sure you are using a version where this issue has been fixed. See: pushkar#31

Back to top


What are some characteristics of problems simulated annealing works well on?

Generally, simulated annealing works well if there are multiple minimum and you need to find the global minimum because SA will (hopefully) break out of the local minimum.

in the ABAGAIL library look for sample test problems under opt > example directory

Back to top