Skip to content
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

updt submission files + setup #39

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading