Weka EM cluster get "Error: Could not find or load main class test" in eclipse - cluster-analysis

I want to use weka to cluster tweets in the database in JSP. In GUI, I find only HierarchiccalClusterer and Filteredcluster available for string clustering. Then I find this clusteringdemo sample code from weka official website: https://svn.scms.waikato.ac.nz/svn/weka/trunk/wekaexamples/src/main/java/wekaexamples/clusterers/ClusteringDemo.java
However, after set up the sample arff code in weka directory, I get this error "Error: Could not find or load main class ClusteringDemo".
Can anyone help me to find out the reason?
I only change filename in the sentence data = DataSource.read(filename);. Besides, my classpath set up correctly for I already done some classifier.

1.- Maybe the ClusteringDemo.class is not in your classpath.
You should add the class of jar file to your project.
2.- Anyway, you can download the java code from: http://weka.wikispaces.com/file/detail/ClusteringDemo.java
Compile and run it (make sure that weka.jar is in your classpath).
3.- If you have added ClusteringDemo.java to your project. Make sure that it has the "package" line (the first line) according to its location. Otherwise Java will not be able to find it.
Good luck using EM, maybe you can also try N-grams + Naive Bayes.

Related

distilbert model is not working at ktrain

I tried to use distilbert classifier. but I am getting the following error.
This is my code
(X_train,y_train),(X_test,y_test),prepro
=text.texts_from_df(train_df=data_train,text_column="Cleaned",label_columns=col
,val_df=data_test,maxlen=500,preprocess_mode="distilbert")
and here is the error
OSError: Model name 'distilbert-base-uncased' was not found in tokenizers model name list (distilbert-base-uncased, distilbert-base-uncased-distilled-squad, distilbert-base-cased, distilbert-base-cased-distilled-squad, distilbert-base-german-cased, distilbert-base-multilingual-cased). We assumed 'distilbert-base-uncased' was a path, a model identifier, or url to a directory containing vocabulary files named ['vocab.txt'] but couldn't find such vocabulary files at this path or url._
Due to my office current environmental issue, I can only work on tf 2.2 and python 3.8. Right now I am using 0.19.
Do you think it will affect my current environment if I downgrade it to 0.16?
This error may happen if there is a network or firewall issue preventing download of the tokenizer files. See this FAQ entry for remedies.
Also, when you use preprocess_mode='distilbert', texts_from* functions return TransformerDataset instances, not arrays. You'll need to replace (X_train, y_train) with train_data, for example. See this example notebook.

FlexUnitApplication.html and FlexUnitApplication.swf not generated

Context
I have
a project Flex-Java in Eclipse Indigo service Release 2, (a web application)
and i use the plugin Flash-builder to work on it.
I use sdk 4.5.1
What i try to do
1) I try to make a simple test case with FlexUnit4. When i create a new Test Case) : New > Test Case Class, Eclipse by Default create :
package flexUnitTests + with my new Test case : (for example :
TestDoc.as)
package byDefault with one file : FlexUnitCompilerApplication.mxml
a html a swf file for FlexUnitCompilerApplication is auto-generated in bin-debug folder.
Till this point all seems to be good, so I try to execute the unit test :
2) I want to execute the unit test :
A FlexUnitApplication.mxml is created in the default package
The problem :
The compilator doesn't generate the files : FlexUnitApplication.hmtl and FlexUnitApplication.swf in bin-debug folder...
And there is an error written in the "error screen" :
description Impossible to resolve all the ressources "FlexUnitTestRunner"
place or Localisation : Unknown
sorry i try to translate the description from a French version
Other informations
I succeeded doing this in other projects... the FlexUnitApplication files are auto-generated.
Question(s)
It seems that, it is bound with something in this particular project. Maybe something is hindering the process to autogenerate these files ?? I cannot figure it out why??
Is it Possible to force the compilator doing these files (html and swf) ??
I am really lost.. and i tried things, i looked in the properties, in the metadata's ... i really don't understand.
Somebody maybe has an idea for that, what could i do, what could i check ?
Thank you in advance
I always have troubles with unit tests in eclips+FB plugin as well.
After the FlexUnitApplication.mxml is created goto your project settings and update the following:
remove the dynamic {locale} compiler flag and add a specific '-locale=en_US' only.
if you have custom locale files add those to the source path manually
in the library path find the entry that points to the dynamic locale library '..sdk/../{locale} and copy the path. click on add SWC to library path. Paste the copied path and replace '{locale}' with 'en_US'
Generally this turns out favorable for me.

Kettle getStepMetaInterface() function error in Modified Script with MongoDB Output step

Using pentaho 5.3, Modified Java Script Value step to inject those data.
I want to dynamically set path and names in the MongoDB Output step. Here is my code
var meta = new org.pentaho.di.trans.TransMeta( source_path );
var mongoStep = meta.findStep("MongoDB Output");
mongoStep.setDescription('This is MongoDB Output by Ray');
Alert(mongoStep.getName()); // code is ok until here.
var mongoStepMeta = mongoStep.getStepMetaInterface() // error occurs here
When I want to get the getStepMetaInterface() to use step functions, the error occurs.
java.lang.LinkageError: loader constraint violation: loader (instance of org/pentaho/di/core/plugins/KettleURLClassLoader) previously initiated loading for a different type with name "org/pentaho/metastore/api/IMetaStore"
This error seems to be generated by the violation of .jar.
But when I use those original steps, like "Microsoft Access Input", I can successfully get getStepMetaInterface(). In this way, I can use all the functions defined in AccessInputMeta.java.
From my point of view, this problem may have a relation to the MongoDB Output step, because this is a plugin for kettle, but I am not sure.
Any response is appreciated!!
Yep, it's because of the plugin system. The Modified Java Script step and the Access Input step (among many others) are all in the Kettle engine and share a classloader. External plugins (like MongoDB Input/Output) have their own isolated classloaders. You have to do some voodoo with thread context classloaders and reflection in order to get at the Meta classes for those steps.
Here's an example of the hoops you have to jump through to get at external plugins (the Big Data plugin in this example) from the Modified Java Script step:
https://github.com/brosander/pentaho-hadoop-shims/blob/verification-2/test/verification/jobs/dependencies/ForceHiveToConnectRemotely.ktr
First, thanks to Mass who solves the problem.
Here is his advice:
This problem is caused by jar file conflict.
In pentaho installation there are two jar files:
-lib/metastore-5.3.0.0-213.jar
-plugins/pentaho-mongodb-plugin/lib/metastore-5.3.0.0-213.jar
Just remove the last jar file, this error will disappear.

Data.c file generation

i'm very new to matlab, i'm working on a software which needs the following files as input model.c,model.h,model_data.c for a particular simulink model. I have a model for which i can't generate model_data file using RTW, i have tried to get some information on the files generated by RTW, but i didnt get sufficient info. If there anybody who knows about the RTW please let me know the blocks which are required to generate model_data.c
thank you
model_data.c is a conditionally created file (i.e. it is only created if it is needed, which depends on the way the model is set up for code generation).
For a discussion of the Simulink Coder build process, and what files get generated when, search the doc for the section titled "Files and Folders Created by Build Process".
For others who need help in future.
Open the Configuration Parameters pane. Go to Code Generation -> Optimization and make sure that Default parameter behavior is set to Tunable.

Can't find 'Build.xml' after export Antenna files

I have made a J2ME program. This program will be used in 3 specific countries and has to support 7 different screen resolutions.
At the moment I have created 7 different builds for each resolution type and 3 variants in each for each of the 3 countries.
I am using LWUIT as my UI framework. I have configured MTJ with the following.
antenna-bin-1.2.1-beta.jar
WTK2.5.2_01
proguard4.8
on Eclipse 3.7.2
In the package explorer i right click on my project directory
select 'Export' (I couldn't find 'Export Antenna Build Files' under the 'Mobile Tools for Java' option)
I wait for it to do its thing.
I open the project folder and search for Build.xml. But can't find anything .
I find a folder called 'mtj-build' that contains another folder(custom-tasks) and two files mtj-build.properties and mtj-build.xml .
I want to able to write a build file that would be able to do the following
put in the correct resources according to the resolution its building
put in the correct theme according to the resolution its building
set the relevant attributes in the Application Descriptor file for each country
repeat this process automatically for each resolution and each country and place the respective .Jad and .Jar files in a particular folder structure as shown.
MainFolder:
{
Country1:{
Res1,
Res2,
Res3,
....},
Country2:{
Res1,
Res2,
Res3,
....},
Country3:{
Res1,
Res2,
Res3,
....},
....etc}
}
As I understand to do this I would need to set up a Build.xml. But then I can't find Build.xml after selecting the Export Antenna Build Files option.
How do I achieve this goal? Is it even possible to do this? Please do help . Thanks in Advance
===================UPDATE TO THIS POST #1======================
Follow the links mentioned by Eugen Martynov below.
on a side note: The reason I wasn't getting the option to Export Antenna Build files on the right click of the project was because they were referring to a customized version of the Eclipse IDE called Pulsar Eclipse.[ http://www.eclipse.org/pulsar/ ]
The Antenna build xml file generated by it is far more optimized than the one you get out of the standard Eclipse. I dunno why that is. But thats my Observation.
===================UPDATE TO THIS POST #2======================
Thanks for your suggestion Eugen. I will be writing a few sub Ant Build files to simplify my problem. I still have to figure out how to break this down.
Thanks for the link Telmo Pimentel Mota. In my current build I have 'wtkbuild' and 'wtkpackage'. And the build is working great. I just now have to figure out how to call or execute one build file from another following Eguen's suggestion.
I wouldn't give you complete answer but I give you way to find out it yourself.
Here about ant and building process. Here is building j2me with antenna. There are also should be examples of build.xml files in antenna sample folder. Here is alternate example about ant and building j2me without using antenna.
In your case you have to use different res folders and set different manifest options based on two additional properties country and resolution. You could pass properties outside build.xml by using properties file or by command line:
ant -f <path to build.xml> -D<property name>=<property value>