How to add LibSVM classifier in weka to the classpath in Ubuntu 14.04? - classpath

I copied the libsvm.jar file to /usr/share/java. Then I edited the /usr/bin/weka as below:
#!/bin/bash
. /usr/lib/java-wrappers/java-wrappers.sh
# default options
MAIN_CLASS="weka.gui.GUIChooser"
set_classpath "weka.jar"
export CLASSPATH="/usr/share/java/libsvm.jar:$CLASSPATH"
run ""
MEMORY="512m"
GUI=""
And when i try to classify using libsvm, this is the error i get.
java.lang.Exception: libsvm classes not in CLASSPATH!
weka.classifiers.functions.LibSVM.buildClassifier(LibSVM.java:1557)
weka.gui.explorer.ClassifierPanel$16.run(ClassifierPanel.java:1432)
at weka.classifiers.functions.LibSVM.buildClassifier(LibSVM.java:1557)
at weka.gui.explorer.ClassifierPanel$16.run(ClassifierPanel.java:1432)
How can i resolve this classpath issue? Any help would be highly appreciated. Thank you!

Related

zeppelin-0.7.3 Interpreter pyspark not found

I get the below error when I use pyspark via Zeppelin.
The python & spark interpreters work and all environment variables are set correctly.
print os.environ['PYTHONPATH']
/x01/spark_u/spark/python:/x01/spark_u/spark/python/lib/py4j-0.10.4-src.zip:/x01/spark_u/spark/python:/x01/spark_u/spark/python/lib/py4j-0.10.4-src.zip:/x01/spark_u/spark/python/lib/py4j-0.10.4-src.zip:/x01/spark_u/spark/python/lib/pyspark.zip:/x01/spark_u/spark/python:/x01/spark_u/spark/python/pyspark:/x01/spark_u/zeppelin/interpreter/python/py4j-0.9.2/src:/x01/spark_u/zeppelin/interpreter/lib/python
zepplin-env.sh is set with the below vars
export PYSPARK_PYTHON=/usr/local/bin/python2
export PYTHONPATH=${SPARK_HOME}/python:${SPARK_HOME}/python/lib/py4j-0.10.4-src.zip:${PYTHONPATH}
export SPARK_YARN_USER_ENV="PYTHONPATH=${PYTHONPATH}"
See the below log file
INFO [2017-11-01 12:30:42,972] ({pool-2-thread-4}
RemoteInterpreter.java[init]:221) - Create remote interpreter
org.apache.zeppelin.spark.PySparkInterpreter
org.apache.zeppelin.interpreter.InterpreterException:
paragraph_1509038605940_-1717438251's Interpreter pyspark not
found
Thank you in advance
I found a workaround for the above issue.The interpreter not found issue does not happen when I create note inside a directory.The issue only happens when I use notes at toplevel.Addionally I foud out that this issue does not happen in 0.7.2 version
Ex :
enter image description here

Eclipse pluginCustomization

I would like to add default ssh connections to eclipse as global configuration (generic through workspaces). For that, im using -pluginCustomization runtime parameter. Here is my test.ini file:
org.eclipse.remote.core/connectionTypeId=org.eclipse.remote.JSch
org.eclipse.remote.core/connections/org.eclipse.remote.JSch/m3ulcb/JSCH_ADDRESS_ATTR=localhost
org.eclipse.remote.core/connections/org.eclipse.remote.JSch/m3ulcb/JSCH_IS_PASSWORD_ATTR=true
org.eclipse.remote.core/connections/org.eclipse.remote.JSch/m3ulcb/JSCH_LOGIN_SHELL_COMMAND_ATTR=/bin/bash -l -c '{0}'
org.eclipse.remote.core/connections/org.eclipse.remote.JSch/m3ulcb/JSCH_PORT_ATTR=22
org.eclipse.remote.core/connections/org.eclipse.remote.JSch/m3ulcb/JSCH_TIMEOUT_ATTR=0
org.eclipse.remote.core/connections/org.eclipse.remote.JSch/m3ulcb/JSCH_USERNAME_ATTR=foo
org.eclipse.remote.core/connections/org.eclipse.remote.JSch/m3ulcb/JSCH_USE_LOGIN_SHELL_ATTR=true
eclipse.preferences.version=1
I see that the connectionTypeId takes efect and my default connection goes to ssh. The rest just does not work.
Any help would be really appreciate.
Thanks!
PS: I'm an eclipse newbie

Unable to set the package name for classpath in randoop

Here the project structure cloned from github after compiling on Ubuntu successfully,
javaml
bin
net/sf/javaml/core/Dataset.class
javaml
src
net/sf/javaml/core/Dataset.java
When the following command wa given:
java -ea -classpath /home/shahid/git/javaml/bin:/home/shahid/a_f_w/randoop-3.1.5/randoop-all-3.1.5.jar randoop.main.Main gentests --testclass=net.sf.javaml.core.Dataset --literals-file=CLASSES
It generated the error: "Ignoring interface net.sf.javaml.core.Dataset specified via --classlist or --testclass.
No classes to test
".
while the other command java -ea -classpath /home/shahid/git/java-ml/bin:/home/shahid/a_f_w/randoop-3.1.5/randoop-all-3.1.5.jar randoop.main.Main gentests --testclass=DataSet --literals-file=CLASSESwithout package for other project working perfectly.
Any help will be appretiated.
The error message gives you the answer:
Ignoring interface net.sf.javaml.core.Dataset specified via --classlist or --testclass. No classes to test
You are supposed to provide a class, not an interface, to the --testclass command-line argument.
By passing --testclass=net.sf.javaml.core.Dataset to Randoop, you indicated that you only want Randoop to create objects of type net.sf.javaml.core.Dataset. However, since that is an interface, it cannot be instantiated, and Randoop cannot create any objects, nor any tests.
The following command worked for me:
java -ea -classpath ~/javaml/bin/:~/Randoop/randoop-all-3.1.4.jar randoop.main.Main gentests --testclass=net.sf.javaml.core.Complex --literals-file=CLASSES
#mernst thanks for your kind response.

PredictionIO - getting error when build and run Evaluation metrics

I followed this quickstart:
https://docs.prediction.io/templates/classification/quickstart/
and this document for evaluation metrics
https://docs.prediction.io/evaluation/paramtuning/
Everything seems ok until the step build and run evaluation metrics
pio eval org.template.classification.AccuracyEvaluation \
org.template.classification.EngineParamsList
I am getting the exception:
Exception in thread "main" scala.reflect.internal.MissingRequirementError: object org.template.classification.AccuracyEvaluation not found.
at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:16)
at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:17)
at scala.reflect.internal.Mirrors$RootsBase.ensureModuleSymbol(Mirrors.scala:126)
at scala.reflect.internal.Mirrors$RootsBase.staticModule(Mirrors.scala:161)
at scala.reflect.internal.Mirrors$RootsBase.staticModule(Mirrors.scala:21)
at io.prediction.workflow.WorkflowUtils$.getEvaluation(WorkflowUtils.scala:103)
at io.prediction.workflow.CreateWorkflow$$anonfun$19.apply(CreateWorkflow.scala:146)
at io.prediction.workflow.CreateWorkflow$$anonfun$19.apply(CreateWorkflow.scala:144)
Could anyone help me with this?
Thank you very much.
Had the exact same problem. Fixed it by doing the following:
For each .scala file in engine_dir/src/main/scala/org/template/engine_name/ you need to change the first line from...
package <SomeTemplateName>
To the following (replacing engine_name with the name of the folder in the path mentioned above):
package org.template.<engine_name>
Then, in engine.json you need to change the following line...
"engineFactory": "<template name>.<template engine>",
To the following (once again replacing engine_name with the name of the folder in the path mentioned above):
"engineFactory": "org.template.<engine name>.<template engine>",
Now re-run...
pio build
pio train
pio deploy
Then you should be able to run the model evaluation without errors.
Simply run it like this
$ pio eval org.example.classification.AccuracyEvaluation \
org.example.classification.EngineParamsList
You dont have to change anything. The class package from the sample was org.example.classification not org.template.classification

Model Error: It appears that build process was unable to locate some Utility(e.g. make,compiler,linker, etc.)

I am new to S-Functions and Real TIme WorkShop. The S-Function has been created using an Embedded Matlab Function. The S-Function Works fine, but when i try to build the same, i get the following error report:
It appears that the build process was unable to locate some utility (e.g. make, compiler, linker, etc.). Please verify your path and tool environment variables are correct. You should be able to execute the make command: .\Radius_S_func2.bat at an MS DOS Command Prompt in the directory: C:\Users\skaushik\Desktop\Matlab Models\WIP\TESTs\Sfunc_2\Radius_S_func2_Source Currently, this generates the following error:
C:\Users\skaushik\Desktop\Matlab Models\WIP\TESTs\Sfunc_2\Radius_S_func2_Source>set MATLAB=C:\MATLAB\R2010b
C:\Users\skaushik\Desktop\Matlab Models\WIP\TESTs\Sfunc_2\Radius_S_func2_Source>.......\u_Utils\Build\make -f Radius_S_func2.mk GENERATE_REPORT=0 INCLUDE_MDL_TERMINATE_FCN=0 COMBINE_OUTPUT_UPDATE_FCNS=1 MAT_FILE=0 MULTI_INSTANCE_CODE=0 INTEGER_CODE=0 PORTABLE_WORDSIZES=0 GENERATE_ERT_S_FUNCTION=0 GENERATE_ASAP2=0 EXT_MODE=0 EXTMODE_STATIC_ALLOC=0 EXTMODE_STATIC_ALLOC_SIZE=1000000 EXTMODE_TRANSPORT=0 TMW_EXTMODE_TESTING=0 MODELLIB=Radius_S_func2lib.lib RELATIVE_PATH_TO_ANCHOR=.. MODELREF_TARGET_TYPE=NONE OPTS="-DRT -DUSE_RTMODEL -DERT" The system cannot find the path specified.
PLease guide me how to understand the error, so i can take care of it myself.
Thank you!!
Solution: The build target was not specified therefore matlab gave the above mentioned error. To resolve this one should specify the build environment for a specific target.