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 8890943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:36:55+00:00 2026-06-14T22:36:55+00:00

I trained a SimpleKMeans clusterer in Weka Explorer and saved the model to my

  • 0

I trained a SimpleKMeans clusterer in Weka Explorer and saved the model to my computer. Now I want to use it in my Java code to cluster an instance I create but I get the following error when I try to deserialize it:

java.io.InvalidClassException: weka.core.Instance; weka.core.Instance;
class invalid for deserialization at
java.io.ObjectStreamClass.checkDeserialize(Unknown Source) at
java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at
java.io.ObjectInputStream.readObject0(Unknown Source) at
java.io.ObjectInputStream.readArray(Unknown Source) at
java.io.ObjectInputStream.readObject0(Unknown Source) at
java.io.ObjectInputStream.defaultReadFields(Unknown Source) at
java.io.ObjectInputStream.readSerialData(Unknown Source) at
java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at
java.io.ObjectInputStream.readObject0(Unknown Source) at
java.io.ObjectInputStream.defaultReadFields(Unknown Source) at
java.io.ObjectInputStream.readSerialData(Unknown Source) at
java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at
java.io.ObjectInputStream.readObject0(Unknown Source) at
java.io.ObjectInputStream.defaultReadFields(Unknown Source) at
java.io.ObjectInputStream.readSerialData(Unknown Source) at
java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at
java.io.ObjectInputStream.readObject0(Unknown Source) at
java.io.ObjectInputStream.readObject(Unknown Source) at
weka.core.SerializationHelper.read(SerializationHelper.java:288) at
weka.core.SerializationHelper.read(SerializationHelper.java:270) at
Test.main(Test.java:32)

where line 32 of my Test class is

Clusterer kmeans_temp = (Clusterer) weka.core.SerializationHelper.read("path/to/model/myclusterermodel.model");

Am I doing it right?

  • 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-14T22:36:56+00:00Added an answer on June 14, 2026 at 10:36 pm

    The problem was because I was using two different versions of WEKA to create the model and deserialize the model. I downloaded the source code for the version I used for WEKA explorer and problem solved.

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

Sidebar

Related Questions

Using kernlab I've trained a model with code like the following: my.model <- ksvm(result
I trained a random forest: model <- randomForest(x, y, proximity=TRUE) When I want to
I've trained a classifier in Weka, and I'm able to use it on test
I've trained a simple logistic regression model in SSAS, using Gender and NIC as
I have a restfull webservice that requires loading trained model files and to create
I have a classifier that I trained using Python's scikit-learn. How can I use
i have a trained j48 classifier and i want to classify one record by
How do I save a trained Naive Bayes classifier to disk and use it
I'm new to java but my experience with Matlab and C trained me to
I have trained a NN with Back Propagation algorithm and calculated the MSE. Now

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.