Skip to main content

Cli.java won't compile in jahmm

Problem:

When you compile Cli.class in terminal or Eclipse, you may get the following error:

Cli.java:27: package be.ac.ulg.montefiore.run.jahmm.io does not exist import be.ac.ulg.montefiore.run.jahmm.io.FileFormatException; ^ Cli.java:54: cannot find symbol symbol : class AbnormalTerminationException
9 more errors

Solution:

You must to pass parameters to your class. The class takes 5 parameters which are:
  • Parameter 1: should be one of the following:
    • create: creates a new HMM description file,
    • print: prints a HMM
    • learn-kmeans: applies the k-Means algorithm
    • learn-bw: applies the Baum-Welch algorithm
    • generate:  generates an observation sequence given a HMM
    • distance-kl:  computes the distance between two HMMs
  • Parameter 2:
    • -opdf. It takes one of the following:
    • -r: argument describes that HMM will take 4 integers. For example, -r 4 means that HMM takes 0.25 0.25 0.25 0.25 observations probabilities. The model in Jahmm assign the same probabilities.
    • -ng: specify the number of gaussians distribution. For example, -ng 2.
    • -d: specify the vector dimension. For example, -d 2, means that the model will create a matrix of 2*2 probabilities.
    • -n: specify the number of states to build the model. For example, -n 4.
    • -o: specify the name of your output file. For example, -o  output.hmm.

From Eclipse:
  • Add your Junit.jar and jahmm-0.6.1.jar.
    • Right click on your project > Properties > Java Build Path > Libraries > Add JARS (if it is within your project folder), or Add External JARS (if the jar outside your project folder).
    • Apply.
  • Then,
    • Go to Cli.java that exists in cli in your source code folder.
    • Right click on Cli.java > Run As > Run Configurations > select Arguments tab and Enter:
      • create -opdf integer -r 4 -n 3 -o test.hmm
    • Then click Apply and Run.



The output will look like the following: (of course it will differ based on your configuration to the parameters)


Problem Source:

JAHMM User Guide:

Comments

Popular posts from this blog

Retrieve Data from Database and Compare it with user input using Java

In this Lesson we will create a form page " form.jsp " that takes the user email. After that we will check the user existence in our DB. If the user email stored in the DB, a welcoming page will be opened to him/her. If the user is a new user then a message will be displayed that tells him/her this email is not stored in our DB. Note: I use access 2013 database and Eclipse Juno     Basic step, Create a new project: Open Eclipse then click on File > New > Other > Web > Dynamic Web Project. First, Load the DB class: In this step we will connect with database so we will gather all its code in a java class named " DBConnection.java " under a package called " code ". Expand your project then right click on java resources > New > Package . After-that Give a name for your package ex, code   Right click on your created new package that called code > New > Class.   After-that Give a name for your Class ex, DBConnection.  

An attempt was made to insert a node where it is not permitted

Do you face this Error while you are writing code to generate xml file from java? Exception in thread "main" org.w3c.dom.DOMException : HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.        at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.insertBefore(Unknown Source)        at com.sun.org.apache.xerces.internal.dom.NodeImpl.appendChild(Unknown Source)        at generatexml.WriteXMLFile.main( WriteXMLFile.java:30 ) Well the answer is: Don't insert the node where it isn't permitted. Change your generated directory file path from 'C' to other directory ex, D or to any directory you have. Make sure the ‘appendChild’ is referring to the right element. Don’t appending twice, only make it once. Ex, //Writetoxml.java   Element rootElement = doc . createElement ( " Company " );   doc . appendChild ( rootElement );                Element subElement = doc . cre

Do you want to know about your computer in one window screen?

System Toolbox (Sys Toolbox) If you want to know information about your computer from processor, drivers, motherboard, memory, operating system,...and more, you can depend on this software. Sys Toolbox (see screen shoot from the software) provides a software and hardware information for windows operating system. It is a simple software that you can use it to know about your PC. To run the software, you need to: Extract the zipped software.  After that, right click on the software icon and choose "Run as administrator". Finally, you will find a pop up screen telling you information about you PC. To go to the software site: http://sys-toolbox-pro.soft112.com/ To Download the software: Download