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

  • Home
  • SEARCH
  • 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 7403741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:09:16+00:00 2026-05-29T05:09:16+00:00

I am using libsvm to predict sentiment. I wanted to know what format the

  • 0

I am using libsvm to predict sentiment. I wanted to know what format the input has to be in
assuming I am using word count.

     [label] [index]:[value] [index]:[value]

That is required format from libsvm. So does that mean I just have two labels ( one for positive and one for negative), the index would be each word under that label and the value would be the frequency of each word ?

Does this also mean I need to store the mapping of word to index to use in my test set ?

  • 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-05-29T05:09:16+00:00Added an answer on May 29, 2026 at 5:09 am

    LIBSVM uses the so called “sparse” format where zero values do not need to be stored. Hence a data with attributes
    5 0 2 0
    is represented as
    1:5 3:2
    Therefore, you only need to specifiy the index and the value of nonzero attributes.

    Labels stand in the first column. For binary cases you may use +1 for positive and -1 for negative samples. By the way, you are not limited to only 2 labels. You can use other numbers (e.g. 1,2,3,4,5,…)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Java, assuming v1.6. I have a collection where the unique index is a
Using C#, I need a class called User that has a username, password, active
I'm using libsvm and the documentation leads me to believe that there's a way
I am considering using libsvm. Currently, I have transformed my feature vectors to SVM
I am using libsvm (svmutils) from python for a classification task. The classifier is
I am using the LibSVM tool for my support vector classification implementation:- The first
Using C++ preprocessor directives, is it possible to test if a preprocessor symbol has
Using jQuery, how do I get the value from a textbox and then load
I am in dire need of a classification task example using LibSVM in python.
I'm using libsvm library in my project and have recently discovered that it provides

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.