{-| For a high-level description of the C API, refer to the README file included in the liblinear archive, available for download at . -} #include #include module Numeric.SVM.LibLinear.Internal where #strict_import -- * feature_node #starttype struct feature_node #field index , CInt #field value , CDouble #stoptype -- * problem #starttype struct problem #field l , CInt #field n , CInt #field y , Ptr CInt #field x , Ptr (Ptr ) #field bias , CDouble #stoptype -- * solver_type -- ** classification #num L2R_LR #num L2R_L2LOSS_SVC_DUAL #num L2R_L2LOSS_SVC #num L2R_L1LOSS_SVC_DUAL #num MCSVM_CS #num L1R_L2LOSS_SVC #num L1R_LR #num L2R_LR_DUAL -- ** regression #num L2R_L2LOSS_SVR #num L2R_L2LOSS_SVR_DUAL #num L2R_L1LOSS_SVR_DUAL -- * parameter #starttype struct parameter #field solver_type , CInt #field eps , CDouble #field C , CDouble #field nr_weight , CInt #field weight_label , Ptr CInt #field weight , Ptr CDouble #field p , CDouble #field init_sol , Ptr CDouble #stoptype -- * model #starttype struct model #field param , #field nr_class , CInt #field nr_feature , CInt #field w , Ptr CDouble #field label , Ptr CInt #field bias , CDouble #stoptype -- * training #ccall train , Ptr -> Ptr -> IO (Ptr ) -- * cross validation #ccall cross_validation , Ptr -> Ptr -> CInt -> Ptr CDouble -> IO () -- * saving and loading models #ccall save_model , CString -> Ptr -> IO () #ccall load_model , CString -> IO (Ptr ) -- * getting properties #ccall get_nr_feature , Ptr -> IO CInt #ccall get_nr_class , Ptr -> IO CInt #ccall get_labels , Ptr -> Ptr CInt -> IO () -- * predictions #ccall predict_values , Ptr -> Ptr -> Ptr CDouble -> IO CDouble #ccall predict , Ptr -> Ptr -> IO CDouble #ccall predict_probability , Ptr -> Ptr -> Ptr CDouble -> IO CDouble -- * destroying #ccall free_model_content , Ptr -> IO () #ccall free_and_destroy_model , Ptr (Ptr ) -> IO () #ccall destroy_param , Ptr -> IO () -- * checking #ccall check_parameter , Ptr -> Ptr -> IO CString #ccall check_probability_model , Ptr -> IO CInt -- printing -- #ccall svm_print_string , FunPtr (CString -> IO ())