-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
from photonai.investigator.Investigator import Investigator | ||
|
||
# from mongodb | ||
Investigator.load_from_db('mongodb://server:27017/photon_results', 'my_pipe') | ||
|
||
# from working memory | ||
my_pipe = Hyperpipe(...) | ||
my_pipe.fit(X, y) | ||
Investigator.show(my_pipe) | ||
|
||
# from file | ||
Investigator.load_from_file('my_pipe_name', '/home/usr123/proj45/my_pipe_results2019-08-01/photon_result_file.p') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from sklearn.base import BaseEstimator | ||
|
||
|
||
class CustomEstimator(BaseEstimator): | ||
|
||
def __init__(self, param1=0, param2=None): | ||
# it is important that you name your params the same in the constructor | ||
# stub as well as in your class variables! | ||
self.param1 = param1 | ||
self.param2 = param2 | ||
|
||
def fit(self, data, targets=None, **kwargs): | ||
""" | ||
Adjust the underlying model or method to the data. | ||
Returns | ||
------- | ||
IMPORTANT: must return self! | ||
""" | ||
return self | ||
|
||
def predict(self, data): | ||
""" | ||
Use the learned model to make predictions. | ||
""" | ||
my_predictions = [] | ||
return my_predictions | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from sklearn.base import BaseEstimator | ||
|
||
|
||
class CustomTransformer(BaseEstimator): | ||
|
||
def __init__(self, param1=0, param2=None): | ||
# it is important that you name your params the same in the constructor | ||
# stub as well as in your class variables! | ||
self.param1 = param1 | ||
self.param2 = param2 | ||
|
||
def fit(self, data, targets=None, **kwargs): | ||
""" | ||
Adjust the underlying model or method to the data. | ||
Returns | ||
------- | ||
IMPORTANT: must return self! | ||
""" | ||
return self | ||
|
||
def transform(self, data, targets=None, **kwargs): | ||
""" | ||
Apply the method's logic to the data. | ||
""" | ||
transformed_data = [] | ||
return transformed_data | ||
|