-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell Bindings for libsvm -- -- Haskell Bindings for libsvm @package HSvm @version 0.1.0.2.89 module Data.SVM.Raw data CSvmNode CSvmNode :: CInt -> CDouble -> CSvmNode index :: CSvmNode -> CInt value :: CSvmNode -> CDouble data CSvmProblem CSvmProblem :: CInt -> Ptr CDouble -> Ptr (Ptr CSvmNode) -> CSvmProblem l :: CSvmProblem -> CInt y :: CSvmProblem -> Ptr CDouble x :: CSvmProblem -> Ptr (Ptr CSvmNode) newtype CSvmType CSvmType :: CInt -> CSvmType unCSvmType :: CSvmType -> CInt cSvc :: CSvmType nuSvc :: CSvmType newtype CKernelType CKernelType :: CInt -> CKernelType unCKernelType :: CKernelType -> CInt oneClass :: CSvmType linear :: CKernelType poly :: CKernelType epsilonSvr :: CSvmType data CSvmParameter CSvmParameter :: CSvmType -> CKernelType -> CInt -> CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> CInt -> Ptr CInt -> Ptr CDouble -> CDouble -> CDouble -> CInt -> CInt -> CSvmParameter svm_type :: CSvmParameter -> CSvmType kernel_type :: CSvmParameter -> CKernelType degree :: CSvmParameter -> CInt gamma :: CSvmParameter -> CDouble coef0 :: CSvmParameter -> CDouble cache_size :: CSvmParameter -> CDouble eps :: CSvmParameter -> CDouble c :: CSvmParameter -> CDouble nr_weight :: CSvmParameter -> CInt weight_label :: CSvmParameter -> Ptr CInt weight :: CSvmParameter -> Ptr CDouble nu :: CSvmParameter -> CDouble p :: CSvmParameter -> CDouble shrinking :: CSvmParameter -> CInt probability :: CSvmParameter -> CInt nuSvr :: CSvmType rbf :: CKernelType sigmoid :: CKernelType precomputed :: CKernelType data CSvmModel c_svm_train :: Ptr CSvmProblem -> Ptr CSvmParameter -> IO (Ptr CSvmModel) c_svm_cross_validation :: Ptr CSvmProblem -> Ptr CSvmParameter -> CInt -> Ptr CDouble -> IO () c_svm_predict :: Ptr CSvmModel -> Ptr CSvmNode -> CDouble c_svm_save_model :: CString -> Ptr CSvmModel -> IO CInt c_svm_load_model :: CString -> IO (Ptr CSvmModel) c_svm_check_parameter :: Ptr CSvmProblem -> Ptr CSvmParameter -> CString c_svm_destroy_model :: FinalizerPtr CSvmModel c_clone_model_support_vectors :: Ptr CSvmModel -> IO () instance Show CSvmParameter instance Storable CKernelType instance Show CKernelType instance Storable CSvmType instance Show CSvmType instance Storable CSvmParameter instance Storable CSvmProblem instance Storable CSvmNode module Data.SVM type Vector = IntMap Double type Problem = [(Double, Vector)] newtype Model Model :: (ForeignPtr CSvmModel) -> Model data KernelType Linear :: KernelType RBF :: Double -> KernelType gamma :: KernelType -> Double Sigmoid :: Double -> Double -> KernelType gamma :: KernelType -> Double coef0 :: KernelType -> Double Poly :: Double -> Double -> Int -> KernelType gamma :: KernelType -> Double coef0 :: KernelType -> Double degree :: KernelType -> Int data Algorithm CSvc :: Double -> Algorithm c :: Algorithm -> Double NuSvc :: Double -> Algorithm nu :: Algorithm -> Double NuSvr :: Double -> Double -> Algorithm nu :: Algorithm -> Double c :: Algorithm -> Double EpsilonSvr :: Double -> Double -> Algorithm epsilon :: Algorithm -> Double c :: Algorithm -> Double OneClassSvm :: Double -> Algorithm nu :: Algorithm -> Double data ExtraParam ExtraParam :: Double -> Int -> Int -> ExtraParam cacheSize :: ExtraParam -> Double shrinking :: ExtraParam -> Int probability :: ExtraParam -> Int mergeKernel :: KernelType -> CSvmParameter -> CSvmParameter mergeAlgo :: Algorithm -> CSvmParameter -> CSvmParameter newCSvmNodeArray :: Vector -> IO (Ptr CSvmNode) newCSvmProblem :: Problem -> IO (Ptr CSvmProblem) freeCSVmProblem :: Ptr CSvmProblem -> IO () withProblem :: Problem -> (Ptr CSvmProblem -> IO a) -> IO a withParam :: ExtraParam -> Algorithm -> KernelType -> (Ptr CSvmParameter -> IO a) -> IO a checkParam :: Ptr CSvmProblem -> Ptr CSvmParameter -> IO () train' :: ExtraParam -> Algorithm -> KernelType -> Problem -> IO (Model) -- | The train function allows training a Model starting from -- a Problem by specifying an Algorithm and a -- KernelType train :: Algorithm -> KernelType -> Problem -> IO (Model) crossValidate' :: ExtraParam -> Algorithm -> KernelType -> Problem -> Int -> IO [Double] saveModel :: Model -> FilePath -> IO () loadModel :: FilePath -> IO (Model) predict :: Model -> Vector -> Double