DummyTransformer
In [1]:
Copied!
# Example for dummy classifier
# Example for dummy classifier
In [2]:
Copied!
# IMPORTANT: import your project once
import project_name
# IMPORTANT: import your project once
import project_name
In [3]:
Copied!
from photonai.base import Hyperpipe, PipelineElement
from sklearn.model_selection import KFold
from photonai.base import Hyperpipe, PipelineElement
from sklearn.model_selection import KFold
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[3], line 1 ----> 1 from photonai.base import Hyperpipe, PipelineElement 2 from sklearn.model_selection import KFold ModuleNotFoundError: No module named 'photonai'
Create dataset
In [4]:
Copied!
import numpy as np
X = np.random.rand(10, 10)
y = np.random.rand(10)
import numpy as np
X = np.random.rand(10, 10)
y = np.random.rand(10)
Setup pipeline
In [5]:
Copied!
my_pipe += PipelineElement("DummyTransformer", dummy_hp=3)
my_pipe += PipelineElement("DummyTransformer", dummy_hp=3)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[5], line 1 ----> 1 my_pipe += PipelineElement("DummyTransformer", dummy_hp=3) NameError: name 'my_pipe' is not defined
In [6]:
Copied!
my_pipe += PipelineElement("SVR")
my_pipe += PipelineElement("SVR")
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[6], line 1 ----> 1 my_pipe += PipelineElement("SVR") NameError: name 'my_pipe' is not defined
In [7]:
Copied!
my_pipe.fit(X, y)
my_pipe.fit(X, y)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[7], line 1 ----> 1 my_pipe.fit(X, y) NameError: name 'my_pipe' is not defined
Done