Mercurial > forge
comparison extra/NaN/src/linear.h @ 12593:0605cb0434ff octave-forge
[nan] revert r12777:12778 use liblinear 1.5x - because v1.8 does not support weighted samples
author | schloegl |
---|---|
date | Sun, 12 Apr 2015 20:26:42 +0000 |
parents | 3aeba3530595 |
children | 01c5f2e1ec48 |
comparison
equal
deleted
inserted
replaced
12592:d03ad555e14e | 12593:0605cb0434ff |
---|---|
1 /* | 1 /* |
2 | 2 |
3 Copyright (c) 2007-2011 The LIBLINEAR Project. | 3 $Id$ |
4 Copyright (c) 2010,2015 Alois Schloegl <alois.schloegl@ist.ac.at> | 4 Copyright (c) 2007-2009 The LIBLINEAR Project. |
5 Copyright (c) 2010 Alois Schloegl <alois.schloegl@gmail.com> | |
5 This function is part of the NaN-toolbox | 6 This function is part of the NaN-toolbox |
6 http://pub.ist.ac.at/~schloegl/matlab/NaN/ | 7 http://pub.ist.ac.at/~schloegl/matlab/NaN/ |
7 | 8 |
8 This code was extracted from liblinear-1.8 in Apr 2015 and | 9 This code was extracted from liblinear-1.51 in Jan 2010 and |
9 modified for the use with Octave | 10 modified for the use with Octave |
10 | 11 |
11 This program is free software; you can redistribute it and/or modify | 12 This program is free software; you can redistribute it and/or modify |
12 it under the terms of the GNU General Public License as published by | 13 it under the terms of the GNU General Public License as published by |
13 the Free Software Foundation; either version 3 of the License, or | 14 the Free Software Foundation; either version 3 of the License, or |
40 { | 41 { |
41 int l, n; | 42 int l, n; |
42 int *y; | 43 int *y; |
43 struct feature_node **x; | 44 struct feature_node **x; |
44 double bias; /* < 0 if no bias term */ | 45 double bias; /* < 0 if no bias term */ |
46 double *W; /* instance weight */ | |
45 }; | 47 }; |
46 | 48 |
47 enum { L2R_LR, L2R_L2LOSS_SVC_DUAL, L2R_L2LOSS_SVC, L2R_L1LOSS_SVC_DUAL, MCSVM_CS, L1R_L2LOSS_SVC, L1R_LR, L2R_LR_DUAL }; /* solver_type */ | 49 enum { L2R_LR, L2R_L2LOSS_SVC_DUAL, L2R_L2LOSS_SVC, L2R_L1LOSS_SVC_DUAL, MCSVM_CS, L1R_L2LOSS_SVC, L1R_LR }; /* solver_type */ |
48 | 50 |
49 struct parameter | 51 struct parameter |
50 { | 52 { |
51 int solver_type; | 53 int solver_type; |
52 | 54 |
80 | 82 |
81 int get_nr_feature(const struct model *model_); | 83 int get_nr_feature(const struct model *model_); |
82 int get_nr_class(const struct model *model_); | 84 int get_nr_class(const struct model *model_); |
83 void get_labels(const struct model *model_, int* label); | 85 void get_labels(const struct model *model_, int* label); |
84 | 86 |
85 void free_model_content(struct model *model_ptr); | 87 void destroy_model(struct model *model_); |
86 void free_and_destroy_model(struct model **model_ptr_ptr); | |
87 void destroy_param(struct parameter *param); | 88 void destroy_param(struct parameter *param); |
88 | 89 const char *check_parameter(const struct parameter *param); |
89 const char *check_parameter(const struct problem *prob, const struct parameter *param); | 90 extern void (*liblinear_print_string) (const char *); |
90 int check_probability_model(const struct model *model); | |
91 void set_print_string_function(void (*print_func) (const char*)); | |
92 | 91 |
93 #ifdef __cplusplus | 92 #ifdef __cplusplus |
94 } | 93 } |
95 #endif | 94 #endif |
96 | 95 |