question

Upvotes
Accepted
1 1 1 3

ModuleNotFoundError: No module named 'LabelBuilders'

Article: Idiosyncratic risk ranking using eXplainable AI

https://github.com/Refinitiv-API-Samples/Article.RD.XAI.Python.Explaining.Idiosyncratic.Risk


-----------------------------------------------------------------------------------------------------------------

# Label Builder

class LabelBuilders:

def __init__(self, beta_window) -> None:

self.beta_window = beta_window

-----------------------------------------------------------------------------------------------------------------

# Feature Engineering

import pandas as pd

import numpy as np

import torch


from LabelBuilders import LabelBuilder

from functools import reduce

from utilities import drop_features, study_features

----------------------------------------------------------------------------------------------------------------

Error Message

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[4], line 8
      6 from sklearn.preprocessing import MinMaxScaler, OneHotEncoder
      7 from tqdm import tqdm
----> 8 from LabelBuilders import LabelBuilder
      9 from functools import reduce
     10 from utilities import drop_features, study_features

ModuleNotFoundError: No module named 'LabelBuilders'


-----------------------------------------------------------------------------------------------------------------

How to solve it?


python#technologyerrormodule
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @thseol ,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,
AHS

@thseol

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

Upvote
Accepted
78.6k 248 52 74

@thseol

I think the LabelBuilder is available on GitHub.

1691566942639.png


The FeatureEngineering.py uses this class: LabelBuilder.

1691567009761.png


The code in the question is different from GitHub. There is no LabelBuilders.



1691566942639.png (42.3 KiB)
1691567009761.png (47.2 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
24.6k 54 17 14

Hello @thseol

Thank you for contacting us. However, this Q&A forum is for Refinitiv APIs general usage questions only. Which Refinitiv APIs that you are using?

By the way, the "ModuleNotFoundError: No module named 'LabelBuilders'" indicates that the Python cannont find the LabelBuilders library in the environment. Did you install the library yet?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 1 1 3

Download the script from https://github.com/Refinitiv-API-Samples/Article.RD.XAI.Python.Explaining.Idiosyncratic.Risk

change the filename extension from .py to .ipynb

Running on jupyter notebook

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thank you for answering

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.