Giter Site home page Giter Site logo

Comments (8)

mattwright99 avatar mattwright99 commented on July 29, 2024

@adekusar-drl I am interesting in picking up this ticket. Here is what I am thinking right now:

  • Add a method to NeuralNetworkClassifier that has a parameter categorical_cols which is a list of column indices that are then one-hot encoded. unless there a way you can think of to convert categorical data automatically?
  • Call this method at the start of fit, predict, and score.

Alternatively, I could implement this function in the dataset_helper script or somewhere else so it can be used in other models or by the user as a preprocessing step.
What do you think?

from qiskit-machine-learning.

adekusar-drl avatar adekusar-drl commented on July 29, 2024

Hi, in general you are right. So, first of all, please take a look at OneHotEncoder from sklearn, I hope we can make use of it instead of implementing a conversion login from scratch. Next, I'm not sure we need categorical_cols right away, we have a basic classifier that does not accept different type of labels, so should be easy to derive a label type from true labels.
Anyway, any suggestions are very welcome as some exploration is required here.

from qiskit-machine-learning.

mattwright99 avatar mattwright99 commented on July 29, 2024

Oh I see, I thought you were refering to categorical features not labels. That should be easy enough to infer and transform.
I will let you know if I have any other questions!

from qiskit-machine-learning.

adekusar-drl avatar adekusar-drl commented on July 29, 2024

I don't know why I was thinking of labels only. Categorical features can be also a case, but such feature would require even more exploration and investigation. There's also LabelEncoder in sklearn that may help.

from qiskit-machine-learning.

mattwright99 avatar mattwright99 commented on July 29, 2024

Ya categorical features would be interesting but slightly more complicated. I think we would either need to have the user preprocess the data before instantiating the model to specify number of qubits or we would have to use PCA to force the encoding dimensionality to fit the number of qubits. Could be a cool task but might warrant its own issue/PR.
And yes I have been looking into sklearn's LabelEncoder and OneHotEncoder. Thanks for the recommendation.

from qiskit-machine-learning.

adekusar-drl avatar adekusar-drl commented on July 29, 2024

On the top level, I think, we should keep interfaces as simple as possible and, by default, users should not bother of number of qubits and so on. And in the same time the interfaces should be flexible, so experienced users can tweak model in a way they want. Yeah, feel free to split the work into two or more PRs.

from qiskit-machine-learning.

mattwright99 avatar mattwright99 commented on July 29, 2024

@adekusar-drl while we wrap this ticket up, I would be interested in exploring how to automatically handle categorical features, if you think that would be valuable. Otherwise I would be happy finding another issue to take a look at.

Thoughts?

from qiskit-machine-learning.

adekusar-drl avatar adekusar-drl commented on July 29, 2024

Certainly, you can explore categorical features, but, honestly, I don't know what you may hit on this road.

from qiskit-machine-learning.

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.