Netbeans IDE Tutorial for using the Weka API



Similar documents
Java Language Tools COPYRIGHTED MATERIAL. Part 1. In this part...

Code Estimation Tools Directions for a Services Engagement

Using NetBeans to Compile and Run Java Programs

Installing the Android SDK

Installing (1.8.7) 9/2/ Installing jgrasp

Jenkins on Windows with StreamBase

Using Karel with Eclipse

Tutorial: setting up a web application

Eclipse installation, configuration and operation

Tutorial 5: Developing Java applications

WA2262 Applied Data Science and Big Data Analytics Boot Camp for Business Analysts. Classroom Setup Guide. Web Age Solutions Inc.

You must have at least Editor access to your own mail database to run archiving.

Hypercosm. Studio.

For Introduction to Java Programming, 5E By Y. Daniel Liang

Java Software Development Kit (JDK 5.0 Update 14) Installation Step by Step Instructions

WA1826 Designing Cloud Computing Solutions. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

ORACLE BUSINESS INTELLIGENCE WORKSHOP. Prerequisites for Oracle BI Workshop

Creating Web Services Applications with IntelliJ IDEA

Use ArcGIS Online to Manage

CEFNS Web Hosting a Guide for CS212

Primavera P6 Professional Windows 8 Installation Instructions. Primavera P6. Installation Instructions. For Windows 8 Users

USING STUFFIT DELUXE THE STUFFIT START PAGE CREATING ARCHIVES (COMPRESSED FILES)

Installing Ruby on Windows XP

Working With Your FTP Site

CSA Software Listing Table of Contents. Both Windows and Mac platforms are supported.

Hands-on Practice. Hands-on Practice. Learning Topics

Notepad++ The COMPSCI 101 Text Editor for Windows. What is a text editor? Install Python 3

Lab 0 (Setting up your Development Environment) Week 1

Introduction to Eclipse

Building and Using Web Services With JDeveloper 11g

The goal with this tutorial is to show how to implement and use the Selenium testing framework.

Creating a Java application using Perfect Developer and the Java Develo...

MEAP Edition Manning Early Access Program Hello! ios Development version 14

Alteryx Predictive Analytics for Oracle R

Titanium Mobile: How-To

NetBeans IDE Field Guide

Download and Installation Instructions. Android SDK and Android Development Tools (ADT)

Remote Desktop Web Access. Using Remote Desktop Web Access

Installing and using XAMPP with NetBeans PHP

How to FTP (How to upload files on a web-server)

Monitoring Oracle Enterprise Performance Management System Release Deployments from Oracle Enterprise Manager 12c

Informatics for Integrating Biology & the Bedside. i2b2 Workbench Developer s Guide. Document Version: 1.0 i2b2 Software Release: 1.3.

Q N X S O F T W A R E D E V E L O P M E N T P L A T F O R M v Steps to Developing a QNX Program Quickstart Guide

Staying Organized with the Outlook Journal

Instructions to view & create.kmz/.kml files from Google Earth

Business Intelligence Office of Planning Planning and Statistics Portal Overview

Quick and Easy Solutions With Free Java Libraries Part II

Automating client deployment

Product Guide Nintex. All rights reserved. Errors and omissions excepted.

Intelligent Event Processer (IEP) Tutorial Detection of Insider Stock Trading

Implementing the Shop with EJB


SPHOL207: Database Snapshots with SharePoint 2013

RingCentral from AT&T Desktop App for Windows & Mac. User Guide

Lesson 1 - Creating a C18 Project with MPLAB

Basic Web Fullerton College

CDUfiles User Guide. Chapter 1: Accessing your data with CDUfiles. Sign In. CDUfiles User Guide Page 1. Here are the first steps to using CDUfiles.

Distributing forms and compiling forms data

Instructions for Configuring a SAS Metadata Server for Use with JMP Clinical

How to Install Eclipse. Windows

Waspmote IDE. User Guide

How to test and debug an ASP.NET application

WA Continuous Integration with Jenkins- CI, Maven and Nexus. Classroom Setup Guide. Web Age Solutions Inc. Web Age Solutions Inc.

Mesa DMS. Once you access the Mesa Document Management link, you will see the following Mesa DMS - Microsoft Internet Explorer" window:

Crystal Reports for Eclipse

Setting Up Your Android Development Environment. For Mac OS X (10.6.8) v1.0. By GoNorthWest. 3 April 2012

JBoss Portal 2.4. Quickstart User Guide

Getting Started using the SQuirreL SQL Client

EMC Documentum Composer

Workshop for WebLogic introduces new tools in support of Java EE 5.0 standards. The support for Java EE5 includes the following technologies:

Eclipse with Mac OSX Getting Started Selecting Your Workspace. Creating a Project.

SAML single sign-on configuration overview

Introduction and overview view of Citrix ShareFile provisioning. Preparing your Citrix ShareFile account for provisioning

Mapping ITS s File Server Folder to Mosaic Windows to Publish a Website

Data Crow Creating Reports

Adobe Summit 2015 Lab 718: Managing Mobile Apps: A PhoneGap Enterprise Introduction for Marketers

Searching your Archive in Outlook (Normal)

What is OneDrive for Business at University of Greenwich? Accessing OneDrive from Office 365

Oracle Managed File Getting Started - Transfer FTP Server to File Table of Contents

E-commerce. Further Development 85

Umbraco Content Management System (CMS) User Guide

Installation & Configuration Guide Professional Edition

A Java Crib Sheet. First: Find the Command Line

JustClust User Manual

Backing Up and Restoring the Database

Oracle SOA Suite 11g Oracle SOA Suite 11g HL7 Inbound Example

EViews supports online access to EIA data via the EIA web server as well as offline access to data downloaded in the EIA Bulk File format.

Create a PDF File. Tip. In this lesson, you will learn how to:

SchoolMessenger for Android

Practice Fusion API Client Installation Guide for Windows

Toad for Data Analysts, Tips n Tricks

Chapter 4: Website Basics

IDS 561 Big data analytics Assignment 1

How to Run Java Programs Using Microsoft J++

Previewing & Publishing

IBM. Implementing SMTP and POP3 Scenarios with WebSphere Business Integration Connect. Author: Ronan Dalton

ADMINISTRATORS GUIDE EPISUITE 6

Website Development Komodo Editor and HTML Intro

Setting up Sudoku example on Android Studio

Transcription:

Netbeans IDE Tutorial for using the Weka API Kevin Amaral University of Massachusetts Boston First, download Netbeans packaged with the JDK from Oracle. http://www.oracle.com/technetwork/java/javase/downloads/jdk-7-netbeans-download- 432126.html You need to accept the license agreement (unless you disagree with the licensing terms). After which, you should choose the package that corresponds with the machine you re going to be using the IDE on. Machines in the Unix Lab and Web Lab should have NetBeans installed already. Follow the installer and avoid installing the Ask! Toolbar or McAfee in the event that they are offered by the installer. You won t need either of them to use Netbeans.

Once Netbeans is installed, run the IDE and create a new project.

We re going to be creating this project as a new application.

On the next screen, give the project a name and uncheck Create Main Class. That option will just give you more headaches later on if you re not familiar with java packages. At this point, click Finish. You should be back at the main IDE window.

If you ve navigated the Weka program folder, you ll notice something called JAR files. They re actually what we re going to be using to expose the Weka API to Netbeans so that you can program in Java with the same flexibility as the Weka GUI, and possibly more.

Navigate to the Weka folder in the file dialog and select the weka.jar file. You may notice that there s a weka-src.jar file, as well. If you re feeling adventurous, at another time, you can extract files from that JAR with WinRAR or similar archiving tools. That is all the human readable source that, when compiled, becomes the Weka program you used in Homework 1. For our purposes, only worry about the weka.jar.

Now, we can start programming. Create a new java class in the Default Package. This is commonly bad practice when making an actual application, but we re doing experiments, not making the next Word Processor or Internet Browser. Click Finish and you should be brought to a text editor window where you ll be programming in Java. For those that haven t programmed in Java before, it s a very structured language that is driven by object orientation. Oracle has some good resources for understanding the basic principles of Java. They can be found here: http://docs.oracle.com/javase/tutorial/java/index.html

I m going to be providing source code for you all to look at and pick apart as a demo, but I m going to explain a few things first. First of all, this: When you see errors like this, it usually means the type of object you want to use isn t imported. By default, Java doesn t import every object you could possibly use. This is a good thing even if it makes your life a little tougher. Sometimes object types have the same names across different packages, so Java makes you choose explicitly. When you see those underlined errors, you can usually use the Hint Icons on the left to remedy them, like so:

Believe it or not, this is actually a reasonable amount of imports when using an imported API. That method I just showed you is going to be necessary for reading data files. However, there s something you need to know about the value of filename when you call it. It is either a direct path or a relative path. A direct path will be something like C:\directory\data.arff and a relative path will be something as simple as data.arff. Direct paths are usually OS dependent, so you should use relative paths whenever possible. But where does the program look for files in a relative path?

If we switch to the files tab, on the left, we see the directory structure of the Java project folder. Here, we can click and drag datafiles that we intend to use with the project right into the folder.

Now that that s done, we can use the following line in our code and it will correctly read from the data file we want to use. This method is the main method. It is the program s entry point, where the first lines of code are executed. Java is an imperative language of commands and declarations, with each line of code happening in the order that it s written, for the most part. Method definitions allow you to name frequently used subroutines so that you can use them more than once without having to write them out each time. This is what I ve done with readdatafile. If you looked at the method earlier, you can see why I wouldn t want to write that more than once. You ll notice that I ve added throws Exception to the end of the main method. This is bad style, but it relieves a few coding-headaches (fewer try-catch statements littered across your code). If your code works, you won t need to worry about it. My finished WekaTest.java source file is here: http://www.cs.umb.edu/~axoren1/weka_netbeans_tutorial/wekatest.java One last thing: Now that you have a java program, how do you run it in Netbeans?

After you ve done that, your program s output should be in the bottom-left section of the Netbeans window. You should be all set, now. Happy coding!