-
Notifications
You must be signed in to change notification settings - Fork 8
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
Ss test mapie #41
base: dev
Are you sure you want to change the base?
Ss test mapie #41
Conversation
Changes are made in fs_algo_train_eval.py |
…ng calculation. Convert rf Bagging ci as a separate function
…ing calculation. Convert mlp Bagging ci as a separate function
…trapping runs from the yaml file
…strapping runs from the yaml file
…prediction algorithms pipeline to remove ci
fa1c2a1
to
9263a49
Compare
algo = algo_data['algo'] | ||
mapie = MapieRegressor(algo, cv="prefit", agg_function="median") | ||
mapie.fit(self.X_train, self.y_train) | ||
algo_data['mapie'] = mapie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ssorou1, the mapie object needs to be returned somehow. I suggest adding it to the self.algs_dict
object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lower_bound, upper_bound = np.percentile(predictions, [(100 - cl) / 2, 100 - (100 - cl) / 2], axis=0) | ||
confidence_intervals[cl] = (lower_bound, upper_bound) | ||
|
||
return mean_pred, std_pred, confidence_intervals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ssorou1, Like mapie, I also suggest creating these as objects inside the class (e.g. another sub-dict inside self.algs_dict[algo_str]
rather than something that gets returned. Then the user could access those data easily within the when running fs_proc_algo, e.g. train_eval.algs_dict['rf'].name_of_object_for_bagging_here['mean_pred']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. The calculate_bagging_ci()
is updated:
https://github.com/ssorou1/formulation-selector/blob/ef57c391bf4bd9a5fbcb143aea9ff6ee8bcc445f/pkg/fs_algo/fs_algo/fs_algo_train_eval.py#L1042-L1044
if algo_str in self.algo_config and self.bagging_ci_params.get('n_algos', None): | ||
n_algos = self.bagging_ci_params.get('n_algos', None) | ||
mean_pred, _, confidence_intervals = self.calculate_bagging_ci(algo_str,n_algos) | ||
self.algs_dict[algo_str]['Uncertainty']['bagging_mean_pred'] = mean_pred |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ssorou1, see previous comment - you could substitute this self
assignment in to the calculate_bagging_ci
rather than here to simplify the code.
We would use a return
in calculate_bagging_ci
if we anticipated running this function independently, but since all these data are so closely tied together, we can just these data as class objects, as you already end up doing in these lines 1330 and 1331.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented. Please refer to the comment above.
… than the csv file
…fter joblib update
…ion under train_eval()
… and update fs_algo_train_eval accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm continuing the discussion on the random state/resampling after skimming over the new work.
Hi Guy,
|
Implementation of MAPIE for rf and mlp models.
Additions
Removals
Changes
Testing
Screenshots
Notes
Todos
Checklist
Testing checklist
Target Environment support
Accessibility
Other