Comments (9)
Can you post the error messages here? Without them, I cannot tell for sure.
Does your model work without modAL? Can you train it with your data? Because I don't think the 3D shape is a problem for modAL, since the data interacts with the model only. (I have tried other 3D shapes for image classification problems, they work fine.)
from modal.
This is the error message fot batch_uncertainty_sampling:
Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-2-c64fd087a5a2>", line 1, in <module> runfile('C:/Users/alexv/PycharmProjects/Active_Learning/active_learning_types/standard_modAL.py', wdir='C:/Users/alexv/PycharmProjects/Active_Learning/active_learning_types') File "C:\Program Files\JetBrains\PyCharm 2019.1.1\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "C:\Program Files\JetBrains\PyCharm 2019.1.1\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "C:/Users/alexv/PycharmProjects/Active_Learning/active_learning_types/standard_modAL.py", line 44, in <module> query_idx, query_instance = learner.query(x_pool, n_instances=20) File "C:\ProgramData\Anaconda3\lib\site-packages\modAL\models\base.py", line 194, in query query_result = self.query_strategy(self, *query_args, **query_kwargs) File "C:\ProgramData\Anaconda3\lib\site-packages\modAL\batch.py", line 197, in uncertainty_batch_sampling n_instances=n_instances, metric=metric, n_jobs=n_jobs) File "C:\ProgramData\Anaconda3\lib\site-packages\modAL\batch.py", line 150, in ranked_batch metric=metric, n_jobs=n_jobs) File "C:\ProgramData\Anaconda3\lib\site-packages\modAL\batch.py", line 82, in select_instance n_labeled_records, _ = X_training.shape ValueError: too many values to unpack (expected 2)
from modal.
This is the error for expected_error_reduction:
Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-2-c64fd087a5a2>", line 1, in <module> runfile('C:/Users/alexv/PycharmProjects/Active_Learning/active_learning_types/standard_modAL.py', wdir='C:/Users/alexv/PycharmProjects/Active_Learning/active_learning_types') File "C:\Program Files\JetBrains\PyCharm 2019.1.1\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "C:\Program Files\JetBrains\PyCharm 2019.1.1\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "C:/Users/alexv/PycharmProjects/Active_Learning/active_learning_types/standard_modAL.py", line 44, in <module> query_idx, query_instance = learner.query(x_pool, n_instances=20) File "C:\ProgramData\Anaconda3\lib\site-packages\modAL\models\base.py", line 194, in query query_result = self.query_strategy(self, *query_args, **query_kwargs) File "C:\ProgramData\Anaconda3\lib\site-packages\modAL\expected_error.py", line 64, in expected_error_reduction X_new = data_vstack((learner.X_training, x.reshape(1, -1))) File "C:\ProgramData\Anaconda3\lib\site-packages\modAL\utils\data.py", line 22, in data_vstack return np.concatenate(blocks) ValueError: all the input arrays must have same number of dimensions
Since this is the same code I used for the default query strategy and the same data I dont know how to tackle this error.
from modal.
What is the type and shape of your training data? Especially x_initial_training
and x_pool
, the problem seems to be with those.
For batch sampling, it seems to be that x_initial_training
is actually a 1D array. With expected error reduction, the problem can be the same if the shape of these arrays are different. Can you check these?
from modal.
x_pool is a numpy array with a shape of (31982, 10, 6) and type float.
x_inital_training is a numpy array with a shape of (636, 10, 6) and type float
from modal.
I'll try to figure out what went wrong soon. Not sure I can look into this during the weekend, but I'll fix this by the end of next week!
from modal.
Quick update: the bug is definitely in modAL, I am preparing a fix, it will be ready soon!
from modal.
thanks a lot for your effort!
Sent with GitHawk
from modal.
The fix is in! Now these query strategies work with multidimensional data. You can update your local installation by installing directly from the master branch:
pip install git+https://github.com/modAL-python/modAL.git
Let me know if there is a problem!
A small note. Expected error reduction will only work with scikit-learn models since this requires cloning and retraining the classifier, which might not work with Keras.
from modal.
Related Issues (20)
- keras image classification model using AL
- Error
- Multivariate Active regression
- How to extract the image names and labels in the training set after completing the active learning loop and write them to a CSV file
- decision_function instead of predict_proba HOT 5
- AttributeError: bootstrap_init HOT 3
- TypeError: cannot concatenate object of type '<class 'numpy.ndarray'>'; only Series and DataFrame objs are valid
- Can I use modAL with estimators from other libraries than scikit-learn like xgboost? HOT 1
- Which sampling method is best for very unbalanced data? HOT 1
- Encountering error with number of batches per epoch
- mmdetection integration with modAL
- Adding active learning regression implementations based on greedy sampling HOT 2
- modAL not installable via pypi anymore HOT 3
- the modAL package has been changed into modal in the pip repository HOT 7
- Data augmentation with `skorch`
- QBC approach for multi-class classification
- Suggestion on how to improve acquisition.UCB for active GP example HOT 1
- QBC stratified bootstrapping HOT 1
- Use modAL on BERT models HOT 1
- Spacy NER HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modal.