Closed astronights closed 9 months ago
Hi @astronights,
Thank you for the interest in HiClass!
HiClass recognizes ambiguities and handles them accordingly. Internally, it creates separate nodes according to the parent it is coming from, which means that in your example it would have 2 separate nodes for class "D". Here is a small example showing how the prediction is not affected by ambiguity:
import numpy as np
from sklearn.linear_model import LogisticRegression
from hiclass import LocalClassifierPerNode
# Define data
X_train = [[1, 2], [3, 4]]
X_test = [[3, 4], [1, 2]]
Y_train = np.array(
[
["A", "B", "D", "E"],
["A", "C", "D", "F"],
],
dtype=object,
)
# Use random forest classifiers for every node
rf = LogisticRegression()
classifier = LocalClassifierPerNode(local_classifier=rf)
# Train local classifier per node
classifier.fit(X_train, Y_train)
# Predict
predictions = classifier.predict(X_test)
print(predictions)
Please, let me know if this answers your question.
Thank you for the clarification. Good to know that these discrepancies are handled.
Hi,
I have a use case where at some level in the hierarchy there are children that share the same class name.
How does HiClass handle this and is this safe or do these need to be deduplicated before hand?
I am looking for a representation as such
And not like this:
Can you help provide some insight into if there is support for this type of hierarchical tree? Thanks!