Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scikit-learn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ian Johnson
scikit-learn
Commits
ba758cba
Commit
ba758cba
authored
14 years ago
by
Yaroslav Halchenko
Browse files
Options
Downloads
Patches
Plain Diff
tentative patch for runtime verbosity control of libsvm
parent
9353116c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
debian/patches/deb_libsvm_verbosity_control
+49
-0
49 additions, 0 deletions
debian/patches/deb_libsvm_verbosity_control
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
with
50 additions
and
0 deletions
debian/patches/deb_libsvm_verbosity_control
0 → 100644
+
49
−
0
View file @
ba758cba
--- a/scikits/learn/svm/src/libsvm/libsvm_helper.c
+++ b/scikits/learn/svm/src/libsvm/libsvm_helper.c
@@ -669,5 +669,33 @@
int free_param(struct svm_parameter *par
free(param);
return 0;
}
-
-
+
+/* rely on built-in facility to control verbose output
+ * in the versions of libsvm >= 2.89
+ */
+#if LIBSVM_VERSION && LIBSVM_VERSION >= 289
+
+/* borrowed from original libsvm code */
+static void print_null(const char *s) {}
+
+static void print_string_stdout(const char *s)
+{
+ fputs(s,stdout);
+ fflush(stdout);
+}
+
+/* provide convenience wrapper */
+void svm_set_verbosity(int verbosity_flag){
+ if (verbosity_flag)
+# if LIBSVM_VERSION < 291
+ svm_print_string = &print_string_stdout;
+ else
+ svm_print_string = &print_null;
+# else
+ svm_set_print_string_function(&print_string_stdout);
+ else
+ svm_set_print_string_function(&print_null);
+# endif
+}
+#endif
+
--- a/scikits/learn/svm/src/libsvm/_libsvm.pyx
+++ b/scikits/learn/svm/src/libsvm/_libsvm.pyx
@@ -93,7 +93,7 @@
cdef extern from "libsvm_helper.c":
int free_model (svm_model *)
int free_model_SV (svm_model *)
int free_param (svm_parameter *)
-
+ void svm_set_verbosity(int)
################################################################################
# Wrapper functions
This diff is collapsed.
Click to expand it.
debian/patches/series
+
1
−
0
View file @
ba758cba
deb_use_system_joblib
deb_use_system_joblib
deb_use_system_libraries
deb_use_system_libraries
deb_libsvm_verbosity_control
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment