Skip to content

Commit

Permalink
Replace modshogun by shogun everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Jul 5, 2017
1 parent 7507329 commit 75657cb
Show file tree
Hide file tree
Showing 320 changed files with 866 additions and 917 deletions.
61 changes: 5 additions & 56 deletions .gitignore
Expand Up @@ -52,53 +52,6 @@ cpplint.py
/src/configure-*-*.c*
/src/build-local

# modular interfaces
/src/interfaces/*_modular/*.doxy
/src/interfaces/*_modular/Evaluation.i
/src/interfaces/*_modular/Regression.i
/src/interfaces/*_modular/Library.i
/src/interfaces/*_modular/Distribution.i
/src/interfaces/*_modular/Structure.i
/src/interfaces/*_modular/Classifier.i
/src/interfaces/*_modular/Features.i
/src/interfaces/*_modular/Kernel.i
/src/interfaces/*_modular/Preprocessor.i
/src/interfaces/*_modular/Distance.i
/src/interfaces/*_modular/Clustering.i
/src/interfaces/*_modular/SGBase.i
/src/interfaces/*_modular/IO.i
/src/interfaces/*_modular/Mathematics.i
/src/interfaces/*_modular/ModelSelection.i
/src/interfaces/*_modular/modshogun.i
/src/interfaces/*_modular/modshogun_ignores.i
/src/interfaces/*_modular/*_includes.i
/src/interfaces/*_modular/Makefile
/src/interfaces/*_modular/Converter.i
/src/interfaces/*_modular/Multiclass.i
/src/interfaces/*_modular/Machine.i
/src/interfaces/*_modular/Transfer.i
/src/interfaces/*_modular/Loss.i
/src/interfaces/*_modular/Statistics.i
/src/interfaces/*_modular/Latent.i
/src/interfaces/*_modular/GaussianProcess.i

# particular modular ones
/src/interfaces/csharp_modular/*.cs
/src/interfaces/csharp_modular/abstract_types_extension.i
/src/interfaces/csharp_modular/modshogun.dll
/src/interfaces/java_modular/*.java
/src/interfaces/java_modular/*.jar
/src/interfaces/java_modular/*.class
/src/interfaces/java_modular/org/*
/src/interfaces/java_modular/shogun/*
/src/interfaces/python_modular/*.py
/src/interfaces/python_modular/abstract_types_extension.i
/src/interfaces/r_modular/*.R
/src/interfaces/r_modular/*.RData
/src/interfaces/perl_modular/*.pm
/src/interfaces/octave_modular/abstract_types_extension.i
/.duped_py_pl.pb

# /examples/
*.log
*.exe
Expand All @@ -108,9 +61,9 @@ cpplint.py
!/examples/undocumented/libshogun/*.cpp
!/examples/undocumented/libshogun/CMakeLists.txt
!/examples/undocumented/libshogun/tools/
!examples/undocumented/python_modular/graphical/
!examples/undocumented/python_modular/*.py
!examples/undocumented/python_modular/CMakeLists.txt
!examples/undocumented/python/graphical/
!examples/undocumented/python/*.py
!examples/undocumented/python/CMakeLists.txt

# /tests
/tests/unit/shogun-unit-test
Expand All @@ -120,12 +73,8 @@ cpplint.py
/tests/unit/*.json
/tests/unit/combined_kernel.weights
Testing/
examples/undocumented/python_modular/serialized_svm.bz2
examples/undocumented/python_modular/tmp/blaah.asc
examples/undocumented/python_modular/tmp/blaah.h5
examples/undocumented/python_modular/tmp/blaah.json
examples/undocumented/python_modular/tmp/blaah.xml
examples/undocumented/python_modular/vw_cache.dat.cache
examples/undocumented/python/serialized_svm.bz2
examples/undocumented/python/vw_cache.dat.cache

# cmake
/CMakeFiles/
Expand Down
2 changes: 1 addition & 1 deletion applications/classification/evaluate_multiclass_labels.py
Expand Up @@ -32,7 +32,7 @@
import argparse
import logging
import numpy as np
from modshogun import (LibSVMFile, MulticlassLabels, MulticlassAccuracy)
from shogun import (LibSVMFile, MulticlassLabels, MulticlassAccuracy)
from utils import get_features_and_labels

LOGGER = logging.getLogger(__file__)
Expand Down
2 changes: 1 addition & 1 deletion applications/classification/predict_multiclass_svm.py
Expand Up @@ -32,7 +32,7 @@
import argparse
import logging
from contextlib import closing
from modshogun import (LibSVMFile, SparseRealFeatures, MulticlassLabels,
from shogun import (LibSVMFile, SparseRealFeatures, MulticlassLabels,
MulticlassLibSVM, SerializableHdf5File,
MulticlassAccuracy)
from utils import get_features_and_labels
Expand Down
8 changes: 4 additions & 4 deletions applications/classification/random_fourier_classification.py
Expand Up @@ -32,7 +32,7 @@ def parse_arguments():
return parser.parse_args()

def evaluate(predicted_labels, labels, prefix="Results"):
from modshogun import PRCEvaluation, ROCEvaluation, AccuracyMeasure
from shogun import PRCEvaluation, ROCEvaluation, AccuracyMeasure

prc_evaluator = PRCEvaluation()
roc_evaluator = ROCEvaluation()
Expand All @@ -58,9 +58,9 @@ def load_sparse_data(filename, dimension=None):
return {'data':sparse_feats, 'labels':labels}

if __name__=='__main__':
from modshogun import SparseRealFeatures, RandomFourierDotFeatures, GAUSSIAN
from modshogun import LibSVMFile, BinaryLabels, SVMOcas
from modshogun import Time
from shogun import SparseRealFeatures, RandomFourierDotFeatures, GAUSSIAN
from shogun import LibSVMFile, BinaryLabels, SVMOcas
from shogun import Time
from numpy import array

args = parse_arguments()
Expand Down
2 changes: 1 addition & 1 deletion applications/classification/train_multiclass_svm.py
Expand Up @@ -32,7 +32,7 @@
import argparse
import logging
from contextlib import contextmanager, closing
from modshogun import (LibSVMFile, GaussianKernel, MulticlassLibSVM,
from shogun import (LibSVMFile, GaussianKernel, MulticlassLibSVM,
SerializableHdf5File, LinearKernel)
from utils import get_features_and_labels, track_execution

Expand Down
2 changes: 1 addition & 1 deletion applications/classification/utils.py
Expand Up @@ -30,7 +30,7 @@

import logging
from contextlib import contextmanager
from modshogun import MulticlassLabels, SparseRealFeatures, Time
from shogun import MulticlassLabels, SparseRealFeatures, Time


logging.basicConfig(level=logging.INFO, format='[%(asctime)-15s %(module)s] %(message)s')
Expand Down
2 changes: 1 addition & 1 deletion applications/easysvm/galaxy/README
@@ -1,3 +1,3 @@
The files in this directory are a copy of
svn/projects/galaxy/tools/agr. If you edit them, make sure the
changes are also integrated into the main version.
changes are also integrated into the main version.
2 changes: 1 addition & 1 deletion applications/msplicer/signal_detectors.py
Expand Up @@ -13,7 +13,7 @@
import numpy
import seqdict

from modshogun import KernelMachine,StringCharFeatures,DNA,WeightedDegreeStringKernel
from shogun import KernelMachine,StringCharFeatures,DNA,WeightedDegreeStringKernel

class svm_splice_model(object):
def __init__(self, order, traindat, alphas, b, (window_left,offset,window_right), consensus):
Expand Down
6 changes: 3 additions & 3 deletions applications/ocr/Ai.py
@@ -1,9 +1,9 @@
# File : $HeadURL$
# Version: $Id$

from modshogun import RealFeatures, MulticlassLabels
from modshogun import GaussianKernel
from modshogun import GMNPSVM
from shogun import RealFeatures, MulticlassLabels
from shogun import GaussianKernel
from shogun import GMNPSVM

import numpy as np
import gzip as gz
Expand Down
2 changes: 1 addition & 1 deletion applications/tapkee/faces_embedding.py
Expand Up @@ -8,7 +8,7 @@
# Written (W) 2011 Sergey Lisitsyn
# Copyright (C) 2011 Sergey Lisitsyn

from modshogun import *
from shogun import *
from numpy import *
from matplotlib.offsetbox import TextArea, DrawingArea, OffsetImage, AnnotationBbox
import re,os,time
Expand Down
2 changes: 1 addition & 1 deletion applications/tapkee/samples/dm.py
@@ -1,4 +1,4 @@
import modshogun as sg
import shogun as sg
import data
import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion applications/tapkee/samples/hlle.py
@@ -1,4 +1,4 @@
import modshogun as sg
import shogun as sg
import data

# load data
Expand Down
2 changes: 1 addition & 1 deletion applications/tapkee/samples/isomap.py
@@ -1,4 +1,4 @@
import modshogun as sg
import shogun as sg
import data
import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion applications/tapkee/samples/klle.py
@@ -1,4 +1,4 @@
import modshogun as sg
import shogun as sg
import data
import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion applications/tapkee/samples/la.py
@@ -1,4 +1,4 @@
import modshogun as sg
import shogun as sg
import data
import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion applications/tapkee/samples/lle.py
@@ -1,4 +1,4 @@
import modshogun as sg
import shogun as sg
import data

# load data
Expand Down
2 changes: 1 addition & 1 deletion applications/tapkee/samples/lltsa.py
@@ -1,4 +1,4 @@
import modshogun as sg
import shogun as sg
import data

# load data
Expand Down
2 changes: 1 addition & 1 deletion applications/tapkee/samples/lpp.py
@@ -1,4 +1,4 @@
import modshogun as sg
import shogun as sg
import data

# load data
Expand Down
2 changes: 1 addition & 1 deletion applications/tapkee/samples/ltsa.py
@@ -1,4 +1,4 @@
import modshogun as sg
import shogun as sg
import data

# load data
Expand Down
2 changes: 1 addition & 1 deletion applications/tapkee/samples/mds.py
@@ -1,4 +1,4 @@
import modshogun as sg
import shogun as sg
import data
import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion applications/tapkee/samples/npe.py
@@ -1,4 +1,4 @@
import modshogun as sg
import shogun as sg
import data

# load data
Expand Down
2 changes: 1 addition & 1 deletion applications/tapkee/words_embedding.py
Expand Up @@ -10,7 +10,7 @@

from numpy import *
from pylab import *
from modshogun import *
from shogun import *
import random
import difflib

Expand Down
22 changes: 11 additions & 11 deletions cmake/ShogunInterfaces.cmake
Expand Up @@ -37,12 +37,12 @@ ADD_CUSTOM_TARGET(${INTERFACE_TARGET_SRC}
COMMENT "copying SWIG files")

INCLUDE(${SWIG_USE_FILE})
SET_SOURCE_FILES_PROPERTIES(modshogun.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(shogun.i PROPERTIES CPLUSPLUS ON)
IF(DEFINED TARGET_SWIGFLAGS)
SET_SOURCE_FILES_PROPERTIES(modshogun.i PROPERTIES SWIG_FLAGS ${TARGET_SWIGFLAGS})
SET_SOURCE_FILES_PROPERTIES(shogun.i PROPERTIES SWIG_FLAGS ${TARGET_SWIGFLAGS})
ENDIF()
SET(SWIG_MODULE_${INTERFACE_NAME}_EXTRA_DEPS ${INTERFACE_FILES})
SWIG_ADD_MODULE(${INTERFACE_TARGET} ${INTERFACE_NAME} modshogun.i sg_print_functions.cpp)
SWIG_ADD_MODULE(${INTERFACE_TARGET} ${INTERFACE_NAME} shogun.i sg_print_functions.cpp)
SWIG_LINK_LIBRARIES(${INTERFACE_TARGET} shogun::shogun ${INTERFACE_LIBRARIES})


Expand All @@ -52,7 +52,7 @@ SWIG_LINK_LIBRARIES(${INTERFACE_TARGET} shogun::shogun ${INTERFACE_LIBRARIES})
# endforeach()

SET(INTERFACE_REAL_NAME ${SWIG_MODULE_interface_${INTERFACE_NAME}_REAL_NAME})
SET_TARGET_PROPERTIES(${INTERFACE_REAL_NAME} PROPERTIES OUTPUT_NAME ${PREPEND_TARGET}modshogun)
SET_TARGET_PROPERTIES(${INTERFACE_REAL_NAME} PROPERTIES OUTPUT_NAME ${PREPEND_TARGET}shogun)
ADD_DEPENDENCIES(${INTERFACE_REAL_NAME} ${INTERFACE_TARGET_SRC})

#ADD_CUSTOM_COMMAND(TARGETS ${PREPEND_TARGET}interface_${INTERFACE_NAME}
Expand All @@ -61,23 +61,23 @@ ADD_DEPENDENCIES(${INTERFACE_REAL_NAME} ${INTERFACE_TARGET_SRC})
# ARGS ${CMAKE_SOURCE_DIR}/src/.scrub_docstrings.py )

IF(DOXYGEN_FOUND)
configure_file(${COMMON_INTERFACE_SRC_DIR}/modshogun.doxy.in modshogun.doxy)
configure_file(${COMMON_INTERFACE_SRC_DIR}/shogun.doxy.in shogun.doxy)

ADD_CUSTOM_COMMAND(
OUTPUT modshogun
OUTPUT shogun
COMMAND ${DOXYGEN_EXECUTABLE}
ARGS modshogun.doxy
ARGS shogun.doxy
DEPENDS shogun::shogun
COMMENT "Generating doxygen doc"
)

ADD_CUSTOM_COMMAND(
OUTPUT modshogun_doxygen.i
OUTPUT shogun_doxygen.i
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/.doxy2swig.py
ARGS --quiet --no-function-definition modshogun/doxygen_xml/index.xml modshogun_doxygen.i
DEPENDS modshogun
ARGS --quiet --no-function-definition shogun/doxygen_xml/index.xml shogun_doxygen.i
DEPENDS shogun
)
ADD_CUSTOM_TARGET(${INTERFACE_NAME}_doxy2swig DEPENDS modshogun_doxygen.i)
ADD_CUSTOM_TARGET(${INTERFACE_NAME}_doxy2swig DEPENDS shogun_doxygen.i)
ADD_DEPENDENCIES(${INTERFACE_REAL_NAME} ${INTERFACE_NAME}_doxy2swig)
ELSE()
#TODO add scrubing
Expand Down
2 changes: 1 addition & 1 deletion doc/ipython-notebooks/classification/Classification.ipynb
Expand Up @@ -48,7 +48,7 @@
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import os\nSHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')\n",
"from modshogun import *"
"from shogun import *"
]
},
{
Expand Down
Expand Up @@ -77,7 +77,7 @@
"The response to that is to read our collection as it is and compute the hash of every token only when it's required, on-the-fly.<br>\n",
"<h3>On-the-fly Hashing with Shogun</h3>\n",
"We will now have a look at how the above idea is represented in the Shogun Toolbox. That is we will see how we can load our document collection in memory and consider a hashed document-term matrix with the hashing of every document (or token more specifically) happening on-the-fly, only when it's required to be computed. Altough it may sound a bit tricky, it's actually pretty straightforward and here is how.<br><br>\n",
"First of all we import the required components from the modshogun library."
"First of all we import the required components from the shogun library."
]
},
{
Expand All @@ -90,7 +90,7 @@
"source": [
"%matplotlib inline\n",
"import os\nSHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')\n",
"from modshogun import StringCharFeatures, RAWBYTE, HashedDocDotFeatures, NGramTokenizer"
"from shogun import StringCharFeatures, RAWBYTE, HashedDocDotFeatures, NGramTokenizer"
]
},
{
Expand Down Expand Up @@ -133,7 +133,7 @@
},
"outputs": [],
"source": [
"from modshogun import BinaryLabels\n",
"from shogun import BinaryLabels\n",
"from numpy import array\n",
"\n",
"labels = BinaryLabels(array([-1, 1, 1]))"
Expand Down Expand Up @@ -199,7 +199,7 @@
},
"outputs": [],
"source": [
"from modshogun import SVMOcas\n",
"from shogun import SVMOcas\n",
"\n",
"C = 0.1\n",
"epsilon = 0.01\n",
Expand Down
2 changes: 1 addition & 1 deletion doc/ipython-notebooks/classification/MKL.ipynb
Expand Up @@ -48,7 +48,7 @@
"%matplotlib inline\n",
"import os\nSHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')\n",
"# import all shogun classes\n",
"from modshogun import *"
"from shogun import *"
]
},
{
Expand Down
Expand Up @@ -119,7 +119,7 @@
"import os\nSHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')\n",
"import matplotlib.patches as patches\n",
"#To import all shogun classes\n",
"import modshogun as sg\n",
"import shogun as sg\n",
"import numpy as np\n",
"\n",
"#Generate some random data\n",
Expand Down
2 changes: 1 addition & 1 deletion doc/ipython-notebooks/clustering/GMM.ipynb
Expand Up @@ -114,7 +114,7 @@
"%matplotlib inline\n",
"import os\nSHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')\n",
"# import all Shogun classes\n",
"from modshogun import *"
"from shogun import *"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion doc/ipython-notebooks/clustering/KMeans.ipynb
Expand Up @@ -111,7 +111,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
"from modshogun import *\n",
"from shogun import *\n",
"\n",
"train_features = RealFeatures(rectangle)"
],
Expand Down
Expand Up @@ -107,7 +107,7 @@
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"from modshogun import *\n",
"from shogun import *\n",
"\n",
"# get the list of all jpg images from the path provided\n",
"import os\n",
Expand Down

0 comments on commit 75657cb

Please sign in to comment.