Skip to content

Commit

Permalink
FS change
Browse files Browse the repository at this point in the history
  • Loading branch information
AttriGhosh96 committed Aug 16, 2023
1 parent 854dae2 commit fbbdf60
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion _version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.5-alpha'
__version__ = '0.1.6-alpha'
Binary file modified autoqtl/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified autoqtl/__pycache__/autoqtl.cpython-310.pyc
Binary file not shown.
Binary file modified autoqtl/__pycache__/base.cpython-310.pyc
Binary file not shown.
Binary file modified autoqtl/__pycache__/decorators.cpython-310.pyc
Binary file not shown.
Binary file modified autoqtl/__pycache__/export_utils.cpython-310.pyc
Binary file not shown.
Binary file modified autoqtl/__pycache__/gp_deap.cpython-310.pyc
Binary file not shown.
Binary file modified autoqtl/__pycache__/gp_types.cpython-310.pyc
Binary file not shown.
Binary file modified autoqtl/__pycache__/operator_utils.cpython-310.pyc
Binary file not shown.
32 changes: 16 additions & 16 deletions autoqtl/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1507,22 +1507,22 @@ def _summary_of_best_pipeline(self, features_dataset1, target_dataset1, features

print(self.print_pipeline_hyper(pipeline))

# print the names of the selected features if FS exists in the pipeline
pipeline_sklearn = self._toolbox.compile(expr=pipeline)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
pipeline_sklearn.fit(selected_features, selected_target)
flag = False
for name, transformer in pipeline_sklearn.steps:
if name=='variancethreshold' or name=='selectpercentile' or name=='featureencodingfrequencyselector':
selected_features_mask = transformer.get_support()
selected_features_names = features_dataset1.columns[selected_features_mask]
print("No of features selected in the pipeline: ", len(selected_features_names))
print("Feature names selected in the pipeline: ", selected_features_names.tolist())
flag = True

if flag==False:
print("No feature selectors were selected in the pipeline")
# # print the names of the selected features if FS exists in the pipeline
# pipeline_sklearn = self._toolbox.compile(expr=pipeline)
# with warnings.catch_warnings():
# warnings.simplefilter("ignore")
# pipeline_sklearn.fit(selected_features, selected_target)
# flag = False
# for name, transformer in pipeline_sklearn.steps:
# if name=='variancethreshold' or name=='selectpercentile' or name=='featureencodingfrequencyselector':
# selected_features_mask = transformer.get_support()
# selected_features_names = features_dataset1.columns[selected_features_mask]
# print("No of features selected in the pipeline: ", len(selected_features_names))
# print("Feature names selected in the pipeline: ", selected_features_names.tolist())
# flag = True

# if flag==False:
# print("No feature selectors were selected in the pipeline")

self.score1_final_list.append(pipeline_scores.wvalues[0])
self.score2_final_list.append(pipeline_scores.wvalues[1])
Expand Down
Binary file modified autoqtl/builtins/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified autoqtl/builtins/__pycache__/genetic_encoders.cpython-310.pyc
Binary file not shown.
Binary file modified autoqtl/config/__pycache__/regressor.cpython-310.pyc
Binary file not shown.
7 changes: 4 additions & 3 deletions tests/autoqtl_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

# Insert the path of the currently cloned github repo folder
#sys.path.append("Insert path")
sys.path.append("/Users/ghosha/Documents/VSCode Projects/autoqtl-1")
#sys.path.append("/Users/ghosha/Documents/VSCode Projects/autoqtl-1")
sys.path.append("/Users/ghosha/Documents/VSCode Projects/autoqtl")

import autoqtl

Expand Down Expand Up @@ -156,7 +157,7 @@ def test_summary_of_best_pipeline():
verbosity=3
)
#autoqtl_obj.fit(features_dataset1, target_dataset1, features_dataset2, target_dataset2)
autoqtl_obj.fit(features_80, target_80,32, 0.5)
autoqtl_obj.fit(features_80, target_80,42, 0.5)
#autoqtl_obj._summary_of_best_pipeline(features_dataset1, target_dataset2, features_dataset2, target_dataset2)
assert isinstance(autoqtl_obj._optimized_pipeline, creator.Individual)
#autoqtl_obj.get_feature_importance(features_dataset1, target_dataset1, random_state=0)
Expand All @@ -168,7 +169,7 @@ def test_summary_of_best_pipeline():
# this method outputs a text file named EvaluationOnHoldout.txt with the performance on holdout data for each pareto front pipeline
#autoqtl_obj.get_test_r2(features_dataset1, target_dataset1, features_dataset2, target_dataset2 ,features_20, target_20, features_80, target_80, test_X, test_y)
#autoqtl_obj.shap_feature_importance(test_X, test_y, random_state=0)
autoqtl_obj.get_final_output(test_X, test_y, features_20, target_20, file_path = '/Users/ghosha/Library/CloudStorage/Box-Box/AutoQTL/Mouse Data/Analysis/AutoQTL Outputs/')
autoqtl_obj.get_final_output(test_X, test_y, features_20, target_20, file_path = '/Users/ghosha/Library/CloudStorage/Box-Box/AutoQTL/Mouse Data/Analysis/AutoQTL Outputs/Package Tests/')
#autoqtl_obj.average_feature_importance(test_X, test_y)

# # individual SHAP plot
Expand Down

0 comments on commit fbbdf60

Please sign in to comment.