-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'psx' is not defined in get_noise_indices() - issue for WINDOWS python users #16
Comments
I also have the same issue |
@cgnorthcutt I also have the same issue |
Hi folks @UCASREN @awoloshuk @stonk97 Thanks for sharing. I am unable to reproduce your error. here is a full working (for me) set of code, intended to reproduce your error. import cleanlab
from cleanlab.latent_estimation import estimate_py_noise_matrices_and_cv_pred_proba
from sklearn.naive_bayes import GaussianNB
from sklearn.datasets import load_digits
from cleanlab.pruning import get_noise_indices
data = load_digits()
X_train = data['data']
y_train = data['target']
est_py, est_nm, est_inv, confident_joint, my_psx = estimate_py_noise_matrices_and_cv_pred_proba(
X=X_train,
s=y_train,
clf = GaussianNB()
)
label_errors = get_noise_indices(
y_train,
my_psx,
verbose=1,
) However, I have no issues running this code. Can you give me more information for each of you about why you're having the error? Also can you each include python version, how you installed cleanlab, os version, etc. after running exactly the code above? |
I install cleanlab with 'pip install cleanlab', python version is 3.7.4, and Win10 environment. When I run cleanlab-master/examples/iris_simple_example.ipynb, it gets below errors: ` Now we show the improvement using confident learning to characterize the noise WITH confident learning (noise matrix given), RemoteTraceback Traceback (most recent call last) The above exception was the direct cause of the following exception: NameError Traceback (most recent call last) D:\ProgramData\Anaconda3\lib\site-packages\cleanlab\classification.py in fit(self, X, s, psx, thresholds, noise_matrix, inverse_noise_matrix) D:\ProgramData\Anaconda3\lib\site-packages\cleanlab\pruning.py in get_noise_indices(s, psx, inverse_noise_matrix, confident_joint, frac_noise, num_to_remove_per_class, prune_method, sorted_index_method, multi_label, n_jobs, verbose) D:\ProgramData\Anaconda3\lib\multiprocessing\pool.py in map(self, func, iterable, chunksize) D:\ProgramData\Anaconda3\lib\multiprocessing\pool.py in get(self, timeout) NameError: name 'psx' is not defined @cgnorthcutt , thank you! |
@UCASREN can you please run my example above? |
SOLUTIONAlso can everyone @stonk97 @awoloshuk @UCASREN please try changing the pruning line to label_errors = get_noise_indices(
y_train,
my_psx,
n_jobs=1, # BE SURE TO ADD THIS -- it turns off multiprocessing
) where i have turned off multiprocessing. My guess is that multiprocessing in python is not working correctly with Windows. For now, this work-around (turning off multiprocessing) should solve your issue. |
@cgnorthcutt yes, when I change the pruning line, it is working properly. Thank you very much~ |
@cgnorthcutt the code you wrote runs perfectly! I think you spotted the problem...Windows |
@cgnorthcutt , I am implementing Rank Pruning algorithm on IRIS dataset, after using below mentioned code, "NameError: name 'psx' is not defined" is resolved. but now it is "NameError: name 'my_psx' is not defined" |
Yes because |
@kagalkot @stonk97 @awoloshuk @UCASREN Issues using Windows should be fixed. The main commit with the fix is cgnorthcutt@cf93242. cleanlab now supports Windows multiprocessing and Python 3.4, 3.5, 3.6, 3.7 natively. Upgrade your cleanlab version to 0.1.1 for the fix. To update just type |
This is my code:
I'm still getting this error, even if psx is declared as global in pruning.py
The text was updated successfully, but these errors were encountered: