Skip to content

Commit

Permalink
Checkpoint, about to change train/test dataset generation
Browse files Browse the repository at this point in the history
Tereso del Rio committed Sep 13, 2023
1 parent 051d649 commit e2c35ce
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions choose_hyperparams.py
Original file line number Diff line number Diff line change
@@ -22,8 +22,8 @@ def k_folds_ml(x_train, y_train, model, random_state=0):
rf_cv = GridSearchCV(estimator=current_classifier(),
param_grid=current_grid,
cv=5,
verbose=10 # to get updates
)
verbose=10 # to get updates
)
rf_cv.fit(x_train, y_train)
return rf_cv.best_params_

2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@
paradigm = 'classification'

# cleaning_dataset()
# create_train_test_datasets()
create_train_test_datasets()

# if tune_hyperparameters:
# for ml_model in ml_models:
3 changes: 3 additions & 0 deletions replicating_Dorians_features.py
Original file line number Diff line number Diff line change
@@ -68,6 +68,7 @@ def extract_features(dataset):
all_timings = []
all_original_polynomials = []
all_projections = []
all_cells = []
for index, projections in enumerate(dataset[0]):
all_projections.append(projections)
original_polynomials = projections[0][0]
@@ -76,6 +77,7 @@ def extract_features(dataset):
all_original_polynomials.append(original_polynomials)
all_targets.append(dataset[1][index])
all_timings.append(dataset[2][index])
all_cells.append(dataset[3][index])
names, instance_features = features_from_set_of_polys(
original_polynomials)
all_features.append(instance_features)
@@ -85,6 +87,7 @@ def extract_features(dataset):
my_dataset['targets'] = np.array(all_targets)
my_dataset['timings'] = np.array(all_timings)
my_dataset['projections'] = np.array(all_projections)
my_dataset['cells'] = np.array(all_cells)
return my_dataset


1 change: 1 addition & 0 deletions test_train_datasets.py
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@ def create_train_test_datasets():
y = dict() # to keep the labels
t = dict() # to keep the timings
p = dict() # to keep the projections
c = dict() # to keep the number of cells
# train and test sets are created
random_state = 0
x['train_normal'], x['test_normal'], \

0 comments on commit e2c35ce

Please sign in to comment.