Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #698 from pluskid/multiclass
renaming java modular: euclidian => euclidean
  • Loading branch information
Soeren Sonnenburg committed Aug 9, 2012
2 parents 4b11e44 + 490741f commit d699fc5
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/interfaces/modular/Multiclass.i
Expand Up @@ -67,13 +67,14 @@
%include <shogun/machine/BaseMulticlassMachine.h>
%include <shogun/multiclass/tree/TreeMachine.h>
%include <shogun/multiclass/tree/RelaxedTreeNodeData.h>
%include <shogun/multiclass/tree/ConditionalProbabilityTree.h>
%include <shogun/multiclass/tree/ConditionalProbabilityTreeNodeData.h>
namespace shogun
{
%template(TreeMachineWithConditionalProbabilityTreeNodeData) CTreeMachine<ConditionalProbabilityTreeNodeData>;
%template(TreeMachineWithRelaxedTreeNodeData) CTreeMachine<RelaxedTreeNodeData>;
}

%include <shogun/multiclass/tree/ConditionalProbabilityTree.h>
%include <shogun/multiclass/tree/BalancedConditionalProbabilityTree.h>
%include <shogun/multiclass/tree/RandomConditionalProbabilityTree.h>
%include <shogun/multiclass/tree/RelaxedTree.h>
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/modular/Multiclass_includes.i
@@ -1,6 +1,7 @@
%{
#include <shogun/multiclass/tree/TreeMachine.h>
#include <shogun/multiclass/tree/RelaxedTreeNodeData.h>
#include <shogun/multiclass/tree/ConditionalProbabilityTreeNodeData.h>
#include <shogun/multiclass/tree/ConditionalProbabilityTree.h>
#include <shogun/multiclass/tree/BalancedConditionalProbabilityTree.h>
#include <shogun/multiclass/tree/RandomConditionalProbabilityTree.h>
Expand Down
14 changes: 1 addition & 13 deletions src/shogun/multiclass/tree/ConditionalProbabilityTree.h
Expand Up @@ -15,23 +15,11 @@

#include <shogun/features/streaming/StreamingDenseFeatures.h>
#include <shogun/multiclass/tree/TreeMachine.h>
#include <shogun/multiclass/tree/ConditionalProbabilityTreeNodeData.h>

namespace shogun
{

struct ConditionalProbabilityTreeNodeData
{
int32_t label;
float64_t p_right; // prob of right subtree, used in prediction

ConditionalProbabilityTreeNodeData():label(-1), p_right(0) {}

static void print(const ConditionalProbabilityTreeNodeData &data)
{
SG_SPRINT("label=%d\n", data.label);
}
};

/**
* Conditional Probability Tree.
*
Expand Down
34 changes: 34 additions & 0 deletions src/shogun/multiclass/tree/ConditionalProbabilityTreeNodeData.h
@@ -0,0 +1,34 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Written (W) 2012 Chiyuan Zhang
* Copyright (C) 2012 Chiyuan Zhang
*/

#ifndef CONDITIONALPROBABILITYTREENODEDATA_H__
#define CONDITIONALPROBABILITYTREENODEDATA_H__

namespace shogun
{

struct ConditionalProbabilityTreeNodeData
{
int32_t label;
float64_t p_right; // prob of right subtree, used in prediction

ConditionalProbabilityTreeNodeData():label(-1), p_right(0) {}

static void print(const ConditionalProbabilityTreeNodeData &data)
{
SG_SPRINT("label=%d\n", data.label);
}
};


} /* shogun */

#endif /* end of include guard: CONDITIONALPROBABILITYTREENODEDATA_H__ */

0 comments on commit d699fc5

Please sign in to comment.