Conversation
2. changed the value in the pop-up to the enum value for generalization
….9.0 it has np.float which was removed in later versions of numpy
…part_directionality_df_dir so this is an implementation of how to read the directory tree
…part_directionality_df_dir so this is an implementation of how to read the directory tree
…part_directionality_df_dir so this is an implementation of how to read the directory tree
1. added freezing feature extractor 2. fixed bug in data.py, that didnt run the user defined class 3. changed the arg name in read_all_files_in_folder_mp_futures func to be more specific 4. fixed error in "apply all" button in ROI menu. 5. move the button of extract features below the "apply" button, UX reason, but not important 6. added a new function that take the annotation file and concatenate it with the feature file. 7.
1. added imbalance random forest and the infrastructure for more machine learning algorithms that has the methods "fit" and "predict" 2. added 2 buttons that enables running a model on all the project data. 3. added method to detect and return graphviz dot if it exists on the computer, have tested on linux.
and moved all the machine learning vals to a single enum
assigning changes in enums
# Conflicts: # simba/SimBA.py # simba/data_processors/directing_animal_to_bodypart.py # simba/mixins/config_reader.py # simba/mixins/pop_up_mixin.py # simba/mixins/train_model_mixin.py # simba/model/train_rf.py # simba/ui/pop_ups/direction_animal_to_bodypart_settings_pop_up.py # simba/utils/data.py # simba/utils/enums.py
# Conflicts: # simba/ui/pop_ups/validation_plot_pop_up.py # simba/utils/enums.py
| CHUNK_SIZE = 1 | ||
| SPLASH_TIME = 2500 | ||
| WELCOME_MSG = f'Welcome fellow scientists! \n SimBA v.{pkg_resources.get_distribution("simba-uw-tf-dev").version} \n ' | ||
| WELCOME_MSG = f'Welcome fellow scientists! \n SimBA v.{pkg_resources.get_distribution("simba-uw-tf-dev").version if importlib.util.find_spec("simba-uw-tf-dev") is not None else "dev"} \n ' |
There was a problem hiding this comment.
For some reason, importlib.util.find_spec("simba-uw-tf-dev") returns None in my python3.6 environment. Does something like this work on your end?
SPLASH_TIME = 2500
try:
WELCOME_MSG = f'Welcome fellow scientists! \n SimBA v.{pkg_resources.get_distribution("simba-uw-tf-dev").version} \n '
except pkg_resources.DistributionNotFound:
WELCOME_MSG = f'Welcome fellow scientists! \n SimBA v. "dev" \n '
BROWSE_FOLDER_BTN_TEXT = 'Browse Folder'
There was a problem hiding this comment.
yes, i dont like the try except methodology in python but obviously it would work
| Ear_left_1,Ear_right_1,Nose_1,Center_1,Lat_left_1,Lat_right_1,Tail_base_1,Tail_end_1,Ear_left_2,Ear_right_2,Nose_2,Center_2,Lat_left_2,Lat_right_2,Tail_base_2,Tail_end_2 | ||
| 3D,,,,,,,,,,,,,,, | ||
| nose,left_ear,right_ear,tail_base,bug_center | ||
| nose,right_hand,left_hand,right_leg,left_leg,tail_base |
There was a problem hiding this comment.
Can we remove these two lines and revert to original bp_names.csv otherwise others get to see your body-part configs
| Multi-animals; 8 body-parts | ||
| 3D tracking | ||
| mouse_and_bug | ||
| from_below |
| 2 | ||
| 1 | ||
| 1 | ||
| 1 |
There was a problem hiding this comment.
👍🏻 I know in development this FileExistError can be a bit of a headache :) but a bit nervous about about letting users overwrite previous data by mistake.
There was a problem hiding this comment.
This makes a lot of sense thanks @tzukpolinsky
There was a problem hiding this comment.
Just a note we should chat about this one, not sure when this is needed
| "25", | ||
| validation="numeric", | ||
| ) | ||
| self.estimators_entrybox.entry_set(val=2000) |
There was a problem hiding this comment.
Thanks for doing this one.. remember you mentioned it but never got to it
There was a problem hiding this comment.
Maybe worth adding a default value just in case trouble reading from config? E.g., n_estimators = read_config_entry(self.config, ConfigKey.CREATE_ENSEMBLE_SETTINGS.value, MachineLearningMetaKeys.RF_ESTIMATORS.value, data_type=Dtypes.INT.value, default_value=2000)?
| ) | ||
|
|
||
| self.estimators_entrybox.entry_set(val=n_estimators) | ||
| max_features = read_config_entry( |
There was a problem hiding this comment.
And same here? max_features = read_config_entry(self.config, ConfigKey.CREATE_ENSEMBLE_SETTINGS.value, MachineLearningMetaKeys.RF_MAX_FEATURES.value, data_type=Dtypes.STR.value, default_value=self.max_features_options[0])
| self.hyperparameters_frm, "Criterion: ", self.criterion_options, "25" | ||
| ) | ||
| self.criterion_dropdown.setChoices(self.criterion_options[0]) | ||
| train_test_size = read_config_entry( |
There was a problem hiding this comment.
train_test_size = read_config_entry(self.config, ConfigKey.CREATE_ENSEMBLE_SETTINGS.value, MachineLearningMetaKeys.TT_SIZE.value, data_type=Dtypes.STR.value, **default_value="0.2"**)
| Options.TRAIN_TEST_SPLIT.value, | ||
| "25", | ||
| ) | ||
| self.train_test_type_dropdown.setChoices(Options.TRAIN_TEST_SPLIT.value[0]) |
There was a problem hiding this comment.
train_test_split_type = read_config_entry( self.config, ConfigKey.CREATE_ENSEMBLE_SETTINGS.value, MachineLearningMetaKeys.TRAIN_TEST_SPLIT_TYPE.value, data_type=Dtypes.STR.value, default_value=Options.TRAIN_TEST_SPLIT.value[0]) ?
| self.train_test_size_dropdown.setChoices(self.meta["train_test_size"]) | ||
| self.min_sample_leaf_eb.entry_set(val=self.meta["rf_min_sample_leaf"]) | ||
| self.undersample_settings_dropdown.setChoices(self.meta["under_sample_setting"]) | ||
| self.behavior_name_dropdown.setChoices(self.meta[MachineLearningMetaKeys.CLASSIFIER]) |
There was a problem hiding this comment.
shouldn't this be MachineLearningMetaKeys.CLASSIFIER.**value**?
|
|
||
| if "train_test_split_type" in self.meta.keys(): | ||
| self.train_test_type_dropdown.setChoices(self.meta["train_test_split_type"]) | ||
| if MachineLearningMetaKeys.TRAIN_TEST_SPLIT_TYPE in self.meta.keys(): |
There was a problem hiding this comment.
Looks like typo here with train test size set for the train test split type?
simba/utils/enums.py
Outdated
| THIRD_PARTY_ANNOTATION_FILE_NOT_FOUND = "Annotations data file NOT FOUND" | ||
|
|
||
|
|
||
| class MetaKeys(Enum): |
There was a problem hiding this comment.
In the meta files, the header is named "classifier_name", ideally I'd like to keep that to not break compatibility with config files that are created with older versions. I'll insert another key in MachineLearningMetaKeys with classifier_name value. I bump into self.clf_name = meta_dict[MachineLearningMetaKeys.CLASSIFIER.value]
KeyError: 'classifier' when trying grid search rf
There was a problem hiding this comment.
Correction, I change the value to align in both meta configs and the project config...
2983e64 to
7caa291
Compare
0770948 to
a708b3a
Compare

so the list of fixes is:
1.Reordered code in the enum class and the machine learning interface.
2.Fixed an issue where non-existent files were being called for app visibility.
3.Resolved a problem with loading the ini file due to the absence of the 'file_types' parameter in the FileSelect class.
There are likely more fixes; feel free to inquire about each one. Manual testing was conducted prior to creating this pull request