FeatureWeights.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef _FeatureWeights_h_
  2. #define _FeatureWeights_h_
  3. /* FeatureWeights.h
  4. *
  5. * Copyright (C) 2007-2008 Ola Söder, 2011,2017 Paul Boersma
  6. *
  7. * This code is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * This code is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. /*
  21. * os 20080529 Initial release
  22. * pb 2011/03/08
  23. */
  24. /////////////////////////////////////////////////////
  25. // Praat datatypes //
  26. /////////////////////////////////////////////////////
  27. #include "Data.h"
  28. #include "TableOfReal.h"
  29. #include "PatternList.h"
  30. #include "Categories.h"
  31. /////////////////////////////////////////////////////
  32. // Miscs //
  33. /////////////////////////////////////////////////////
  34. #include "OlaP.h"
  35. /////////////////////////////////////////////////////
  36. // Praat specifics //
  37. /////////////////////////////////////////////////////
  38. #include "FeatureWeights_def.h"
  39. /////////////////////////////////////////////////////
  40. // Private definitions and macros //
  41. /////////////////////////////////////////////////////
  42. #define FeatureWeights_areFriends(x,y) ! SimpleString_compare (x,y)
  43. #define FeatureWeights_areEnemies(x,y) SimpleString_compare (x,y)
  44. /////////////////////////////////////////////////////
  45. // Prototypes //
  46. /////////////////////////////////////////////////////
  47. // Create
  48. autoFeatureWeights FeatureWeights_create
  49. (
  50. integer nweights // number of weights
  51. );
  52. // Compute prior probabilities
  53. integer FeatureWeights_computePriors
  54. (
  55. Categories c, // source categories
  56. integer * indices, // Out: instances indices ..
  57. double * priors // Out: .. and their prior probabilities
  58. );
  59. // Compute feature weights (obsolete)
  60. autoFeatureWeights FeatureWeights_compute
  61. (
  62. PatternList pp, // Source pattern
  63. Categories c, // Source categories
  64. integer k // k(!)
  65. );
  66. // Compute feature weights according to the RELIEF-F algorithm
  67. autoFeatureWeights FeatureWeights_computeRELIEF
  68. (
  69. PatternList pp, // source pattern
  70. Categories c, // source categories
  71. integer k // k(!)
  72. );
  73. /* End of file FeatureWeights.h */
  74. #endif