Starting with WEKA ...

classic Classic list List threaded Threaded
2 messages Options
JC
Reply | Threaded
Open this post in threaded view
|

Starting with WEKA ...

JC
Hi everyone!

I am new in Machine Learning and I would like learn how to use WEKA because
finally I will try to do my project using Apache Spark MLlib + Java + WEKA.

I have been reading you time ago and now I want to try use WEKA

I am working with this .arff file:

*.arrf file*

@relation pruebas

@attribute 'ID Patient' {'Cristian Neagu',Vera}
@attribute Institution {Teamnet,V11app}
@attribute Register {'2018-01-16 12:23:15','2018-01-16 12:19:13','2018-01-16
12:23:48','2018-01-16 12:23:54','2018-01-16 12:27:43','2018-01-16
12:30:29','2018-01-16 12:39:07','2018-01-16 12:39:21','2018-01-16 12:44:09'}
@attribute ECG/EKG {'1, -0.04, 0.16, -0.05, 0.06, 0.18, 0.01, 0.34, -0.08,
-0.44, -0.64, 0.05, -0.18, -0.37, -0.27, -0.04, -0.25, -0.19, -0.08,
-0.30','-1.50, -1.50, -1.50, -1.50, -1.50, -1.50, -1.50, -1.50, -1.50,
-1.50, -1.50, -1.50, -1.50, -1.50, -1.50, -1.50, -1.50, -1.50, -1.50,
-1.50'}
@attribute Temp numeric
@attribute 'SPO2 Min' numeric
@attribute 'SPO2 Max' numeric
@attribute 'BPM Min' numeric
@attribute 'BPM Max' numeric
@attribute 'BPM Avg' numeric
@attribute SYS numeric
@attribute DIA numeric
@attribute 'EDA Min' numeric
@attribute 'EDA Max' numeric
@attribute 'EDA Avg' numeric
@attribute 'Result Deleted' {N}
@attribute 'Result Uploaded' {Y}
@attribute 'Date Uploaded' {'2018-01-16 12:23:20','2018-01-16
12:28:51','2018-01-16 12:30:36','2018-01-16 12:44:24'}
@attribute 'Date Deleted' {N}

@data

...

And I am having some errors when I try to use differents algorithms, for
example:

   - NaiveBayes: java.lang.IllegalArgumentException: Cannot handle unary
class!
   - J48: java.lang.IllegalArgumentException: Cannot handle unary class!

I'm using this calls from Eclipse using Java:
   - String command = "java -classpath
$CLASSPATH:/home/stu/Desktop/Programms/weka-3-8-3/weka.jar
weka.classifiers.trees.J48 -C 0.25 -M 2 -X 3 -t
/home/stu/Desktop/Programms/HPdata/datafinal/*.arff";

In cmd: java -classpath
$CLASSPATH:/home/stu/Desktop/Programms/weka-3-8-3/weka.jar
weka.classifiers.trees.J48 -C 0.25 -M 2 -X 3 -t
/home/stu/Desktop/Programms/HPdata/datafinal/*.arff
               

What's could be the problem? Can't I use these algorithms with my data? or I
am wrong with something.

Thank you guys for reading and try to help me.
Regards.



--
Sent from: http://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Starting with WEKA ...

Eibe Frank-2
Administrator
By default, WEKA assumes the last attribute in the data is the class attribute, i.e., the attribute whose value it tries to learn to predict given the values of the other attributes. In your case, this is “Date Deleted”, which only has a single value (i.e., it is “unary”). You need to specify a different class attribute.

Consider taking a look at the free online WEKA courses at

  https://www.cs.waikato.ac.nz/ml/weka/courses.html

to get a better understanding of how to perform classification or regression in WEKA.

Cheers,
Eibe

> On 11/01/2019, at 10:33 PM, JC <[hidden email]> wrote:
>
> Hi everyone!
>
> I am new in Machine Learning and I would like learn how to use WEKA because
> finally I will try to do my project using Apache Spark MLlib + Java + WEKA.
>
> I have been reading you time ago and now I want to try use WEKA
>
> I am working with this .arff file:
>
> *.arrf file*
>
> @relation pruebas
>
> @attribute 'ID Patient' {'Cristian Neagu',Vera}
> @attribute Institution {Teamnet,V11app}
> @attribute Register {'2018-01-16 12:23:15','2018-01-16 12:19:13','2018-01-16
> 12:23:48','2018-01-16 12:23:54','2018-01-16 12:27:43','2018-01-16
> 12:30:29','2018-01-16 12:39:07','2018-01-16 12:39:21','2018-01-16 12:44:09'}
> @attribute ECG/EKG {'1, -0.04, 0.16, -0.05, 0.06, 0.18, 0.01, 0.34, -0.08,
> -0.44, -0.64, 0.05, -0.18, -0.37, -0.27, -0.04, -0.25, -0.19, -0.08,
> -0.30','-1.50, -1.50, -1.50, -1.50, -1.50, -1.50, -1.50, -1.50, -1.50,
> -1.50, -1.50, -1.50, -1.50, -1.50, -1.50, -1.50, -1.50, -1.50, -1.50,
> -1.50'}
> @attribute Temp numeric
> @attribute 'SPO2 Min' numeric
> @attribute 'SPO2 Max' numeric
> @attribute 'BPM Min' numeric
> @attribute 'BPM Max' numeric
> @attribute 'BPM Avg' numeric
> @attribute SYS numeric
> @attribute DIA numeric
> @attribute 'EDA Min' numeric
> @attribute 'EDA Max' numeric
> @attribute 'EDA Avg' numeric
> @attribute 'Result Deleted' {N}
> @attribute 'Result Uploaded' {Y}
> @attribute 'Date Uploaded' {'2018-01-16 12:23:20','2018-01-16
> 12:28:51','2018-01-16 12:30:36','2018-01-16 12:44:24'}
> @attribute 'Date Deleted' {N}
>
> @data
>
> ...
>
> And I am having some errors when I try to use differents algorithms, for
> example:
>
>   - NaiveBayes: java.lang.IllegalArgumentException: Cannot handle unary
> class!
>   - J48: java.lang.IllegalArgumentException: Cannot handle unary class!
>
> I'm using this calls from Eclipse using Java:
>   - String command = "java -classpath
> $CLASSPATH:/home/stu/Desktop/Programms/weka-3-8-3/weka.jar
> weka.classifiers.trees.J48 -C 0.25 -M 2 -X 3 -t
> /home/stu/Desktop/Programms/HPdata/datafinal/*.arff";
>
> In cmd: java -classpath
> $CLASSPATH:/home/stu/Desktop/Programms/weka-3-8-3/weka.jar
> weka.classifiers.trees.J48 -C 0.25 -M 2 -X 3 -t
> /home/stu/Desktop/Programms/HPdata/datafinal/*.arff
>
>
> What's could be the problem? Can't I use these algorithms with my data? or I
> am wrong with something.
>
> Thank you guys for reading and try to help me.
> Regards.
>
>
>
> --
> Sent from: http://weka.8497.n7.nabble.com/
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html