Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8417273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:59:38+00:00 2026-06-10T01:59:38+00:00

I added the Weka.jar file to my environment variables and can already loadARFF files

  • 0

I added the Weka.jar file to my environment variables and can already loadARFF files into Matlab and read the instances. Now I would like to perform batch attribute selection on a set of training and testing pairs of files but I cannot seem to find any tutorials on how to do that from Matlab.

I do not want to do it through weka command line because I have a set of 15 training files, and 15 test files for only one trial (and I have many trials with different ARFF files) hence I wanted to loop through them fast from Matlab.

Your help will be highly appreciated 🙂 thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:59:40+00:00Added an answer on June 10, 2026 at 1:59 am

    Two things:

    First, if you are in the MATLAB Desktop (the MATLAB console) and you preface your command with an exclamation point (!) then you can run command-line arguments. This works in scripts (.m MATLAB files) too.

    Ex:

    >> !man ls
    

    What this means is that the things you can do in a terminal (like from this tutorial), you should be able to do in MATLAB.

    Second, you can access Java libraries from MATLAB. You can access functions from weka.attributeSelection by importing it into your MATLAB workspace and then using the methods you need as you would do in java. For example, here’s a .m file written by Matthew Dunham that imports a weka library (weka.core.converters.ArffLoader) and uses it in a .m file:

    function wekaOBJ = loadARFF(filename)
    % Load data from a weka .arff file into a java weka Instances object for
    % use by weka classes. This can be converted for use in matlab by passing
    % wekaOBJ to the weka2matlab function. 
    %
    % Written by Matthew Dunham
    
        if(~wekaPathCheck),wekaOBJ = []; return,end
        import weka.core.converters.ArffLoader;
        import java.io.File;
    
        loader = ArffLoader();
        loader.setFile(File(filename));
        wekaOBJ = loader.getDataSet();
        wekaOBJ.setClassIndex(wekaOBJ.numAttributes -1);
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I added InAppSettingsKit in my project but the files are not being compiled, can
I added the composite_primary_keys gem in my Gemfile. On local environment it runs fine,
Added the for the facebook badge to the site and now it's thrown my
I added those green arrow buttons on a side of each picture, and now
I added a pagination, but now it shows 20 places then waits 2s, shows
I added this to my already existing JQuery tab: function createTab(name) { // this
Added the following parameter in context.xml <Parameter name=channel value=any override=false/> I want to read
I added a new column to a table called price_request_date because I now need
so I have a project that requires Weka machine learning library (weka.jar) and the
Added Castle.Facilities.NHibernateIntegration via NuGet, and now when I try to run the site, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.