semantic-router icon indicating copy to clipboard operation
semantic-router copied to clipboard

'HybridRouteLayer' object has no attribute 'fit' and evaluate

Open shankara-93 opened this issue 10 months ago • 3 comments

HybridRouteLayer lacks built-in functionalities such as fit or evaluate. How can this limitation be addressed?

shankara-93 avatar Apr 04 '24 13:04 shankara-93

Hello, @shankara-93! :]

The fit() method in RouteLayer only attemps to find the optimal thresholds. I have yet to see that it improves performance for my applications, so I would think the SR team has not put that much effort into adding it for the HybridRouteLayer class, which is more recent.

I guess this feature could be added to HybridRouteLayer as well, but then I would try to use inheritance here between the two classes. I would think this method will be very similar, if not identical, for the HybridRouteLayer.

@jamescalam, @bruvduroiu: I can draft a PR now if this feature is of interest :]

andreped avatar Apr 05 '24 13:04 andreped

@andreped I think it'd be great to add fit() to HybridRouteLayer — at some point, we'll create a BaseRouteLayer and base both from this, but we are happy with a more direct solution in the meantime. Let us know if/how we can help!

jamescalam avatar Apr 07 '24 14:04 jamescalam

@jamescalam Sure. I can make an attempt later today :]

I was thinking of introducing class weights to the pooling method as well, which would enable developers to introduce a priori biases to certain classes. We have one application where this would be of interest already.

andreped avatar Apr 07 '24 15:04 andreped