Skip to content

Commit

Permalink
updt submission files + setup
Browse files Browse the repository at this point in the history
  • Loading branch information
frcaud committed Jan 18, 2024
1 parent 2c36fe6 commit b4fe536
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 53 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
description="RAMP module for the Stroke Segmentation Challenge",
author="NPNL",
packages=["stroke"],
url="https://github.com/AlexandreHutton/stroke",
url="https://github.com/ramp-kits/stroke_lesions/stroke",
license="gpl-3.0",
)
50 changes: 24 additions & 26 deletions submissions/sample/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@


class BIDSEstimator(BaseEstimator):
'''
"""
Estimator sample for RAMP stroke lesion segmentation.
'''
"""

def __init__(self):
'''
"""
Initialize estimator values (e.g. starting learning rate) here.
'''
"""
return

def fit(self,
X: np.array,
y: np.array):
'''
def fit(self, X: np.array, y: np.array):
"""
Fit the estimator using the input data (X) and target (y). Assumes that all data is present. Optional.
This estimator in particular does nothing.
Parameters
Expand All @@ -29,11 +27,11 @@ def fit(self,
Returns
-------
None
'''
"""
return

def fit_partial(self, X, y):
'''
"""
Fit the estimator using the input data (X) and target (y). Assumes that the inputs represent only a fraction
of the data and that it will be called multiple times while using the dataset. I.e., learning rates and adaptive
parameters should not be entirely recalculated with each call to this method. Required.
Expand All @@ -48,14 +46,14 @@ def fit_partial(self, X, y):
Returns
-------
None
'''
"""

# Apply pre-processing to X
# Feed to estimator
return

def predict_proba(self, X):
'''
"""
Applies the data to the estimator to produce a prediction. The output can be continuous to represent the
relative confidence the estimator has in the prediction. Optional.
Typically, correct but uncertain predictions are rewarded less. Similarly, incorrect but uncertain predictions
Expand All @@ -70,25 +68,25 @@ def predict_proba(self, X):
-------
np.array
Prediction made by the estimator.
'''
"""
y = np.ones(X.shape, dtype=bool)
return y

def predict(self, X):
'''
Applies the data to the estimator to produce a prediction. The output type is expected to match the problem.
I.e., classification problems should have categorical predictions. Required.
This estimator always returns 1.
Parameters
----------
X : np.array
Data of the form (n_samples, n_channels, *image.shape)
"""
Applies the data to the estimator to produce a prediction. The output type is expected to match the problem.
I.e., classification problems should have categorical predictions. Required.
This estimator always returns 1.
Parameters
----------
X : np.array
Data of the form (n_samples, n_channels, *image.shape)
Returns
-------
np.array
Prediction made by the estimator.
'''
Returns
-------
np.array
Prediction made by the estimator.
"""
y = np.ones(X.shape, dtype=bool)
return y

Expand Down
50 changes: 24 additions & 26 deletions submissions/starting_kit/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@


class BIDSEstimator(BaseEstimator):
'''
"""
Estimator sample for RAMP stroke lesion segmentation.
'''
"""

def __init__(self):
'''
"""
Initialize estimator values (e.g. starting learning rate) here.
'''
"""
return

def fit(self,
X: np.array,
y: np.array):
'''
def fit(self, X: np.array, y: np.array):
"""
Fit the estimator using the input data (X) and target (y). Assumes that all data is present. Optional.
This estimator in particular does nothing.
Parameters
Expand All @@ -29,11 +27,11 @@ def fit(self,
Returns
-------
None
'''
"""
return

def fit_partial(self, X, y):
'''
"""
Fit the estimator using the input data (X) and target (y). Assumes that the inputs represent only a fraction
of the data and that it will be called multiple times while using the dataset. I.e., learning rates and adaptive
parameters should not be entirely recalculated with each call to this method. Required.
Expand All @@ -48,14 +46,14 @@ def fit_partial(self, X, y):
Returns
-------
None
'''
"""

# Apply pre-processing to X
# Feed to estimator
return

def predict_proba(self, X):
'''
"""
Applies the data to the estimator to produce a prediction. The output can be continuous to represent the
relative confidence the estimator has in the prediction. Optional.
Typically, correct but uncertain predictions are rewarded less. Similarly, incorrect but uncertain predictions
Expand All @@ -70,25 +68,25 @@ def predict_proba(self, X):
-------
np.array
Prediction made by the estimator.
'''
"""
y = np.ones(X.shape, dtype=bool)
return y

def predict(self, X):
'''
Applies the data to the estimator to produce a prediction. The output type is expected to match the problem.
I.e., classification problems should have categorical predictions. Required.
This estimator always returns 1.
Parameters
----------
X : np.array
Data of the form (n_samples, n_channels, *image.shape)
"""
Applies the data to the estimator to produce a prediction. The output type is expected to match the problem.
I.e., classification problems should have categorical predictions. Required.
This estimator always returns 1.
Parameters
----------
X : np.array
Data of the form (n_samples, n_channels, *image.shape)
Returns
-------
np.array
Prediction made by the estimator.
'''
Returns
-------
np.array
Prediction made by the estimator.
"""
y = np.ones(X.shape, dtype=bool)
return y

Expand Down

0 comments on commit b4fe536

Please sign in to comment.