nipype.interfaces.afni.svm module

AFNI’s svm interfaces.

SVMTest

Link to code

Bases: AFNICommand

Wrapped executable: 3dsvm.

Temporally predictive modeling with the support vector machine SVM Test Only For complete details, see the 3dsvm Documentation.

Examples

>>> from nipype.interfaces import afni as afni
>>> svmTest = afni.SVMTest()
>>> svmTest.inputs.in_file= 'run2+orig'
>>> svmTest.inputs.model= 'run1+orig_model'
>>> svmTest.inputs.testlabels= 'run2_categories.1D'
>>> svmTest.inputs.out_file= 'pred2_model1'
>>> res = svmTest.run() 
in_filea pathlike object or string representing an existing file

A 3D or 3D+t AFNI brik dataset to be used for testing. Maps to a command-line argument: -testvol %s.

modela unicode string

Modname is the basename for the brik containing the SVM model. Maps to a command-line argument: -model %s.

argsa unicode string

Additional parameters to the command. Maps to a command-line argument: %s.

classouta boolean

Flag to specify that pname files should be integer-valued, corresponding to class category decisions. Maps to a command-line argument: -classout.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

multiclassa boolean

Specifies multiclass algorithm for classification. Maps to a command-line argument: -multiclass %s.

nodetrenda boolean

Flag to specify that pname files should not be linearly detrended. Maps to a command-line argument: -nodetrend.

nopredcensorda boolean

Flag to prevent writing predicted values for censored time-points. Maps to a command-line argument: -nopredcensord.

num_threadsan integer (int or long)

Set number of threads. (Nipype default value: 1)

optionsa unicode string

Additional options for SVM-light. Maps to a command-line argument: %s.

out_filea pathlike object or string representing a file

Filename for .1D prediction file(s). Maps to a command-line argument: -predictions %s.

outputtype‘NIFTI’ or ‘AFNI’ or ‘NIFTI_GZ’

AFNI output filetype.

testlabelsa pathlike object or string representing an existing file

true class category .1D labels for the test dataset. It is used to calculate the prediction accuracy performance. Maps to a command-line argument: -testlabels %s.

out_filea pathlike object or string representing an existing file

Output file.

SVMTrain

Link to code

Bases: AFNICommand

Wrapped executable: 3dsvm.

Temporally predictive modeling with the support vector machine SVM Train Only For complete details, see the 3dsvm Documentation.

Examples

>>> from nipype.interfaces import afni as afni
>>> svmTrain = afni.SVMTrain()
>>> svmTrain.inputs.in_file = 'run1+orig'
>>> svmTrain.inputs.trainlabels = 'run1_categories.1D'
>>> svmTrain.inputs.ttype = 'regression'
>>> svmTrain.inputs.mask = 'mask.nii'
>>> svmTrain.inputs.model = 'model_run1'
>>> svmTrain.inputs.alphas = 'alphas_run1'
>>> res = svmTrain.run() 
in_filea pathlike object or string representing an existing file

A 3D+t AFNI brik dataset to be used for training. Maps to a command-line argument: -trainvol %s.

ttypea unicode string

Tname: classification or regression. Maps to a command-line argument: -type %s.

alphasa pathlike object or string representing a file

Output alphas file name. Maps to a command-line argument: -alpha %s.

argsa unicode string

Additional parameters to the command. Maps to a command-line argument: %s.

censora pathlike object or string representing an existing file

.1D censor file that allows the user to ignore certain samples in the training data. Maps to a command-line argument: -censor %s.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

kernela unicode string

String specifying type of kernel function:linear, polynomial, rbf, sigmoid. Maps to a command-line argument: -kernel %s.

maska pathlike object or string representing an existing file

Byte-format brik file used to mask voxels in the analysis. Maps to a command-line argument: -mask %s (position: -1).

max_iterationsan integer (int or long)

Specify the maximum number of iterations for the optimization. Maps to a command-line argument: -max_iterations %d.

modela pathlike object or string representing a file

Basename for the brik containing the SVM model. Maps to a command-line argument: -model %s.

nomodelmaska boolean

Flag to enable the omission of a mask file. Maps to a command-line argument: -nomodelmask.

num_threadsan integer (int or long)

Set number of threads. (Nipype default value: 1)

optionsa unicode string

Additional options for SVM-light. Maps to a command-line argument: %s.

out_filea pathlike object or string representing a file

Output sum of weighted linear support vectors file name. Maps to a command-line argument: -bucket %s.

outputtype‘NIFTI’ or ‘AFNI’ or ‘NIFTI_GZ’

AFNI output filetype.

trainlabelsa pathlike object or string representing an existing file

.1D labels corresponding to the stimulus paradigm for the training data. Maps to a command-line argument: -trainlabels %s.

w_outa boolean

Output sum of weighted linear support vectors. Maps to a command-line argument: -wout.

alphasa pathlike object or string representing a file

Output alphas file name.

modela pathlike object or string representing a file

Brik containing the SVM model file name.

out_filea pathlike object or string representing a file

Sum of weighted linear support vectors file name.