8000 MAINT remove dead code from LibSVM · scikit-learn/scikit-learn@4fcb24c · GitHub
[go: up one dir, main page]

Skip to content

Commit 4fcb24c

Browse files
committed
MAINT remove dead code from LibSVM
1 parent 92917e1 commit 4fcb24c

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

sklearn/svm/src/libsvm/svm.cpp

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6060
#include "svm.h"
6161

6262
#ifndef _LIBSVM_CPP
63-
int libsvm_version = LIBSVM_VERSION;
6463
typedef float Qfloat;
6564
typedef signed char schar;
6665
#ifndef min
@@ -96,7 +95,7 @@ static void print_string_stdout(const char *s)
9695
fflush(stdout);
9796
}
9897
static void (*svm_print_string) (const char *) = &print_string_stdout;
99-
#if 1
98+
10099
static void info(const char *fmt,...)
101100
{
102101
char buf[BUFSIZ];
@@ -106,9 +105,6 @@ static void info(const char *fmt,...)
106105
va_end(ap);
107106
(*svm_print_string)(buf);
108107
}
109-
#else
110-
static void info(const char *fmt,...) {}
111-
#endif
112108
#endif
113109
#define _LIBSVM_CPP
114110

@@ -2961,12 +2957,6 @@ void PREFIX(free_and_destroy_model)(PREFIX(model)** model_ptr_ptr)
29612957
}
29622958
}
29632959

2964-
void PREFIX(destroy_model)(PREFIX(model)* model_ptr)
2965-
{
2966-
fprintf(stderr,"warning: svm_destroy_model is deprecated and should not be used. Please use svm_free_and_destroy_model(PREFIX(model) **model_ptr_ptr)\n");
2967-
PREFIX(free_and_destroy_model)(&model_ptr);
2968-
}
2969-
29702960
void PREFIX(destroy_param)(svm_parameter* param)
29712961
{
29722962
free(param->weight_label);
@@ -3095,14 +3085,6 @@ const char *PREFIX(check_parameter)(const PREFIX(problem) *prob, const svm_param
30953085
return NULL;
30963086
}
30973087

3098-
int PREFIX(check_probability_model)(const PREFIX(model) *model)
3099-
{
3100-
return ((model->param.svm_type == C_SVC || model->param.svm_type == NU_SVC) &&
3101-
model->probA!=NULL && model->probB!=NULL) ||
3102-
((model->param.svm_type == EPSILON_SVR || model->param.svm_type == NU_SVR) &&
3103-
model->probA!=NULL);
3104-
}
3105-
31063088
void PREFIX(set_print_string_function)(void (*print_func)(const char *))
31073089
{
31083090
if(print_func == NULL)

sklearn/svm/src/libsvm/svm.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
extern "C" {
88
#endif
99

10-
extern int libsvm_version;
11-
1210
struct svm_node
1311
{
1412
int dim;
@@ -140,14 +138,9 @@ void svm_free_and_destroy_model(struct svm_model **model_ptr_ptr);
140138
void svm_destroy_param(struct svm_parameter *param);
141139

142140
const char *svm_check_parameter(const struct svm_problem *prob, const struct svm_parameter *param);
143-
int svm_check_probability_model(const struct svm_model *model);
144141

145142
void svm_set_print_string_function(void (*print_func)(const char *));
146143

147-
// deprecated
148-
// this function will be removed in future release
149-
void svm_destroy_model(struct svm_model *model_ptr);
150-
151144

152145
/* sparse version */
153146

@@ -168,7 +161,6 @@ void svm_csr_free_and_destroy_model(struct svm_csr_model **model_ptr_ptr);
168161
void svm_csr_destroy_param(struct svm_parameter *param);
169162

170163
const char *svm_csr_check_parameter(const struct svm_csr_problem *prob, const struct svm_parameter *param);
171-
int svm_csr_check_probability_model(const struct svm_csr_model *model);
172164

173165
/* end sparse version */
174166

0 commit comments

Comments
 (0)
0