3
3
4
4
5
5
class BIDSEstimator (BaseEstimator ):
6
- '''
6
+ """
7
7
Estimator sample for RAMP stroke lesion segmentation.
8
- '''
8
+ """
9
9
10
10
def __init__ (self ):
11
- '''
11
+ """
12
12
Initialize estimator values (e.g. starting learning rate) here.
13
- '''
13
+ """
14
14
return
15
15
16
- def fit (self ,
17
- X : np .array ,
18
- y : np .array ):
19
- '''
16
+ def fit (self , X : np .array , y : np .array ):
17
+ """
20
18
Fit the estimator using the input data (X) and target (y). Assumes that all data is present. Optional.
21
19
This estimator in particular does nothing.
22
20
Parameters
@@ -29,11 +27,11 @@ def fit(self,
29
27
Returns
30
28
-------
31
29
None
32
- '''
30
+ """
33
31
return
34
32
35
33
def fit_partial (self , X , y ):
36
- '''
34
+ """
37
35
Fit the estimator using the input data (X) and target (y). Assumes that the inputs represent only a fraction
38
36
of the data and that it will be called multiple times while using the dataset. I.e., learning rates and adaptive
39
37
parameters should not be entirely recalculated with each call to this method. Required.
@@ -48,14 +46,14 @@ def fit_partial(self, X, y):
48
46
Returns
49
47
-------
50
48
None
51
- '''
49
+ """
52
50
53
51
# Apply pre-processing to X
54
52
# Feed to estimator
55
53
return
56
54
57
55
def predict_proba (self , X ):
58
- '''
56
+ """
59
57
Applies the data to the estimator to produce a prediction. The output can be continuous to represent the
60
58
relative confidence the estimator has in the prediction. Optional.
61
59
Typically, correct but uncertain predictions are rewarded less. Similarly, incorrect but uncertain predictions
@@ -70,25 +68,25 @@ def predict_proba(self, X):
70
68
-------
71
69
np.array
72
70
Prediction made by the estimator.
73
- '''
71
+ """
74
72
y = np .ones (X .shape , dtype = bool )
75
73
return y
76
74
77
75
def predict (self , X ):
78
- '''
79
- Applies the data to the estimator to produce a prediction. The output type is expected to match the problem.
80
- I.e., classification problems should have categorical predictions. Required.
81
- This estimator always returns 1.
82
- Parameters
83
- ----------
84
- X : np.array
85
- Data of the form (n_samples, n_channels, *image.shape)
76
+ """
77
+ Applies the data to the estimator to produce a prediction. The output type is expected to match the problem.
78
+ I.e., classification problems should have categorical predictions. Required.
79
+ This estimator always returns 1.
80
+ Parameters
81
+ ----------
82
+ X : np.array
83
+ Data of the form (n_samples, n_channels, *image.shape)
86
84
87
- Returns
88
- -------
89
- np.array
90
- Prediction made by the estimator.
91
- '''
85
+ Returns
86
+ -------
87
+ np.array
88
+ Prediction made by the estimator.
89
+ """
92
90
y = np .ones (X .shape , dtype = bool )
93
91
return y
94
92
0 commit comments