Code Monkey home page Code Monkey logo

Comments (2)

QinbinLi avatar QinbinLi commented on September 17, 2024

Hi @stamatisvas ,

It seems that you did not specify num_class parameter, which should be equal to the number of classes of your dataset.

from fedtree.

stamatisvas avatar stamatisvas commented on September 17, 2024

Yes, this was the problem and it is now working. Thank you! However, having a trained model I faced the following problems

  1. I want to use the Python interface in order to use the trained model and predict the test data (csv). What format should the test data follow? i.e during the training I used a csv file: [id, y, x1, x2, x3, x4, x5, x6, x7, x8, x9]. I tried the usual approaches for the test data like dropping the label and others but I am getting always the error

predictions = federatedcsvmodel.predict(X_test)

2023-05-26 12:06:21,520 INFO [default] #instances = 10845, #features = 11
2023-05-26 12:06:21,526 INFO Performance checkpoint [init trees] for block [predict] : [1 ms]
2023-05-26 12:06:21,527 INFO Performance checkpoint [copy data] for block [predict] : [2 ms ([0 ms] from checkpoint 'init trees')]
2023-05-26 12:06:21,683 INFO Executed [predict] in [158 ms]
free(): invalid pointer

  1. When I run from the terminal ./build/bin/FedTree-predict ./predict.conf where predict.conf points to the csv test data the output in the terminal is this:

2023-05-26 12:09:06,024 INFO dataset.cpp:396 : loading csv dataset from file ## /media/sf_Shared_Ubuntu_Windows/fedtree_data/test_data.csv ##
2023-05-26 12:09:06,142 INFO dataset.cpp:567 : #instances = 10845, #features = 10
2023-05-26 12:09:06,142 INFO dataset.cpp:581 : Load dataset using time: 0.117392 s
2023-05-26 12:09:06,161 INFO fedtree_predict.cpp:75 : multi-class accuracy = 0.984417

which makes sense (I am getting 99% accuracy with centralized models). However, the prediciton.txt file that is saved in the folder has totally random predictions most of which are 0, and this results in 0% accuracy when checking it manually.

from fedtree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.