Commit
refactor R installation
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Package: shogun | ||
Version: @VERSION@ | ||
Date: @DATE@ | ||
Title: The SHOGUN Machine Learning Toolbox | ||
Author: Shogun Team | ||
Maintainer: Shogun Team <shogun-team@shogun-toolbox.org> | ||
Depends: R (>= 2.10.0) | ||
Suggests: | ||
Description: SHOGUN - is a new machine learning toolbox with focus on large | ||
scale kernel methods and especially on Support Vector Machines (SVM) with focus | ||
to bioinformatics. It provides a generic SVM object interfacing to several | ||
different SVM implementations. Each of the SVMs can be combined with a variety | ||
of the many kernels implemented. It can deal with weighted linear combination | ||
of a number of sub-kernels, each of which not necessarily working on the same | ||
domain, where an optimal sub-kernel weighting can be learned using Multiple | ||
Kernel Learning. Apart from SVM 2-class classification and regression | ||
problems, a number of linear methods like Linear Discriminant Analysis (LDA), | ||
Linear Programming Machine (LPM), (Kernel) Perceptrons and also algorithms to | ||
train hidden markov models are implemented. The input feature-objects can be | ||
dense, sparse or strings and of type int/short/double/char and can be converted | ||
into different feature types. Chains of preprocessors (e.g. substracting the | ||
mean) can be attached to each feature object allowing for on-the-fly | ||
pre-processing. | ||
License: GPL Version 3 or later. | ||
URL: http://www.shogun-toolbox.org | ||
Built: @R_VERSION@; @PLATFORM@; @OSTYPE@; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
useDynLib(shogun, .registration = TRUE) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ | |
%rename(Hash) CHash; | ||
%rename(StructuredData) CStructuredData; | ||
%rename(DynamicObjectArray) CDynamicObjectArray; | ||
%rename(WrappedObjectArray) CWrappedObjectArray; | ||
%rename(Tokenizer) CTokenizer; | ||
%rename(DelimiterTokenizer) CDelimiterTokenizer; | ||
%rename(NGramTokenizer) CNGramTokenizer; | ||
|
@@ -399,7 +398,17 @@ namespace shogun | |
%include <shogun/lib/StructuredDataTypes.h> | ||
%include <shogun/lib/StructuredData.h> | ||
%include <shogun/lib/DynamicObjectArray.h> | ||
%include <shogun/lib/WrappedObjectArray.h> | ||
namespace shogun | ||
{ | ||
/* Specialize DynamicObjectArray::append_element function */ | ||
%template(append_element_real) CDynamicObjectArray::append_element<float64_t>; | ||
%template(append_element_float) CDynamicObjectArray::append_element<float32_t>; | ||
%template(append_element_int) CDynamicObjectArray::append_element<int32_t>; | ||
%template(append_element_real_vector) CDynamicObjectArray::append_element<SGVector<float64_t>>; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
vigsterkr
Author
Member
|
||
%template(append_element_float_vector) CDynamicObjectArray::append_element<SGVector<float32_t>>; | ||
%template(append_element_real_matrix) CDynamicObjectArray::append_element<SGMatrix<float64_t>>; | ||
%template(append_element_float_matrix) CDynamicObjectArray::append_element<SGMatrix<float32_t>>; | ||
} | ||
%include <shogun/lib/IndexBlock.h> | ||
%include <shogun/lib/IndexBlockRelation.h> | ||
%include <shogun/lib/IndexBlockGroup.h> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* -*- coding: utf-8 -*- | ||
* vim: set fileencoding=utf-8 | ||
* | ||
* Copyright (c) 2016, Shogun-Toolbox e.V. <shogun-team@shogun-toolbox.org> | ||
* Copyright (c) 2017, Shogun-Toolbox e.V. <shogun-team@shogun-toolbox.org> | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -31,81 +31,70 @@ | |
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* Authors: Heiko Strathmann | ||
*/ | ||
#ifdef USE_META_INTEGRATION_TESTS | ||
#ifndef WRAPPED_SGMATRIX_H__ | ||
#define WRAPPED_SGMATRIX_H__ | ||
#ifndef SHOGUN_SERIALIZABLE_H__ | ||
#define SHOGUN_SERIALIZABLE_H__ | ||
|
||
#include <shogun/base/SGObject.h> | ||
#include <shogun/lib/SGString.h> | ||
#include <shogun/lib/SGMatrix.h> | ||
|
||
|
||
namespace shogun | ||
{ | ||
|
||
/** @brief Simple wrapper class that allows to store any Shogun SGMatrix<T> | ||
* in a CSGObject, and therefore to make it serializable. Using a template | ||
* argument that is not a Shogun parameter will cause a compile error when | ||
* trying to register the passed value as a parameter in the constructors. | ||
template<typename T> | ||
struct extract_value_type | ||
{ | ||
typedef T value_type; | ||
}; | ||
|
||
template<template<typename, typename ...> class X, typename T, typename ...Args> | ||
struct extract_value_type<X<T, Args...>> | ||
{ | ||
typedef T value_type; | ||
}; | ||
|
||
/** @brief A trait that makes a none SGObject SG-serializable | ||
* This only works with classes derived of SGReferencedData (SGVector, SGMatrix etc) | ||
* and fundamental types (std::is_arithmetic) | ||
*/ | ||
template<class T> class CWrappedSGMatrix: public CSGObject | ||
template<class T> class CSerializable: public CSGObject | ||
This comment has been minimized.
Sorry, something went wrong.
vigsterkr
Author
Member
|
||
{ | ||
public: | ||
/** Default constructor. Do not use. */ | ||
CWrappedSGMatrix() : CSGObject() | ||
CSerializable() : CSGObject() | ||
{ | ||
set_generic<T>(); | ||
register_params(); | ||
init(); | ||
} | ||
|
||
/** Constructor. | ||
* @param value Value to wrap as CSGObject. | ||
* @param value Value to serialize as CSGObject. | ||
* @param value_name Name under which value is registered. | ||
*/ | ||
CWrappedSGMatrix(SGMatrix<T> value, const char* value_name="") | ||
CSerializable(T value, const char* value_name="") | ||
{ | ||
set_generic<T>(); | ||
register_params(); | ||
init(); | ||
m_value = value; | ||
m_value_name = value_name; | ||
} | ||
|
||
/** @return name of the CSGObject, without C prefix */ | ||
virtual const char* get_name() const { return "WrappedSGMatrix"; } | ||
virtual const char* get_name() const { return "Serializable"; } | ||
|
||
private: | ||
void register_params() | ||
void init() | ||
{ | ||
m_value_name = "Unnamed"; | ||
m_value = SGMatrix<T>(); | ||
SG_ADD(&m_value, "value", "Wrapped value", MS_NOT_AVAILABLE); | ||
set_generic<typename extract_value_type<T>::value_type>(); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
m_value_name = "Unnamed"; | ||
|
||
SG_ADD(&m_value, "value", "Serialized value", MS_NOT_AVAILABLE); | ||
} | ||
|
||
protected: | ||
/** Wrapped value. */ | ||
SGMatrix<T> m_value; | ||
/** Serialized value. */ | ||
T m_value; | ||
|
||
/** Name of wrapped value */ | ||
/** Name of serialized value */ | ||
const char* m_value_name; | ||
}; | ||
|
||
template class CWrappedSGMatrix<bool>; | ||
template class CWrappedSGMatrix<char>; | ||
template class CWrappedSGMatrix<int8_t>; | ||
template class CWrappedSGMatrix<uint8_t>; | ||
template class CWrappedSGMatrix<int16_t>; | ||
template class CWrappedSGMatrix<uint16_t>; | ||
template class CWrappedSGMatrix<int32_t>; | ||
template class CWrappedSGMatrix<uint32_t>; | ||
template class CWrappedSGMatrix<int64_t>; | ||
template class CWrappedSGMatrix<uint64_t>; | ||
template class CWrappedSGMatrix<float32_t>; | ||
template class CWrappedSGMatrix<float64_t>; | ||
template class CWrappedSGMatrix<floatmax_t>; | ||
|
||
}; | ||
#endif // WRAPPED_SGMATRIX_H__ | ||
#endif // USE_META_INTEGRATION_TESTS | ||
#endif // SHOGUN_SERIALIZABLE_H_ |
The old array could handle a mix of matrix/vector/scalar, not sure the dynamic object array can?