diff --git a/.gitignore b/.gitignore index a89d60808ca..20415f123e3 100644 --- a/.gitignore +++ b/.gitignore @@ -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 @@ -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 @@ -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/ diff --git a/applications/classification/evaluate_multiclass_labels.py b/applications/classification/evaluate_multiclass_labels.py index 030f5361db1..f720bb687d0 100644 --- a/applications/classification/evaluate_multiclass_labels.py +++ b/applications/classification/evaluate_multiclass_labels.py @@ -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__) diff --git a/applications/classification/predict_multiclass_svm.py b/applications/classification/predict_multiclass_svm.py index 88ce0d6b504..79585ec6784 100644 --- a/applications/classification/predict_multiclass_svm.py +++ b/applications/classification/predict_multiclass_svm.py @@ -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 diff --git a/applications/classification/random_fourier_classification.py b/applications/classification/random_fourier_classification.py index bf5468a893f..07350cde384 100644 --- a/applications/classification/random_fourier_classification.py +++ b/applications/classification/random_fourier_classification.py @@ -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() @@ -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() diff --git a/applications/classification/train_multiclass_svm.py b/applications/classification/train_multiclass_svm.py index 5dfb1fa4c41..39e17d2619c 100644 --- a/applications/classification/train_multiclass_svm.py +++ b/applications/classification/train_multiclass_svm.py @@ -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 diff --git a/applications/classification/utils.py b/applications/classification/utils.py index 40da45d9ae0..e459c39e97e 100644 --- a/applications/classification/utils.py +++ b/applications/classification/utils.py @@ -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') diff --git a/applications/easysvm/galaxy/README b/applications/easysvm/galaxy/README index a45fe881a7b..1e7b2566082 100644 --- a/applications/easysvm/galaxy/README +++ b/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. \ No newline at end of file +changes are also integrated into the main version. diff --git a/applications/msplicer/signal_detectors.py b/applications/msplicer/signal_detectors.py index f10096d35cb..e12002c2d5f 100644 --- a/applications/msplicer/signal_detectors.py +++ b/applications/msplicer/signal_detectors.py @@ -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): diff --git a/applications/ocr/Ai.py b/applications/ocr/Ai.py index 73edfb261b0..f8a3284ae52 100644 --- a/applications/ocr/Ai.py +++ b/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 diff --git a/applications/tapkee/faces_embedding.py b/applications/tapkee/faces_embedding.py index 1931d9fad93..24cf327031d 100644 --- a/applications/tapkee/faces_embedding.py +++ b/applications/tapkee/faces_embedding.py @@ -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 diff --git a/applications/tapkee/samples/dm.py b/applications/tapkee/samples/dm.py index 8c1d3b87efd..036028dfd44 100644 --- a/applications/tapkee/samples/dm.py +++ b/applications/tapkee/samples/dm.py @@ -1,4 +1,4 @@ -import modshogun as sg +import shogun as sg import data import numpy as np diff --git a/applications/tapkee/samples/hlle.py b/applications/tapkee/samples/hlle.py index 7360941b614..0dc860931c0 100644 --- a/applications/tapkee/samples/hlle.py +++ b/applications/tapkee/samples/hlle.py @@ -1,4 +1,4 @@ -import modshogun as sg +import shogun as sg import data # load data diff --git a/applications/tapkee/samples/isomap.py b/applications/tapkee/samples/isomap.py index 086bf2cbc2e..1d0569e1662 100644 --- a/applications/tapkee/samples/isomap.py +++ b/applications/tapkee/samples/isomap.py @@ -1,4 +1,4 @@ -import modshogun as sg +import shogun as sg import data import numpy as np diff --git a/applications/tapkee/samples/klle.py b/applications/tapkee/samples/klle.py index 1075a357c1e..77b9908cd68 100644 --- a/applications/tapkee/samples/klle.py +++ b/applications/tapkee/samples/klle.py @@ -1,4 +1,4 @@ -import modshogun as sg +import shogun as sg import data import numpy as np diff --git a/applications/tapkee/samples/la.py b/applications/tapkee/samples/la.py index 46e61451277..b125fcc67c8 100644 --- a/applications/tapkee/samples/la.py +++ b/applications/tapkee/samples/la.py @@ -1,4 +1,4 @@ -import modshogun as sg +import shogun as sg import data import numpy as np diff --git a/applications/tapkee/samples/lle.py b/applications/tapkee/samples/lle.py index 60740d3eb71..f0a05dd4599 100644 --- a/applications/tapkee/samples/lle.py +++ b/applications/tapkee/samples/lle.py @@ -1,4 +1,4 @@ -import modshogun as sg +import shogun as sg import data # load data diff --git a/applications/tapkee/samples/lltsa.py b/applications/tapkee/samples/lltsa.py index 12c19da02a4..f59a3fb2ea3 100644 --- a/applications/tapkee/samples/lltsa.py +++ b/applications/tapkee/samples/lltsa.py @@ -1,4 +1,4 @@ -import modshogun as sg +import shogun as sg import data # load data diff --git a/applications/tapkee/samples/lpp.py b/applications/tapkee/samples/lpp.py index f5d44662cbb..9c9c4e87f37 100644 --- a/applications/tapkee/samples/lpp.py +++ b/applications/tapkee/samples/lpp.py @@ -1,4 +1,4 @@ -import modshogun as sg +import shogun as sg import data # load data diff --git a/applications/tapkee/samples/ltsa.py b/applications/tapkee/samples/ltsa.py index 6d4f32734aa..2c2d760cd4a 100644 --- a/applications/tapkee/samples/ltsa.py +++ b/applications/tapkee/samples/ltsa.py @@ -1,4 +1,4 @@ -import modshogun as sg +import shogun as sg import data # load data diff --git a/applications/tapkee/samples/mds.py b/applications/tapkee/samples/mds.py index d758dce1ed4..4f0f8ffe633 100644 --- a/applications/tapkee/samples/mds.py +++ b/applications/tapkee/samples/mds.py @@ -1,4 +1,4 @@ -import modshogun as sg +import shogun as sg import data import numpy as np diff --git a/applications/tapkee/samples/npe.py b/applications/tapkee/samples/npe.py index a413a08856c..cefa4880bdf 100644 --- a/applications/tapkee/samples/npe.py +++ b/applications/tapkee/samples/npe.py @@ -1,4 +1,4 @@ -import modshogun as sg +import shogun as sg import data # load data diff --git a/applications/tapkee/words_embedding.py b/applications/tapkee/words_embedding.py index faa1e8af613..d74deb215e6 100644 --- a/applications/tapkee/words_embedding.py +++ b/applications/tapkee/words_embedding.py @@ -10,7 +10,7 @@ from numpy import * from pylab import * -from modshogun import * +from shogun import * import random import difflib diff --git a/cmake/ShogunInterfaces.cmake b/cmake/ShogunInterfaces.cmake index 238ad13a7ca..7d91d36d9d7 100644 --- a/cmake/ShogunInterfaces.cmake +++ b/cmake/ShogunInterfaces.cmake @@ -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}) @@ -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} @@ -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 diff --git a/doc/ipython-notebooks/classification/Classification.ipynb b/doc/ipython-notebooks/classification/Classification.ipynb index 8cf310c7280..e9364f1b4a5 100644 --- a/doc/ipython-notebooks/classification/Classification.ipynb +++ b/doc/ipython-notebooks/classification/Classification.ipynb @@ -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 *" ] }, { diff --git a/doc/ipython-notebooks/classification/HashedDocDotFeatures.ipynb b/doc/ipython-notebooks/classification/HashedDocDotFeatures.ipynb index a413c70e7d1..34395685bbb 100644 --- a/doc/ipython-notebooks/classification/HashedDocDotFeatures.ipynb +++ b/doc/ipython-notebooks/classification/HashedDocDotFeatures.ipynb @@ -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.
\n", "

On-the-fly Hashing with Shogun

\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.

\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." ] }, { @@ -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" ] }, { @@ -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]))" @@ -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", diff --git a/doc/ipython-notebooks/classification/MKL.ipynb b/doc/ipython-notebooks/classification/MKL.ipynb index f429c88fec4..d7d8bf5bffa 100644 --- a/doc/ipython-notebooks/classification/MKL.ipynb +++ b/doc/ipython-notebooks/classification/MKL.ipynb @@ -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 *" ] }, { diff --git a/doc/ipython-notebooks/classification/SupportVectorMachines.ipynb b/doc/ipython-notebooks/classification/SupportVectorMachines.ipynb index 702a013bc53..a5b5bb51a2c 100644 --- a/doc/ipython-notebooks/classification/SupportVectorMachines.ipynb +++ b/doc/ipython-notebooks/classification/SupportVectorMachines.ipynb @@ -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", diff --git a/doc/ipython-notebooks/clustering/GMM.ipynb b/doc/ipython-notebooks/clustering/GMM.ipynb index 884399a3b77..28b9f7cd373 100644 --- a/doc/ipython-notebooks/clustering/GMM.ipynb +++ b/doc/ipython-notebooks/clustering/GMM.ipynb @@ -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 *" ] }, { diff --git a/doc/ipython-notebooks/clustering/KMeans.ipynb b/doc/ipython-notebooks/clustering/KMeans.ipynb index eacb76706ff..83c070e0247 100644 --- a/doc/ipython-notebooks/clustering/KMeans.ipynb +++ b/doc/ipython-notebooks/clustering/KMeans.ipynb @@ -111,7 +111,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import *\n", + "from shogun import *\n", "\n", "train_features = RealFeatures(rectangle)" ], diff --git a/doc/ipython-notebooks/computer_vision/Scene_classification.ipynb b/doc/ipython-notebooks/computer_vision/Scene_classification.ipynb index cb773bddc6d..cff09beb824 100644 --- a/doc/ipython-notebooks/computer_vision/Scene_classification.ipynb +++ b/doc/ipython-notebooks/computer_vision/Scene_classification.ipynb @@ -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", diff --git a/doc/ipython-notebooks/converter/Tapkee.ipynb b/doc/ipython-notebooks/converter/Tapkee.ipynb index ace962f0905..307c024eb54 100644 --- a/doc/ipython-notebooks/converter/Tapkee.ipynb +++ b/doc/ipython-notebooks/converter/Tapkee.ipynb @@ -130,7 +130,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import Isomap, RealFeatures, MultidimensionalScaling\n", + "from shogun import Isomap, RealFeatures, MultidimensionalScaling\n", "\n", "# wrap data into Shogun features\n", "data, colors = generate_data('swissroll')\n", @@ -175,7 +175,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import StochasticProximityEmbedding\n", + "from shogun import StochasticProximityEmbedding\n", "\n", "# wrap data into Shogun features\n", "data, colors = generate_data('helix')\n", diff --git a/doc/ipython-notebooks/distributions/KernelDensity.ipynb b/doc/ipython-notebooks/distributions/KernelDensity.ipynb index e28226916e3..f93c15563ab 100644 --- a/doc/ipython-notebooks/distributions/KernelDensity.ipynb +++ b/doc/ipython-notebooks/distributions/KernelDensity.ipynb @@ -123,7 +123,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import KernelDensity, RealFeatures, K_GAUSSIAN, D_EUCLIDEAN, EM_KDTREE_SINGLE\n", + "from shogun import KernelDensity, RealFeatures, K_GAUSSIAN, D_EUCLIDEAN, EM_KDTREE_SINGLE\n", "\n", "def get_kde_result(bandwidth,samples):\n", " # set model parameters\n", @@ -352,7 +352,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import KernelDensity, RealFeatures, K_GAUSSIAN, D_EUCLIDEAN, EM_BALLTREE_DUAL\n", + "from shogun import KernelDensity, RealFeatures, K_GAUSSIAN, D_EUCLIDEAN, EM_BALLTREE_DUAL\n", "import scipy.interpolate as interpolate\n", "\n", "def get_kde(samples):\n", diff --git a/doc/ipython-notebooks/evaluation/xval_modelselection.ipynb b/doc/ipython-notebooks/evaluation/xval_modelselection.ipynb index cb88db11067..9a786d8bdf5 100644 --- a/doc/ipython-notebooks/evaluation/xval_modelselection.ipynb +++ b/doc/ipython-notebooks/evaluation/xval_modelselection.ipynb @@ -69,7 +69,7 @@ "%matplotlib inline\n", "# include all Shogun classes\n", "import os\nSHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')\n", - "from modshogun import *\n", + "from shogun import *\n", "# generate some ultra easy training data\n", "gray()\n", "n=20\n", diff --git a/doc/ipython-notebooks/gaussian_process/gaussian_processes.ipynb b/doc/ipython-notebooks/gaussian_process/gaussian_processes.ipynb index a74e9d118fa..374b9a10093 100644 --- a/doc/ipython-notebooks/gaussian_process/gaussian_processes.ipynb +++ b/doc/ipython-notebooks/gaussian_process/gaussian_processes.ipynb @@ -31,7 +31,7 @@ "source": [ "%matplotlib inline\n", "# import all shogun classes\n", - "from modshogun import *\n", + "from shogun import *\n", "import random\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", diff --git a/doc/ipython-notebooks/gaussian_process/variational_classifier.ipynb b/doc/ipython-notebooks/gaussian_process/variational_classifier.ipynb index f8e5db47a6a..6031bf5ad52 100644 --- a/doc/ipython-notebooks/gaussian_process/variational_classifier.ipynb +++ b/doc/ipython-notebooks/gaussian_process/variational_classifier.ipynb @@ -90,7 +90,7 @@ "%matplotlib inline\n", "# import all shogun classes\n", "import os\nSHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')\n", - "from modshogun import *\n", + "from shogun import *\n", "\n", "# import all required libraries\n", "import scipy\n", diff --git a/doc/ipython-notebooks/ica/bss_image.ipynb b/doc/ipython-notebooks/ica/bss_image.ipynb index 7d92ceb1feb..a843d7816be 100644 --- a/doc/ipython-notebooks/ica/bss_image.ipynb +++ b/doc/ipython-notebooks/ica/bss_image.ipynb @@ -161,8 +161,8 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import RealFeatures\n", - "from modshogun import Jade\n", + "from shogun import RealFeatures\n", + "from shogun import Jade\n", "\n", "mixed_signals = RealFeatures(X)\n", "\n", diff --git a/doc/ipython-notebooks/intro/Introduction.ipynb b/doc/ipython-notebooks/intro/Introduction.ipynb index f0a8e41fecf..f939e1b52ef 100644 --- a/doc/ipython-notebooks/intro/Introduction.ipynb +++ b/doc/ipython-notebooks/intro/Introduction.ipynb @@ -61,7 +61,7 @@ "%matplotlib inline\n", "import os\nSHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')\n", "#To import all Shogun classes\n", - "from modshogun import *" + "from shogun import *" ] }, { diff --git a/doc/ipython-notebooks/logdet/logdet.ipynb b/doc/ipython-notebooks/logdet/logdet.ipynb index 48d502246f7..c9e1e4d9391 100644 --- a/doc/ipython-notebooks/logdet/logdet.ipynb +++ b/doc/ipython-notebooks/logdet/logdet.ipynb @@ -93,7 +93,7 @@ }, "outputs": [], "source": [ - "from modshogun import RealSparseMatrixOperator, LanczosEigenSolver\n", + "from shogun import RealSparseMatrixOperator, LanczosEigenSolver\n", "\n", "op = RealSparseMatrixOperator(A.tocsc())\n", "\n", @@ -125,7 +125,7 @@ "source": [ "# We can specify the power of the sparse-matrix that is to be used for coloring, default values will apply a\n", "# 2-distance greedy graph coloring algorithm on the sparse-matrix itself. Matrix-power, if specified, is computed in O(lg p)\n", - "from modshogun import ProbingSampler\n", + "from shogun import ProbingSampler\n", "\n", "trace_sampler = ProbingSampler(op)\n", "# apply the graph coloring algorithm and generate the number of colors, i.e. number of trace samples\n", @@ -150,7 +150,7 @@ }, "outputs": [], "source": [ - "from modshogun import SerialComputationEngine, CGMShiftedFamilySolver, LogRationalApproximationCGM\n", + "from shogun import SerialComputationEngine, CGMShiftedFamilySolver, LogRationalApproximationCGM\n", "\n", "engine = SerialComputationEngine()\n", "cgm = CGMShiftedFamilySolver()\n", @@ -182,7 +182,7 @@ "outputs": [], "source": [ "import numpy as np\n", - "from modshogun import LogDetEstimator\n", + "from shogun import LogDetEstimator\n", "\n", "# number of log-det samples (use a higher number to get better estimates)\n", "# (this is 5 times number of colors estimate in practice, so usually 1 probing estimate is enough)\n", @@ -213,7 +213,7 @@ "# the following method requires massive amount of memory, for demonstration purpose\n", "# the following code is commented out and direct value obtained from running it once is used\n", "\n", - "# from modshogun import Statistics\n", + "# from shogun import Statistics\n", "# actual_logdet = Statistics.log_det(A)\n", "\n", "actual_logdet = 7120357.73878\n", @@ -282,7 +282,7 @@ "probing_estimates = log_det_estimator.sample(num_probing_estimates)\n", "\n", "# computing log-det estimates using Gaussian sampler\n", - "from modshogun import NormalSampler, Statistics\n", + "from shogun import NormalSampler, Statistics\n", "\n", "num_colors = probing_sampler.get_num_samples()\n", "normal_sampler = NormalSampler(op.get_dimension())\n", @@ -447,7 +447,7 @@ }, "outputs": [], "source": [ - "from modshogun import RealSparseMatrixOperator, ComplexDenseMatrixOperator\n", + "from shogun import RealSparseMatrixOperator, ComplexDenseMatrixOperator\n", "\n", "dim = 5\n", "np.random.seed(10)\n", @@ -487,7 +487,7 @@ "source": [ "from scipy.sparse import csc_matrix\n", "from scipy.sparse import identity\n", - "from modshogun import ConjugateGradientSolver\n", + "from shogun import ConjugateGradientSolver\n", "\n", "# creating a random spd matrix\n", "dim = 5\n", @@ -532,8 +532,8 @@ }, "outputs": [], "source": [ - "from modshogun import ComplexSparseMatrixOperator\n", - "from modshogun import ConjugateOrthogonalCGSolver\n", + "from shogun import ComplexSparseMatrixOperator\n", + "from shogun import ConjugateOrthogonalCGSolver\n", "\n", "# creating a random spd matrix\n", "dim = 5\n", @@ -580,7 +580,7 @@ }, "outputs": [], "source": [ - "from modshogun import CGMShiftedFamilySolver\n", + "from shogun import CGMShiftedFamilySolver\n", "\n", "cgm = CGMShiftedFamilySolver()\n", "\n", @@ -652,7 +652,7 @@ }, "outputs": [], "source": [ - "from modshogun import DirectSparseLinearSolver\n", + "from shogun import DirectSparseLinearSolver\n", "\n", "# creating a random spd matrix\n", "dim = 5\n", @@ -691,7 +691,7 @@ }, "outputs": [], "source": [ - "from modshogun import DirectLinearSolverComplex\n", + "from shogun import DirectLinearSolverComplex\n", "\n", "# creating a random spd matrix\n", "dim = 5\n", diff --git a/doc/ipython-notebooks/metric/LMNN.ipynb b/doc/ipython-notebooks/metric/LMNN.ipynb index 3ee07c04ba6..112ea1abc93 100644 --- a/doc/ipython-notebooks/metric/LMNN.ipynb +++ b/doc/ipython-notebooks/metric/LMNN.ipynb @@ -177,7 +177,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import RealFeatures, MulticlassLabels\n", + "from shogun import RealFeatures, MulticlassLabels\n", "\n", "features = RealFeatures(x.T)\n", "labels = MulticlassLabels(y.astype(numpy.float64))" @@ -197,7 +197,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import LMNN\n", + "from shogun import LMNN\n", "\n", "# number of target neighbours per example\n", "k = 1\n", @@ -384,7 +384,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import KNN, EuclideanDistance, LMNN, RealFeatures, MulticlassLabels\n", + "from shogun import KNN, EuclideanDistance, LMNN, RealFeatures, MulticlassLabels\n", "\n", "def plot_neighborhood_graph(x, nn, axis=pyplot, cols=['r', 'b', 'g', 'm', 'k', 'y']):\n", "\tfor i in xrange(x.shape[0]):\n", @@ -480,7 +480,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import CSVFile, RealFeatures, MulticlassLabels\n", + "from shogun import CSVFile, RealFeatures, MulticlassLabels\n", "\n", "ape_features = RealFeatures(CSVFile(os.path.join(SHOGUN_DATA_DIR, 'multiclass/fm_ape_gut.dat')))\n", "ape_labels = MulticlassLabels(CSVFile(os.path.join(SHOGUN_DATA_DIR, 'multiclass/label_ape_gut.dat')))" @@ -518,7 +518,7 @@ "collapsed": false, "input": [ "def visualize_tdsne(features, labels):\n", - " from modshogun import TDistributedStochasticNeighborEmbedding\n", + " from shogun import TDistributedStochasticNeighborEmbedding\n", " \n", " converter = TDistributedStochasticNeighborEmbedding()\n", " converter.set_target_dim(2)\n", @@ -561,9 +561,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import KNN, EuclideanDistance\n", - "from modshogun import StratifiedCrossValidationSplitting, CrossValidation\n", - "from modshogun import CrossValidationResult, MulticlassAccuracy\n", + "from shogun import KNN, EuclideanDistance\n", + "from shogun import StratifiedCrossValidationSplitting, CrossValidation\n", + "from shogun import CrossValidationResult, MulticlassAccuracy\n", "\n", "# set up the classifier\n", "knn = KNN()\n", @@ -622,7 +622,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import LMNN\n", + "from shogun import LMNN\n", "import numpy\n", "\n", "# to make training faster, use a portion of the features\n", @@ -712,7 +712,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import CSVFile, RealFeatures, MulticlassLabels\n", + "from shogun import CSVFile, RealFeatures, MulticlassLabels\n", "\n", "wine_features = RealFeatures(CSVFile(os.path.join(SHOGUN_DATA_DIR, 'uci/wine/fm_wine.dat')))\n", "wine_labels = MulticlassLabels(CSVFile(os.path.join(SHOGUN_DATA_DIR, 'uci/wine/label_wine.dat')))\n", @@ -736,9 +736,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import KNN, EuclideanDistance\n", - "from modshogun import StratifiedCrossValidationSplitting, CrossValidation\n", - "from modshogun import CrossValidationResult, MulticlassAccuracy\n", + "from shogun import KNN, EuclideanDistance\n", + "from shogun import StratifiedCrossValidationSplitting, CrossValidation\n", + "from shogun import CrossValidationResult, MulticlassAccuracy\n", "import numpy\n", "\n", "# kNN classifier\n", @@ -775,7 +775,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import LMNN\n", + "from shogun import LMNN\n", "\n", "# train LMNN\n", "lmnn = LMNN(wine_features, wine_labels, k)\n", @@ -838,7 +838,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import RescaleFeatures\n", + "from shogun import RescaleFeatures\n", "\n", "# preprocess features so that all of them vary within [0,1]\n", "preprocessor = RescaleFeatures()\n", diff --git a/doc/ipython-notebooks/multiclass/KNN.ipynb b/doc/ipython-notebooks/multiclass/KNN.ipynb index c5de58b52ab..68b2b174973 100644 --- a/doc/ipython-notebooks/multiclass/KNN.ipynb +++ b/doc/ipython-notebooks/multiclass/KNN.ipynb @@ -136,8 +136,8 @@ }, "outputs": [], "source": [ - "from modshogun import MulticlassLabels, RealFeatures\n", - "from modshogun import KNN, EuclideanDistance\n", + "from shogun import MulticlassLabels, RealFeatures\n", + "from shogun import KNN, EuclideanDistance\n", "\n", "labels = MulticlassLabels(Ytrain)\n", "feats = RealFeatures(Xtrain)\n", @@ -151,7 +151,7 @@ "print \"Predictions\", pred[:5]\n", "print \"Ground Truth\", Ytest[:5]\n", "\n", - "from modshogun import MulticlassAccuracy\n", + "from shogun import MulticlassAccuracy\n", "evaluator = MulticlassAccuracy()\n", "accuracy = evaluator.evaluate(pred, labels_test)\n", "\n", @@ -249,7 +249,7 @@ }, "outputs": [], "source": [ - "from modshogun import Time, KNN_COVER_TREE, KNN_BRUTE\n", + "from shogun import Time, KNN_COVER_TREE, KNN_BRUTE\n", "start = Time.get_curtime()\n", "knn.set_k(3)\n", "knn.set_knn_solver_type(KNN_BRUTE)\n", @@ -280,7 +280,7 @@ "outputs": [], "source": [ "def evaluate(labels, feats, use_cover_tree=False):\n", - " from modshogun import MulticlassAccuracy, CrossValidationSplitting\n", + " from shogun import MulticlassAccuracy, CrossValidationSplitting\n", " import time\n", " split = CrossValidationSplitting(labels, Nsplit)\n", " split.build_subsets()\n", @@ -422,7 +422,7 @@ }, "outputs": [], "source": [ - "from modshogun import GaussianKernel, GMNPSVM\n", + "from shogun import GaussianKernel, GMNPSVM\n", "\n", "width=80\n", "C=1\n", diff --git a/doc/ipython-notebooks/multiclass/Tree/DecisionTrees.ipynb b/doc/ipython-notebooks/multiclass/Tree/DecisionTrees.ipynb index 81ebc07ef7a..02f35db823f 100644 --- a/doc/ipython-notebooks/multiclass/Tree/DecisionTrees.ipynb +++ b/doc/ipython-notebooks/multiclass/Tree/DecisionTrees.ipynb @@ -199,7 +199,7 @@ }, "outputs": [], "source": [ - "from modshogun import ID3ClassifierTree, RealFeatures, MulticlassLabels\n", + "from shogun import ID3ClassifierTree, RealFeatures, MulticlassLabels\n", "from numpy import array, concatenate\n", "\n", "# encoding dictionary\n", @@ -561,7 +561,7 @@ }, "outputs": [], "source": [ - "from modshogun import MulticlassAccuracy\n", + "from shogun import MulticlassAccuracy\n", "\n", "# Shogun object for calculating multiclass accuracy\n", "accuracy = MulticlassAccuracy()\n", @@ -698,7 +698,7 @@ "source": [ "import matplotlib.pyplot as plt\n", "from numpy import ones, zeros, random, concatenate\n", - "from modshogun import RealFeatures, MulticlassLabels\n", + "from shogun import RealFeatures, MulticlassLabels\n", "% matplotlib inline\n", "\n", "def create_toy_classification_dataset(ncat,do_plot):\n", @@ -780,7 +780,7 @@ "outputs": [], "source": [ "from numpy import array\n", - "from modshogun import C45ClassifierTree\n", + "from shogun import C45ClassifierTree\n", "\n", "# steps in C4.5 Tree training bundled together in a python method\n", "def train_tree(feats,types,labels):\n", @@ -1028,7 +1028,7 @@ }, "outputs": [], "source": [ - "from modshogun import RealFeatures, MulticlassLabels\n", + "from shogun import RealFeatures, MulticlassLabels\n", "\n", "# training data\n", "feats_train = RealFeatures(feats_train)\n", @@ -1138,7 +1138,7 @@ }, "outputs": [], "source": [ - "from modshogun import MulticlassAccuracy\n", + "from shogun import MulticlassAccuracy\n", "\n", "# Shogun object for calculating multiclass accuracy\n", "accuracy = MulticlassAccuracy()\n", @@ -1258,7 +1258,7 @@ }, "outputs": [], "source": [ - "from modshogun import PT_MULTICLASS, CARTree\n", + "from shogun import PT_MULTICLASS, CARTree\n", "from numpy import array\n", "\n", "def train_carttree(feat_types,problem_type,num_folds,use_cv_pruning,labels,features):\n", @@ -1342,7 +1342,7 @@ }, "outputs": [], "source": [ - "from modshogun import RegressionLabels, RealFeatures\n", + "from shogun import RegressionLabels, RealFeatures\n", "from numpy import random, sin, linspace\n", "import matplotlib.pyplot as plt\n", "% matplotlib inline\n", @@ -1400,7 +1400,7 @@ }, "outputs": [], "source": [ - "from modshogun import PT_REGRESSION\n", + "from shogun import PT_REGRESSION\n", "from numpy import array\n", "\n", "# feature type - continuous\n", @@ -1539,7 +1539,7 @@ }, "outputs": [], "source": [ - "from modshogun import CARTree, PT_MULTICLASS\n", + "from shogun import CARTree, PT_MULTICLASS\n", "\n", "# set attribute types - all continuous\n", "feature_types = array([False, False, False, False])\n", @@ -1568,8 +1568,8 @@ }, "outputs": [], "source": [ - "from modshogun import RealFeatures, MulticlassLabels\n", - "from modshogun import CrossValidation, MulticlassAccuracy, CrossValidationSplitting, CrossValidationResult\n", + "from shogun import RealFeatures, MulticlassLabels\n", + "from shogun import CrossValidation, MulticlassAccuracy, CrossValidationSplitting, CrossValidationResult\n", "\n", "# training features\n", "feats_train = RealFeatures(feat)\n", @@ -1673,8 +1673,8 @@ }, "outputs": [], "source": [ - "from modshogun import CARTree, RegressionLabels, PT_REGRESSION, MeanSquaredError\n", - "from modshogun import CrossValidation, CrossValidationSplitting, CrossValidationResult\n", + "from shogun import CARTree, RegressionLabels, PT_REGRESSION, MeanSquaredError\n", + "from shogun import CrossValidation, CrossValidationSplitting, CrossValidationResult\n", "\n", "# form training features\n", "feats_train = RealFeatures(feat)\n", @@ -1818,7 +1818,7 @@ }, "outputs": [], "source": [ - "from modshogun import PT_MULTICLASS, CHAIDTree\n", + "from shogun import PT_MULTICLASS, CHAIDTree\n", "from numpy import array, dtype, int32\n", "\n", "def train_chaidtree(dependent_var_type,feature_types,num_bins,features,labels):\n", @@ -2002,7 +2002,7 @@ }, "outputs": [], "source": [ - "from modshogun import CSVFile, RealFeatures, MulticlassLabels\n", + "from shogun import CSVFile, RealFeatures, MulticlassLabels\n", "\n", "train_feats=RealFeatures(CSVFile( os.path.join(SHOGUN_DATA_DIR, 'uci/wine/fm_wine.dat')))\n", "train_labels=MulticlassLabels(CSVFile( os.path.join(SHOGUN_DATA_DIR, 'uci/wine/label_wine.dat')))" @@ -2028,7 +2028,7 @@ }, "outputs": [], "source": [ - "from modshogun import CHAIDTree, MulticlassLabels\n", + "from shogun import CHAIDTree, MulticlassLabels\n", "\n", "# set attribute types - all attributes are continuous(2)\n", "feature_types = array([2 for i in range(13)],dtype=int32) \n", @@ -2059,7 +2059,7 @@ "source": [ "# set up cross validation class\n", "\n", - "from modshogun import CrossValidation, CrossValidationSplitting, CrossValidationResult, MulticlassAccuracy\n", + "from shogun import CrossValidation, CrossValidationSplitting, CrossValidationResult, MulticlassAccuracy\n", "\n", "# set evaluation criteria - multiclass accuracy\n", "accuracy = MulticlassAccuracy()\n", @@ -2106,7 +2106,7 @@ }, "outputs": [], "source": [ - "from modshogun import CSVFile, RealFeatures, RegressionLabels\n", + "from shogun import CSVFile, RealFeatures, RegressionLabels\n", "from numpy import ptp\n", "\n", "train_feats=RealFeatures(CSVFile( os.path.join(SHOGUN_DATA_DIR, 'uci/housing/fm_housing.dat')))\n", @@ -2136,8 +2136,8 @@ }, "outputs": [], "source": [ - "from modshogun import CHAIDTree, MeanSquaredError\n", - "from modshogun import CrossValidation, CrossValidationSplitting, CrossValidationResult\n", + "from shogun import CHAIDTree, MeanSquaredError\n", + "from shogun import CrossValidation, CrossValidationSplitting, CrossValidationResult\n", "from numpy import array, dtype, int32\n", "\n", "def get_cv_error(max_depth):\n", diff --git a/doc/ipython-notebooks/multiclass/Tree/TreeEnsemble.ipynb b/doc/ipython-notebooks/multiclass/Tree/TreeEnsemble.ipynb index 5ee0e83915b..249e14b0ff1 100644 --- a/doc/ipython-notebooks/multiclass/Tree/TreeEnsemble.ipynb +++ b/doc/ipython-notebooks/multiclass/Tree/TreeEnsemble.ipynb @@ -66,7 +66,7 @@ "collapsed": false, "input": [ "import os\nSHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../../data')\n", - "from modshogun import CSVFile,RealFeatures,MulticlassLabels\n", + "from shogun import CSVFile,RealFeatures,MulticlassLabels\n", "\n", "def load_file(feat_file,label_file):\n", " feats=RealFeatures(CSVFile(feat_file))\n", @@ -92,7 +92,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import RandomForest, MajorityVote\n", + "from shogun import RandomForest, MajorityVote\n", "from numpy import array\n", "\n", "def setup_random_forest(num_trees,rand_subset_size,combination_rule,feature_types):\n", @@ -149,7 +149,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import CARTree, PT_MULTICLASS\n", + "from shogun import CARTree, PT_MULTICLASS\n", "\n", "def train_cart(train_feats,train_labels,feature_types,problem_type):\n", " c=CARTree(feature_types,problem_type,2,False)\n", @@ -180,7 +180,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import MulticlassAccuracy\n", + "from shogun import MulticlassAccuracy\n", "\n", "accuracy=MulticlassAccuracy()\n", "\n", diff --git a/doc/ipython-notebooks/multiclass/multiclass_reduction.ipynb b/doc/ipython-notebooks/multiclass/multiclass_reduction.ipynb index 3f36e306e7f..22e3c21d651 100644 --- a/doc/ipython-notebooks/multiclass/multiclass_reduction.ipynb +++ b/doc/ipython-notebooks/multiclass/multiclass_reduction.ipynb @@ -185,10 +185,10 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import RealFeatures, MulticlassLabels\n", - "from modshogun import LibLinear, L2R_L2LOSS_SVC, LinearMulticlassMachine\n", - "from modshogun import MulticlassOneVsOneStrategy, MulticlassOneVsRestStrategy\n", - "from modshogun import MulticlassAccuracy\n", + "from shogun import RealFeatures, MulticlassLabels\n", + "from shogun import LibLinear, L2R_L2LOSS_SVC, LinearMulticlassMachine\n", + "from shogun import MulticlassOneVsOneStrategy, MulticlassOneVsRestStrategy\n", + "from shogun import MulticlassAccuracy\n", "\n", "import time\n", "\n", @@ -273,7 +273,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import MulticlassLibLinear\n", + "from shogun import MulticlassLibLinear\n", "mcsvm = MulticlassLibLinear(5.0, feats_train, lab_train)\n", "mcsvm.set_use_bias(True)\n", "\n", @@ -449,7 +449,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import ECOCStrategy, ECOCRandomDenseEncoder, ECOCLLBDecoder\n", + "from shogun import ECOCStrategy, ECOCRandomDenseEncoder, ECOCLLBDecoder\n", "\n", "print \"\\nRandom Dense Encoder + Margin Loss based Decoder\"\n", "print \"=\"*60\n", @@ -482,7 +482,7 @@ "collapsed": false, "input": [ "def evaluate_multiclass_kernel(strategy):\n", - " from modshogun import KernelMulticlassMachine, LibSVM, GaussianKernel\n", + " from shogun import KernelMulticlassMachine, LibSVM, GaussianKernel\n", " width=2.1\n", " epsilon=1e-5\n", " \n", @@ -532,7 +532,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import *\n", + "from shogun import *\n", "from numpy import *\n", "\n", "num=1000;\n", @@ -624,7 +624,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import KernelMulticlassMachine, LibSVM, GaussianKernel\n", + "from shogun import KernelMulticlassMachine, LibSVM, GaussianKernel\n", "\n", "width=2.1\n", "epsilon=1e-5\n", diff --git a/doc/ipython-notebooks/multiclass/naive_bayes.ipynb b/doc/ipython-notebooks/multiclass/naive_bayes.ipynb index 9a833ef583f..661a4963ed1 100644 --- a/doc/ipython-notebooks/multiclass/naive_bayes.ipynb +++ b/doc/ipython-notebooks/multiclass/naive_bayes.ipynb @@ -140,9 +140,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import GaussianNaiveBayes\n", - "from modshogun import RealFeatures\n", - "from modshogun import MulticlassLabels\n", + "from shogun import GaussianNaiveBayes\n", + "from shogun import RealFeatures\n", + "from shogun import MulticlassLabels\n", "\n", "X_train, Y_train = gen_samples(n_train)\n", "\n", diff --git a/doc/ipython-notebooks/neuralnets/autoencoders.ipynb b/doc/ipython-notebooks/neuralnets/autoencoders.ipynb index 64949fdab5d..8444fc9e03e 100644 --- a/doc/ipython-notebooks/neuralnets/autoencoders.ipynb +++ b/doc/ipython-notebooks/neuralnets/autoencoders.ipynb @@ -55,7 +55,7 @@ "%matplotlib inline\n", "import os\nSHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')\n", "from scipy.io import loadmat\n", - "from modshogun import RealFeatures, MulticlassLabels, Math\n", + "from shogun import RealFeatures, MulticlassLabels, Math\n", "\n", "# load the dataset\n", "dataset = loadmat(os.path.join(SHOGUN_DATA_DIR, 'multiclass/usps.mat'))\n", @@ -101,7 +101,7 @@ }, "outputs": [], "source": [ - "from modshogun import NeuralLayers, DeepAutoencoder\n", + "from shogun import NeuralLayers, DeepAutoencoder\n", "\n", "layers = NeuralLayers()\n", "layers = layers.input(256).rectified_linear(512).rectified_linear(128).rectified_linear(512).linear(256).done()\n", @@ -137,7 +137,7 @@ }, "outputs": [], "source": [ - "from modshogun import AENT_DROPOUT, NNOM_GRADIENT_DESCENT\n", + "from shogun import AENT_DROPOUT, NNOM_GRADIENT_DESCENT\n", "\n", "ae.pt_noise_type.set_const(AENT_DROPOUT) # use dropout noise\n", "ae.pt_noise_parameter.set_const(0.5) # each input has a 50% chance of being set to zero\n", @@ -150,7 +150,7 @@ "ae.pt_epsilon.set_const(0.0) # disable automatic convergence testing\n", "\n", "# uncomment this line to allow the training progress to be printed on the console\n", - "#from modshogun import MSG_INFO; ae.io.set_loglevel(MSG_INFO)\n", + "#from shogun import MSG_INFO; ae.io.set_loglevel(MSG_INFO)\n", "\n", "# start pre-training. this might take some time\n", "ae.pre_train(Xtrain)" @@ -287,7 +287,7 @@ }, "outputs": [], "source": [ - "from modshogun import NeuralSoftmaxLayer\n", + "from shogun import NeuralSoftmaxLayer\n", "\n", "nn = ae.convert_to_neural_network(NeuralSoftmaxLayer(10))\n", "\n", @@ -312,7 +312,7 @@ }, "outputs": [], "source": [ - "from modshogun import MulticlassAccuracy\n", + "from shogun import MulticlassAccuracy\n", "\n", "predictions = nn.apply_multiclass(Xtest)\n", "accuracy = MulticlassAccuracy().evaluate(predictions, Ytest) * 100\n", @@ -344,7 +344,7 @@ }, "outputs": [], "source": [ - "from modshogun import DynamicObjectArray, NeuralInputLayer, NeuralConvolutionalLayer, CMAF_RECTIFIED_LINEAR\n", + "from shogun import DynamicObjectArray, NeuralInputLayer, NeuralConvolutionalLayer, CMAF_RECTIFIED_LINEAR\n", "\n", "conv_layers = DynamicObjectArray()\n", "# 16x16 single channel images\n", diff --git a/doc/ipython-notebooks/neuralnets/neuralnets_digits.ipynb b/doc/ipython-notebooks/neuralnets/neuralnets_digits.ipynb index 98c0bc14061..02e056b18cd 100644 --- a/doc/ipython-notebooks/neuralnets/neuralnets_digits.ipynb +++ b/doc/ipython-notebooks/neuralnets/neuralnets_digits.ipynb @@ -51,7 +51,7 @@ "%matplotlib inline\n", "import os\nSHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')\n", "from scipy.io import loadmat\n", - "from modshogun import RealFeatures, MulticlassLabels, Math\n", + "from shogun import RealFeatures, MulticlassLabels, Math\n", "\n", "# load the dataset\n", "dataset = loadmat(os.path.join(SHOGUN_DATA_DIR, 'multiclass/usps.mat'))\n", @@ -109,8 +109,8 @@ }, "outputs": [], "source": [ - "from modshogun import NeuralNetwork, NeuralInputLayer, NeuralLogisticLayer, NeuralSoftmaxLayer\n", - "from modshogun import DynamicObjectArray\n", + "from shogun import NeuralNetwork, NeuralInputLayer, NeuralLogisticLayer, NeuralSoftmaxLayer\n", + "from shogun import DynamicObjectArray\n", "\n", "# setup the layers\n", "layers = DynamicObjectArray()\n", @@ -215,7 +215,7 @@ }, "outputs": [], "source": [ - "from modshogun import MulticlassAccuracy\n", + "from shogun import MulticlassAccuracy\n", "\n", "def compute_accuracy(net, X, Y):\n", " predictions = net.apply_multiclass(X)\n", @@ -246,7 +246,7 @@ "net_no_reg.set_max_num_epochs(600)\n", "\n", "# uncomment this line to allow the training progress to be printed on the console\n", - "#from modshogun import MSG_INFO; net_no_reg.io.set_loglevel(MSG_INFO)\n", + "#from shogun import MSG_INFO; net_no_reg.io.set_loglevel(MSG_INFO)\n", "\n", "net_no_reg.set_labels(Ytrain)\n", "net_no_reg.train(Xtrain) # this might take a while, depending on your machine\n", @@ -336,7 +336,7 @@ }, "outputs": [], "source": [ - "from modshogun import NNOM_GRADIENT_DESCENT\n", + "from shogun import NNOM_GRADIENT_DESCENT\n", "\n", "# set the dropout probabilty for neurons in the hidden layers\n", "net_dropout.set_dropout_hidden(0.5)\n", @@ -391,7 +391,7 @@ }, "outputs": [], "source": [ - "from modshogun import NeuralConvolutionalLayer, CMAF_RECTIFIED_LINEAR\n", + "from shogun import NeuralConvolutionalLayer, CMAF_RECTIFIED_LINEAR\n", "\n", "# prepere the layers\n", "layers_conv = DynamicObjectArray()\n", diff --git a/doc/ipython-notebooks/neuralnets/rbms_dbns.ipynb b/doc/ipython-notebooks/neuralnets/rbms_dbns.ipynb index 3d2e8c16589..0e7a05fe47b 100644 --- a/doc/ipython-notebooks/neuralnets/rbms_dbns.ipynb +++ b/doc/ipython-notebooks/neuralnets/rbms_dbns.ipynb @@ -174,7 +174,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import RBM, RBMVUT_BINARY, Math\n", + "from shogun import RBM, RBMVUT_BINARY, Math\n", "\n", "# initialize the random number generator with a fixed seed, for repeatability\n", "Math.init_random(10)\n", @@ -223,10 +223,10 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import RealFeatures, RBMMM_PSEUDO_LIKELIHOOD\n", + "from shogun import RealFeatures, RBMMM_PSEUDO_LIKELIHOOD\n", "\n", "# uncomment this line to allow the training progress to be printed on the console\n", - "#from modshogun import MSG_INFO; rbms[0].io.set_loglevel(MSG_INFO)\n", + "#from shogun import MSG_INFO; rbms[0].io.set_loglevel(MSG_INFO)\n", "\n", "for i in range(10):\n", " # obtain the data for digit i\n", @@ -305,7 +305,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import DeepBeliefNetwork\n", + "from shogun import DeepBeliefNetwork\n", "\n", "dbn = DeepBeliefNetwork(256) # 256 visible units\n", "dbn.add_hidden_layer(200) # 200 units in the first hidden layer\n", @@ -386,7 +386,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import NeuralSoftmaxLayer, MulticlassLabels\n", + "from shogun import NeuralSoftmaxLayer, MulticlassLabels\n", "\n", "# get the neural network\n", "nn = dbn.convert_to_neural_network(NeuralSoftmaxLayer(10))\n", @@ -413,7 +413,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import MulticlassAccuracy\n", + "from shogun import MulticlassAccuracy\n", "\n", "predictions = nn.apply_multiclass(RealFeatures(Xtest))\n", "accuracy = MulticlassAccuracy().evaluate(predictions, MulticlassLabels(Ytest)) * 100\n", diff --git a/doc/ipython-notebooks/pca/pca_notebook.ipynb b/doc/ipython-notebooks/pca/pca_notebook.ipynb index 177e328dcae..8d29e3f66a5 100644 --- a/doc/ipython-notebooks/pca/pca_notebook.ipynb +++ b/doc/ipython-notebooks/pca/pca_notebook.ipynb @@ -33,7 +33,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 *" ] }, { diff --git a/doc/ipython-notebooks/regression/Regression.ipynb b/doc/ipython-notebooks/regression/Regression.ipynb index 8d69552897a..e7ebc689932 100644 --- a/doc/ipython-notebooks/regression/Regression.ipynb +++ b/doc/ipython-notebooks/regression/Regression.ipynb @@ -106,7 +106,7 @@ "import os\nSHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')\n", "from cycler import cycler\n", "# import all shogun classes\n", - "from modshogun import *\n", + "from shogun import *\n", "slope = 3\n", "\n", "X_train = rand(30)*10\n", diff --git a/doc/ipython-notebooks/statistical_testing/mmd_two_sample_testing.ipynb b/doc/ipython-notebooks/statistical_testing/mmd_two_sample_testing.ipynb index ebc165f1a19..2bedd3a02a9 100644 --- a/doc/ipython-notebooks/statistical_testing/mmd_two_sample_testing.ipynb +++ b/doc/ipython-notebooks/statistical_testing/mmd_two_sample_testing.ipynb @@ -41,7 +41,7 @@ "%pylab inline\n", "%matplotlib inline\n", "import os\nSHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')\n", - "import modshogun as sg\n", + "import shogun as sg\n", "import numpy as np" ] }, diff --git a/doc/ipython-notebooks/structure/Binary_Denoising.ipynb b/doc/ipython-notebooks/structure/Binary_Denoising.ipynb index 292b9245ba3..9b3d2039356 100644 --- a/doc/ipython-notebooks/structure/Binary_Denoising.ipynb +++ b/doc/ipython-notebooks/structure/Binary_Denoising.ipynb @@ -262,10 +262,10 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import Factor, TableFactorType, FactorGraph\n", - "from modshogun import FactorGraphObservation, FactorGraphLabels, FactorGraphFeatures\n", - "from modshogun import FactorGraphModel, GRAPH_CUT, LP_RELAXATION\n", - "from modshogun import MAPInference" + "from shogun import Factor, TableFactorType, FactorGraph\n", + "from shogun import FactorGraphObservation, FactorGraphLabels, FactorGraphFeatures\n", + "from shogun import FactorGraphModel, GRAPH_CUT, LP_RELAXATION\n", + "from shogun import MAPInference" ], "language": "python", "metadata": {}, @@ -518,7 +518,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import StochasticSOSVM\n", + "from shogun import StochasticSOSVM\n", "import time\n", "\n", "# Training with Stocastic Gradient Descent\n", diff --git a/doc/ipython-notebooks/structure/FGM.ipynb b/doc/ipython-notebooks/structure/FGM.ipynb index a89cae5d57f..8d724e7ba6e 100644 --- a/doc/ipython-notebooks/structure/FGM.ipynb +++ b/doc/ipython-notebooks/structure/FGM.ipynb @@ -248,7 +248,7 @@ }, "outputs": [], "source": [ - "from modshogun import TableFactorType\n", + "from shogun import TableFactorType\n", "\n", "# unary, type_id = 0\n", "cards_u = np.array([n_stats], np.int32)\n", @@ -294,8 +294,8 @@ "source": [ "def prepare_data(x, y, ftype, num_samples):\n", " \"\"\"prepare FactorGraphFeatures and FactorGraphLabels \"\"\"\n", - " from modshogun import Factor, TableFactorType, FactorGraph\n", - " from modshogun import FactorGraphObservation, FactorGraphLabels, FactorGraphFeatures\n", + " from shogun import Factor, TableFactorType, FactorGraph\n", + " from shogun import FactorGraphObservation, FactorGraphLabels, FactorGraphFeatures\n", "\n", " samples = FactorGraphFeatures(num_samples)\n", " labels = FactorGraphLabels(num_samples)\n", @@ -443,7 +443,7 @@ }, "outputs": [], "source": [ - "from modshogun import FactorGraphModel, TREE_MAX_PROD\n", + "from shogun import FactorGraphModel, TREE_MAX_PROD\n", "\n", "# create model and register factor types\n", "model = FactorGraphModel(samples, labels, TREE_MAX_PROD)\n", @@ -468,8 +468,8 @@ }, "outputs": [], "source": [ - "from modshogun import DualLibQPBMSOSVM\n", - "from modshogun import BmrmStatistics\n", + "from shogun import DualLibQPBMSOSVM\n", + "from shogun import BmrmStatistics\n", "import pickle\n", "import time\n", "\n", @@ -577,7 +577,7 @@ }, "outputs": [], "source": [ - "from modshogun import StochasticSOSVM\n", + "from shogun import StochasticSOSVM\n", "\n", "# the 3rd parameter is do_weighted_averaging, by turning this on, \n", "# a possibly faster convergence rate may be achieved.\n", @@ -760,7 +760,7 @@ }, "outputs": [], "source": [ - "from modshogun import FactorGraphFeatures, FactorGraphObservation, TREE_MAX_PROD, MAPInference\n", + "from shogun import FactorGraphFeatures, FactorGraphObservation, TREE_MAX_PROD, MAPInference\n", "\n", "# get a factor graph instance from test data\n", "fg0 = samples_ts.get_sample(100)\n", @@ -800,7 +800,7 @@ }, "outputs": [], "source": [ - "from modshogun import LabelsFactory, SOSVMHelper\n", + "from shogun import LabelsFactory, SOSVMHelper\n", "\n", "# training error of BMRM method\n", "bmrm.set_w(w_bmrm)\n", diff --git a/doc/ipython-notebooks/structure/multilabel_structured_prediction.ipynb b/doc/ipython-notebooks/structure/multilabel_structured_prediction.ipynb index 6e73a76082f..7eb42989a03 100644 --- a/doc/ipython-notebooks/structure/multilabel_structured_prediction.ipynb +++ b/doc/ipython-notebooks/structure/multilabel_structured_prediction.ipynb @@ -165,14 +165,14 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import RealFeatures, MultilabelSOLabels, MultilabelModel\n", + "from shogun import RealFeatures, MultilabelSOLabels, MultilabelModel\n", "\n", "def create_features(X, constant):\n", " features = RealFeatures(\n", " np.c_[X, constant * np.ones(X.shape[0])].T)\n", " \n", " return features\n", - "from modshogun import MultilabelSOLabels\n", + "from shogun import MultilabelSOLabels\n", "\n", "def create_labels(Y, n_classes):\n", " try:\n", @@ -236,7 +236,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import StochasticSOSVM, DualLibQPBMSOSVM, StructuredAccuracy, LabelsFactory\n", + "from shogun import StochasticSOSVM, DualLibQPBMSOSVM, StructuredAccuracy, LabelsFactory\n", "from time import time\n", "\n", "sgd = StochasticSOSVM(model, labels)\n", @@ -386,7 +386,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "from modshogun import SparseMultilabel_obtain_from_generic\n", + "from shogun import SparseMultilabel_obtain_from_generic\n", "\n", "def plot_decision_plane(machine,\n", " title,\n", diff --git a/doc/ipython-notebooks/template.ipynb b/doc/ipython-notebooks/template.ipynb index 678beeca981..8a3c7846fbe 100644 --- a/doc/ipython-notebooks/template.ipynb +++ b/doc/ipython-notebooks/template.ipynb @@ -108,4 +108,4 @@ "metadata": {} } ] -} \ No newline at end of file +} diff --git a/doc/readme/INTERFACES.md b/doc/readme/INTERFACES.md index b348a5b3217..b5e2aef34ca 100644 --- a/doc/readme/INTERFACES.md +++ b/doc/readme/INTERFACES.md @@ -39,53 +39,53 @@ Running it: ./native_example ### Python -This needs `modshogun.py` to be visible, which is either in `path/to/build/src/interfaces/python_modular/` or in something similar to `path/to/shogun-install/lib/python2.7/dist-packages/` +This needs `shogun.py` to be visible, which is either in `path/to/build/src/interfaces/python_modular/` or in something similar to `path/to/shogun-install/lib/python2.7/dist-packages/` - export PYTHONPATH="path/to/modshogun.py:$PYTHONPATH" + export PYTHONPATH="path/to/shogun.py:$PYTHONPATH" Running an example: python path/to/python_example.py ### Octave -This needs `modshogun.oct` to be visible, which is either in `path/to/build/src/interfaces/octave_modular/` or in something similar to `path/to/shogun-install/lib/x86_64-linux-gnu/octave/site/oct/api-v50+/x86_64-pc-linux-gnu/shogun/` +This needs `shogun.oct` to be visible, which is either in `path/to/build/src/interfaces/octave_modular/` or in something similar to `path/to/shogun-install/lib/x86_64-linux-gnu/octave/site/oct/api-v50+/x86_64-pc-linux-gnu/shogun/` - export OCTAVE_PATH="path/to/modshogun.oct:$OCTAVE_PATH" + export OCTAVE_PATH="path/to/shogun.oct:$OCTAVE_PATH" Running an example: python path/to/octave_example.py ### Ruby -This needs `modshogun.rb` to be visible, which is either in `path/to/build/src/interfaces/ruby_modular/` or in something similar to `path/to/shogun-install/lib/x86_64-linux-gnu/site_ruby` - export RUBYLIB="path/to/modshogun.rb:$RUBYLIB" +This needs `shogun.rb` to be visible, which is either in `path/to/build/src/interfaces/ruby_modular/` or in something similar to `path/to/shogun-install/lib/x86_64-linux-gnu/site_ruby` + export RUBYLIB="path/to/shogun.rb:$RUBYLIB" Running an example: ruby path/to/ruby_example.rb ### R -This needs `modshogun.R` to be visible, which is either in `path/to/build/src/interfaces/r_modular/` or in something similar to `path/to/shogun-install/lib/R/site-library` - export R_LIBS_USER="path/to/modshogun.R:$R_LIBS_USER" +This needs `shogun.R` to be visible, which is either in `path/to/build/src/interfaces/r_modular/` or in something similar to `path/to/shogun-install/lib/R/site-library` + export R_LIBS_USER="path/to/shogun.R:$R_LIBS_USER" Running an example: R --no-restore --no-save --no-readline --slave -f path/to/r_example.rb ### Lua -This needs `libmodshogun.so` (this is the interface file, not the shared library file `libshogun.so`) to be visible, which is either in `path/to/build/src/interfaces/lua_modular/` or in something similar to `path/to/shogun-install/lib/lua/5.1/` +This needs `libshogun.so` (this is the interface file, not the shared library file `libshogun.so`) to be visible, which is either in `path/to/build/src/interfaces/lua_modular/` or in something similar to `path/to/shogun-install/lib/lua/5.1/` - export LUA_CPATH="path/to/libmodshogun.so:$LUA_CPATH" + export LUA_CPATH="path/to/libshogun.so:$LUA_CPATH" Running an example: R --no-restore --no-save --no-readline --slave -f path/to/r_example.R ### CSharp -This needs `modshogun.dll` to be visible, which is either in `path/to/build/src/interfaces/csharp_modular` or in something similar to `path/to/shogun-install/lib/cli/shogun/` +This needs `shogun.dll` to be visible, which is either in `path/to/build/src/interfaces/csharp_modular` or in something similar to `path/to/shogun-install/lib/cli/shogun/` Compiling code works with the mono C# compiler and passing location of the above file - mcs path/to/csharp_example.cs /lib:path/to/modshogun.dll/r:modshogun -out:csharp_example.exe + mcs path/to/csharp_example.cs /lib:path/to/shogun.dll/r:shogun -out:csharp_example.exe Running requires setting the mono path @@ -103,7 +103,7 @@ usually in `/usr/share/java/`. Compiling code works with the java compiler and passing location of `shogun.jar`, `jblas.jar`, and the example itself in the class path - javac -cp /path/to/jblas.jar:/path/to/modshogun.jar:path/to/java_example.java -d /path/to/output/ /path/to/java_example.java + javac -cp /path/to/jblas.jar:/path/to/shogun.jar:path/to/java_example.java -d /path/to/output/ /path/to/java_example.java Running it again requires the above class path and some more options diff --git a/examples/meta/csharp/CMakeLists.txt b/examples/meta/csharp/CMakeLists.txt index d38f9b4136e..7e0d86bfc81 100644 --- a/examples/meta/csharp/CMakeLists.txt +++ b/examples/meta/csharp/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(CSHARP_FLAGS "/lib:${INTERFACE_CSHARP_BUILD_DIR};/r:modshogun") +SET(CSHARP_FLAGS "/lib:${INTERFACE_CSHARP_BUILD_DIR};/r:shogun") # add test case for each generated example # (not generated yet so have to fake filenames from META_EXAMPLES list) diff --git a/examples/meta/generator/targets/csharp.json b/examples/meta/generator/targets/csharp.json index 50d40a6baf0..e227101a66f 100644 --- a/examples/meta/generator/targets/csharp.json +++ b/examples/meta/generator/targets/csharp.json @@ -1,5 +1,5 @@ { - "Program": "using System;\n\npublic class classifier_knn_modular {\npublic static void Main() {\nmodshogun.init_shogun_with_defaults();\n\n$program\n}\n}\n", + "Program": "using System;\n\npublic class Application {\npublic static void Main() {\nshogun.init_shogun_with_defaults();\n\n$program\n}\n}\n", "Statement": "$statement;\n", "Comment": "//$comment\n", "Init": { diff --git a/examples/meta/generator/targets/java.json b/examples/meta/generator/targets/java.json index 59ec7da993c..f3e08a1b84d 100644 --- a/examples/meta/generator/targets/java.json +++ b/examples/meta/generator/targets/java.json @@ -1,5 +1,5 @@ { - "Program": "import org.jblas.DoubleMatrix;\nimport org.jblas.FloatMatrix;\n\nimport org.shogun.modshogun;\n$dependencies\n\npublic class $programName {\nstatic {\nSystem.loadLibrary(\"modshogun\");\n}\n\npublic static void main(String argv[]) {\nmodshogun.init_shogun_with_defaults();\n\n$program\n}\n}\n", + "Program": "import org.jblas.DoubleMatrix;\nimport org.jblas.FloatMatrix;\n\nimport org.shogun.shogun;\n$dependencies\n\npublic class $programName {\nstatic {\nSystem.loadLibrary(\"shogun\");\n}\n\npublic static void main(String argv[]) {\nshogun.init_shogun_with_defaults();\n\n$program\n}\n}\n", "Dependencies": { "IncludeAllClasses": true, "IncludeEnums": true, diff --git a/examples/meta/generator/targets/lua.json b/examples/meta/generator/targets/lua.json index a5a5171f525..0f125668727 100644 --- a/examples/meta/generator/targets/lua.json +++ b/examples/meta/generator/targets/lua.json @@ -1,9 +1,9 @@ { - "Program": "require 'modshogun'\n\n$program", + "Program": "require 'shogun'\n\n$program", "Statement": "$statement\n", "Comment": "--$comment\n", "Init": { - "Construct": "$name = modshogun.$typeName($arguments)", + "Construct": "$name = shogun.$typeName($arguments)", "Copy": "$name = $expr" }, "Assign": "$identifier = $expr", @@ -23,7 +23,7 @@ "MethodCall": "$object:$method($arguments)", "StaticCall": "$typeName:$method($arguments)", "Identifier": "$identifier", - "Enum":"modshogun.$value" + "Enum":"shogun.$value" }, "Element": { "Access": { diff --git a/examples/meta/generator/targets/octave.json b/examples/meta/generator/targets/octave.json index 010aa47f040..ddcc0054e99 100644 --- a/examples/meta/generator/targets/octave.json +++ b/examples/meta/generator/targets/octave.json @@ -1,5 +1,5 @@ { - "Program": "modshogun\n\n$program", + "Program": "shogun\n\n$program", "Statement": "$statement;\n", "Comment": "%$comment\n", "Init": { diff --git a/examples/meta/generator/targets/python.json b/examples/meta/generator/targets/python.json index b83e113b50b..cc618cbfb37 100644 --- a/examples/meta/generator/targets/python.json +++ b/examples/meta/generator/targets/python.json @@ -4,8 +4,8 @@ "IncludeAllClasses": false, "IncludeInterfacedClasses": true, "IncludeEnums": true, - "DependencyListElement": "from modshogun import $typeName", - "DependencyListElementEnum": "from modshogun import $value", + "DependencyListElement": "from shogun import $typeName", + "DependencyListElementEnum": "from shogun import $value", "DependencyListSeparator": "\n" }, "Statement": "$statement\n", diff --git a/examples/meta/generator/targets/ruby.json b/examples/meta/generator/targets/ruby.json index d6dd8c9441a..c3f06660cf0 100644 --- a/examples/meta/generator/targets/ruby.json +++ b/examples/meta/generator/targets/ruby.json @@ -1,9 +1,9 @@ { - "Program": "require 'modshogun'\n\n$dependencies$program", + "Program": "require 'shogun'\n\n$dependencies$program", "Statement": "$statement\n", "Comment": "#$comment\n", "Init": { - "Construct": "$name = Modshogun::$typeName.new $arguments", + "Construct": "$name = Shogun::$typeName.new $arguments", "Copy": "$name = $expr", "CharVector": "$name = NArray.byte($arguments)", "ByteVector": "$name = NArray.byte($arguments)", @@ -41,9 +41,9 @@ "RealLiteral": "$number", "FloatLiteral": "$number", "MethodCall": "$object.$method $arguments", - "StaticCall": "Modshogun::$typeName.$method $arguments", + "StaticCall": "Shogun::$typeName.$method $arguments", "Identifier": "$identifier", - "Enum":"Modshogun::$value" + "Enum":"Shogun::$value" }, "Element": { "Access": { diff --git a/examples/meta/generator/translate.py b/examples/meta/generator/translate.py index 25477a85241..2637f7e5519 100644 --- a/examples/meta/generator/translate.py +++ b/examples/meta/generator/translate.py @@ -241,7 +241,7 @@ def injectVarsStoring(self, statementList, programName, varsToStore): def dependenciesString(self, allClasses, interfacedClasses, enums): """ Returns dependency import string - e.g. for python: "from modshogun import RealFeatures\n\n" + e.g. for python: "from shogun import RealFeatures\n\n" """ if "Dependencies" not in self.targetDict: diff --git a/examples/meta/lua/CMakeLists.txt b/examples/meta/lua/CMakeLists.txt index 4cd9bc27bc5..fa79808184f 100644 --- a/examples/meta/lua/CMakeLists.txt +++ b/examples/meta/lua/CMakeLists.txt @@ -8,5 +8,5 @@ FOREACH(META_EXAMPLE ${META_EXAMPLES}) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/{EXAMPLE_REL_DIR} COMMAND ${LUA_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE_REL_DIR}/${EXAMPLE_NAME}.lua) set_property(TEST generated_lua-${EXAMPLE_NAME_WITH_DIR} PROPERTY - ENVIRONMENT "LUA_CPATH=${INTERFACE_LUA_BUILD_DIR}/libmodshogun.so") + ENVIRONMENT "LUA_CPATH=${INTERFACE_LUA_BUILD_DIR}/libshogun.so") ENDFOREACH() diff --git a/examples/undocumented/python/classifier_custom_kernel.py b/examples/undocumented/python/classifier_custom_kernel.py index 3edab6e2194..89e3ffef759 100644 --- a/examples/undocumented/python/classifier_custom_kernel.py +++ b/examples/undocumented/python/classifier_custom_kernel.py @@ -2,7 +2,7 @@ parameter_list = [[1,7],[2,8]] def classifier_custom_kernel (C=1,dim=7): - from modshogun import RealFeatures, BinaryLabels, CustomKernel, LibSVM + from shogun import RealFeatures, BinaryLabels, CustomKernel, LibSVM from numpy import diag,ones,sign from numpy.random import rand,seed diff --git a/examples/undocumented/python/classifier_domainadaptationsvm.py b/examples/undocumented/python/classifier_domainadaptationsvm.py index 4c4baed4df6..a92f7f98f98 100644 --- a/examples/undocumented/python/classifier_domainadaptationsvm.py +++ b/examples/undocumented/python/classifier_domainadaptationsvm.py @@ -1,17 +1,17 @@ #!/usr/bin/env python import numpy -from modshogun import StringCharFeatures, BinaryLabels, DNA -from modshogun import WeightedDegreeStringKernel -from modshogun import MSG_DEBUG +from shogun import StringCharFeatures, BinaryLabels, DNA +from shogun import WeightedDegreeStringKernel +from shogun import MSG_DEBUG try: - from modshogun import DomainAdaptationSVM + from shogun import DomainAdaptationSVM except ImportError: print("DomainAdaptationSVM not available") exit(0) try: - from modshogun import SVMLight + from shogun import SVMLight except ImportError: print("SVMLight not available") exit(0) diff --git a/examples/undocumented/python/classifier_featureblock_logistic_regression.py b/examples/undocumented/python/classifier_featureblock_logistic_regression.py index 2f52c02b1f0..1e4da7837fa 100644 --- a/examples/undocumented/python/classifier_featureblock_logistic_regression.py +++ b/examples/undocumented/python/classifier_featureblock_logistic_regression.py @@ -12,9 +12,9 @@ def classifier_featureblock_logistic_regression (fm_train=traindat,fm_test=testdat,label_train=label_traindat): - from modshogun import BinaryLabels, RealFeatures, IndexBlock, IndexBlockGroup + from shogun import BinaryLabels, RealFeatures, IndexBlock, IndexBlockGroup try: - from modshogun import FeatureBlockLogisticRegression + from shogun import FeatureBlockLogisticRegression except ImportError: print("FeatureBlockLogisticRegression not available") exit(0) diff --git a/examples/undocumented/python/classifier_gmnpsvm.py b/examples/undocumented/python/classifier_gmnpsvm.py index 2fc34b8c658..a3a1afb3f07 100644 --- a/examples/undocumented/python/classifier_gmnpsvm.py +++ b/examples/undocumented/python/classifier_gmnpsvm.py @@ -6,8 +6,8 @@ parameter_list = [[traindat,testdat,label_traindat,2.1,1,1e-5],[traindat,testdat,label_traindat,2.2,1,1e-5]] def classifier_gmnpsvm (train_fname=traindat,test_fname=testdat,label_fname=label_traindat,width=2.1,C=1,epsilon=1e-5): - from modshogun import RealFeatures, MulticlassLabels - from modshogun import GaussianKernel, GMNPSVM, CSVFile + from shogun import RealFeatures, MulticlassLabels + from shogun import GaussianKernel, GMNPSVM, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/classifier_gpbtsvm.py b/examples/undocumented/python/classifier_gpbtsvm.py index 814798c16f6..f74d7ed26b0 100644 --- a/examples/undocumented/python/classifier_gpbtsvm.py +++ b/examples/undocumented/python/classifier_gpbtsvm.py @@ -6,11 +6,11 @@ parameter_list = [[traindat,testdat,label_traindat,2.1,1,1e-5],[traindat,testdat,label_traindat,2.2,1,1e-5]] def classifier_gpbtsvm (train_fname=traindat,test_fname=testdat,label_fname=label_traindat,width=2.1,C=1,epsilon=1e-5): - from modshogun import RealFeatures, BinaryLabels - from modshogun import GaussianKernel - from modshogun import CSVFile + from shogun import RealFeatures, BinaryLabels + from shogun import GaussianKernel + from shogun import CSVFile try: - from modshogun import GPBTSVM + from shogun import GPBTSVM except ImportError: print("GPBTSVM not available") exit(0) diff --git a/examples/undocumented/python/classifier_larank.py b/examples/undocumented/python/classifier_larank.py index cd3b1784089..a6a152d0f35 100644 --- a/examples/undocumented/python/classifier_larank.py +++ b/examples/undocumented/python/classifier_larank.py @@ -3,10 +3,10 @@ parameter_list = [[10,3,15,0.9,1,2000,1],[20,4,15,0.9,1,5000,2]] def classifier_larank (num_vec,num_class,distance,C=0.9,num_threads=1,num_iter=5,seed=1): - from modshogun import RealFeatures, MulticlassLabels - from modshogun import GaussianKernel - from modshogun import LaRank - from modshogun import Math_init_random + from shogun import RealFeatures, MulticlassLabels + from shogun import GaussianKernel + from shogun import LaRank + from shogun import Math_init_random # reproducible results Math_init_random(seed) diff --git a/examples/undocumented/python/classifier_lda.py b/examples/undocumented/python/classifier_lda.py index c6e3e1ee214..917c1a8b2a7 100644 --- a/examples/undocumented/python/classifier_lda.py +++ b/examples/undocumented/python/classifier_lda.py @@ -6,7 +6,7 @@ parameter_list = [[traindat,testdat,label_traindat,3,1],[traindat,testdat,label_traindat,4,1]] def classifier_lda (train_fname=traindat,test_fname=testdat,label_fname=label_traindat,gamma=3,num_threads=1): - from modshogun import RealFeatures, BinaryLabels, LDA, CSVFile + from shogun import RealFeatures, BinaryLabels, LDA, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/classifier_libsvmoneclass.py b/examples/undocumented/python/classifier_libsvmoneclass.py index b3e20133bbd..43126195910 100644 --- a/examples/undocumented/python/classifier_libsvmoneclass.py +++ b/examples/undocumented/python/classifier_libsvmoneclass.py @@ -5,7 +5,7 @@ parameter_list = [[traindat,testdat,2.2,1,1e-7],[traindat,testdat,2.1,1,1e-5]] def classifier_libsvmoneclass (train_fname=traindat,test_fname=testdat,width=2.1,C=1,epsilon=1e-5): - from modshogun import RealFeatures, GaussianKernel, LibSVMOneClass, CSVFile + from shogun import RealFeatures, GaussianKernel, LibSVMOneClass, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/classifier_mpdsvm.py b/examples/undocumented/python/classifier_mpdsvm.py index 1ad5251fbda..eb05a6ea52b 100644 --- a/examples/undocumented/python/classifier_mpdsvm.py +++ b/examples/undocumented/python/classifier_mpdsvm.py @@ -7,9 +7,9 @@ def classifier_mpdsvm (train_fname=traindat,test_fname=testdat,label_fname=label_traindat,C=1,epsilon=1e-5): - from modshogun import RealFeatures, BinaryLabels - from modshogun import GaussianKernel - from modshogun import MPDSVM, CSVFile + from shogun import RealFeatures, BinaryLabels + from shogun import GaussianKernel + from shogun import MPDSVM, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/classifier_multiclass_ecoc.py b/examples/undocumented/python/classifier_multiclass_ecoc.py index b80b4a9c557..4c6311c3b1e 100644 --- a/examples/undocumented/python/classifier_multiclass_ecoc.py +++ b/examples/undocumented/python/classifier_multiclass_ecoc.py @@ -12,21 +12,21 @@ def classifier_multiclass_ecoc (fm_train_real=traindat,fm_test_real=testdat,label_train_multiclass=label_traindat,label_test_multiclass=label_testdat,lawidth=2.1,C=1,epsilon=1e-5): - import modshogun - from modshogun import ECOCStrategy, LibLinear, L2R_L2LOSS_SVC, LinearMulticlassMachine - from modshogun import MulticlassAccuracy - from modshogun import RealFeatures, MulticlassLabels + import shogun + from shogun import ECOCStrategy, LibLinear, L2R_L2LOSS_SVC, LinearMulticlassMachine + from shogun import MulticlassAccuracy + from shogun import RealFeatures, MulticlassLabels def nonabstract_class(name): try: - getattr(modshogun, name)() + getattr(shogun, name)() except TypeError: return False return True - encoders = [x for x in dir(modshogun) + encoders = [x for x in dir(shogun) if re.match(r'ECOC.+Encoder', x) and nonabstract_class(x)] - decoders = [x for x in dir(modshogun) + decoders = [x for x in dir(shogun) if re.match(r'ECOC.+Decoder', x) and nonabstract_class(x)] fea_train = RealFeatures(fm_train_real) @@ -46,8 +46,8 @@ def nonabstract_class(name): #print((format_str % ('s', 's', 's')) % ('encoder', 'decoder', 'codelen', 'time', 'accuracy')) def run_ecoc(ier, idr): - encoder = getattr(modshogun, encoders[ier])() - decoder = getattr(modshogun, decoders[idr])() + encoder = getattr(shogun, encoders[ier])() + decoder = getattr(shogun, decoders[idr])() # whether encoder is data dependent if hasattr(encoder, 'set_labels'): diff --git a/examples/undocumented/python/classifier_multiclassliblinear.py b/examples/undocumented/python/classifier_multiclassliblinear.py index a0e63d96b59..cd6be65156e 100644 --- a/examples/undocumented/python/classifier_multiclassliblinear.py +++ b/examples/undocumented/python/classifier_multiclassliblinear.py @@ -6,8 +6,8 @@ parameter_list = [[traindat,testdat,label_traindat,label_testdat,2.1,1,1e-5],[traindat,testdat,label_traindat,label_testdat,2.2,1,1e-5]] def classifier_multiclassliblinear (fm_train_real=traindat,fm_test_real=testdat,label_train_multiclass=label_traindat,label_test_multiclass=label_testdat,width=2.1,C=1,epsilon=1e-5): - from modshogun import RealFeatures, MulticlassLabels - from modshogun import MulticlassLibLinear + from shogun import RealFeatures, MulticlassLabels + from shogun import MulticlassLibLinear feats_train=RealFeatures(fm_train_real) feats_test=RealFeatures(fm_test_real) @@ -21,7 +21,7 @@ def classifier_multiclassliblinear (fm_train_real=traindat,fm_test_real=testdat, out = label_pred.get_labels() if label_test_multiclass is not None: - from modshogun import MulticlassAccuracy + from shogun import MulticlassAccuracy labels_test = MulticlassLabels(label_test_multiclass) evaluator = MulticlassAccuracy() acc = evaluator.evaluate(label_pred, labels_test) diff --git a/examples/undocumented/python/classifier_multiclassmachine.py b/examples/undocumented/python/classifier_multiclassmachine.py index 9ffddb838be..1f670b084f6 100644 --- a/examples/undocumented/python/classifier_multiclassmachine.py +++ b/examples/undocumented/python/classifier_multiclassmachine.py @@ -6,9 +6,9 @@ parameter_list = [[traindat,testdat,label_traindat,2.1,1,1e-5],[traindat,testdat,label_traindat,2.2,1,1e-5]] def classifier_multiclassmachine (fm_train_real=traindat,fm_test_real=testdat,label_train_multiclass=label_traindat,width=2.1,C=1,epsilon=1e-5): - from modshogun import RealFeatures, MulticlassLabels - from modshogun import GaussianKernel - from modshogun import LibSVM, KernelMulticlassMachine, MulticlassOneVsRestStrategy + from shogun import RealFeatures, MulticlassLabels + from shogun import GaussianKernel + from shogun import LibSVM, KernelMulticlassMachine, MulticlassOneVsRestStrategy feats_train=RealFeatures(fm_train_real) feats_test=RealFeatures(fm_test_real) diff --git a/examples/undocumented/python/classifier_multiclassocas.py b/examples/undocumented/python/classifier_multiclassocas.py index f423b79004e..f4984854f0d 100644 --- a/examples/undocumented/python/classifier_multiclassocas.py +++ b/examples/undocumented/python/classifier_multiclassocas.py @@ -3,10 +3,10 @@ parameter_list = [[10,3,15,2.1,1,1e-5,1],[20,4,15,2.2,2,1e-5,2]] def classifier_multiclassocas (num_vec=10,num_class=3,distance=15,width=2.1,C=1,epsilon=1e-5,seed=1): - from modshogun import RealFeatures, MulticlassLabels - from modshogun import Math_init_random + from shogun import RealFeatures, MulticlassLabels + from shogun import Math_init_random try: - from modshogun import MulticlassOCAS + from shogun import MulticlassOCAS except ImportError: print("MulticlassOCAS not available") return diff --git a/examples/undocumented/python/classifier_multilabeloutputliblinear.py b/examples/undocumented/python/classifier_multilabeloutputliblinear.py index 3c191cd2369..57099cf9ec2 100644 --- a/examples/undocumented/python/classifier_multilabeloutputliblinear.py +++ b/examples/undocumented/python/classifier_multilabeloutputliblinear.py @@ -6,8 +6,8 @@ parameter_list = [[traindat,testdat,label_traindat,label_testdat,2.1,1,1e-5],[traindat,testdat,label_traindat,label_testdat,2.2,1,1e-5]] def classifier_multilabeloutputliblinear (fm_train_real=traindat,fm_test_real=testdat,label_train_multiclass=label_traindat,label_test_multiclass=label_testdat,width=2.1,C=1,epsilon=1e-5): - from modshogun import RealFeatures, MulticlassLabels, MultilabelLabels - from modshogun import MulticlassLibLinear + from shogun import RealFeatures, MulticlassLabels, MultilabelLabels + from shogun import MulticlassLibLinear feats_train=RealFeatures(fm_train_real) feats_test=RealFeatures(fm_test_real) diff --git a/examples/undocumented/python/classifier_perceptron.py b/examples/undocumented/python/classifier_perceptron.py index a31ec7869a5..7d6743f40a5 100644 --- a/examples/undocumented/python/classifier_perceptron.py +++ b/examples/undocumented/python/classifier_perceptron.py @@ -5,8 +5,8 @@ parameter_list = [[100, 2, 5,1.,1000,1,1], [100, 2, 5,1.,1000,1,2]] def classifier_perceptron (n=100, dim=2, distance=5,learn_rate=1.,max_iter=1000,num_threads=1,seed=1): - from modshogun import RealFeatures, BinaryLabels - from modshogun import Perceptron + from shogun import RealFeatures, BinaryLabels + from shogun import Perceptron random.seed(seed) diff --git a/examples/undocumented/python/classifier_ssk.py b/examples/undocumented/python/classifier_ssk.py index 0f87a342744..ccb983a62b7 100644 --- a/examples/undocumented/python/classifier_ssk.py +++ b/examples/undocumented/python/classifier_ssk.py @@ -20,9 +20,9 @@ def classifier_ssk (fm_train_dna=traindat,fm_test_dna=testdat, label_train_dna=label_traindat,C=1,maxlen=1,decay=1): - from modshogun import StringCharFeatures, BinaryLabels - from modshogun import LibSVM, SubsequenceStringKernel, DNA - from modshogun import ErrorRateMeasure + from shogun import StringCharFeatures, BinaryLabels + from shogun import LibSVM, SubsequenceStringKernel, DNA + from shogun import ErrorRateMeasure feats_train=StringCharFeatures(fm_train_dna, DNA) feats_test=StringCharFeatures(fm_test_dna, DNA) diff --git a/examples/undocumented/python/classifier_svmlight.py b/examples/undocumented/python/classifier_svmlight.py index 273a0b75009..156c7be45e4 100644 --- a/examples/undocumented/python/classifier_svmlight.py +++ b/examples/undocumented/python/classifier_svmlight.py @@ -9,10 +9,10 @@ parameter_list = [[traindat,testdat,label_traindat,1.1,1e-5,1],[traindat,testdat,label_traindat,1.2,1e-5,1]] def classifier_svmlight (fm_train_dna=traindat,fm_test_dna=testdat,label_train_dna=label_traindat,C=1.2,epsilon=1e-5,num_threads=1): - from modshogun import StringCharFeatures, BinaryLabels, DNA - from modshogun import WeightedDegreeStringKernel + from shogun import StringCharFeatures, BinaryLabels, DNA + from shogun import WeightedDegreeStringKernel try: - from modshogun import SVMLight + from shogun import SVMLight except ImportError: print('No support for SVMLight available.') return diff --git a/examples/undocumented/python/classifier_svmlight_batch_linadd.py b/examples/undocumented/python/classifier_svmlight_batch_linadd.py index 6181c498be3..abe957423aa 100644 --- a/examples/undocumented/python/classifier_svmlight_batch_linadd.py +++ b/examples/undocumented/python/classifier_svmlight_batch_linadd.py @@ -12,10 +12,10 @@ def classifier_svmlight_batch_linadd (fm_train_dna, fm_test_dna, label_train_dna, degree, C, epsilon, num_threads): - from modshogun import StringCharFeatures, BinaryLabels, DNA - from modshogun import WeightedDegreeStringKernel, MSG_DEBUG + from shogun import StringCharFeatures, BinaryLabels, DNA + from shogun import WeightedDegreeStringKernel, MSG_DEBUG try: - from modshogun import SVMLight + from shogun import SVMLight except ImportError: print('No support for SVMLight available.') return diff --git a/examples/undocumented/python/classifier_svmlight_linear_term.py b/examples/undocumented/python/classifier_svmlight_linear_term.py index 20e9949dce7..fa319153f74 100644 --- a/examples/undocumented/python/classifier_svmlight_linear_term.py +++ b/examples/undocumented/python/classifier_svmlight_linear_term.py @@ -30,10 +30,10 @@ def classifier_svmlight_linear_term (fm_train_dna=traindna,fm_test_dna=testdna, label_train_dna=label_traindna,degree=3, \ C=10,epsilon=1e-5,num_threads=1): - from modshogun import StringCharFeatures, BinaryLabels, DNA - from modshogun import WeightedDegreeStringKernel + from shogun import StringCharFeatures, BinaryLabels, DNA + from shogun import WeightedDegreeStringKernel try: - from modshogun import SVMLight + from shogun import SVMLight except ImportError: print("SVMLight is not available") exit(0) diff --git a/examples/undocumented/python/classifier_svmlin.py b/examples/undocumented/python/classifier_svmlin.py index 3526fc87fd7..c35990fe6bf 100644 --- a/examples/undocumented/python/classifier_svmlin.py +++ b/examples/undocumented/python/classifier_svmlin.py @@ -6,8 +6,8 @@ parameter_list = [[traindat,testdat,label_traindat,0.9,1e-5,1],[traindat,testdat,label_traindat,0.8,1e-5,1]] def classifier_svmlin (train_fname=traindat,test_fname=testdat,label_fname=label_traindat,C=0.9,epsilon=1e-5,num_threads=1): - from modshogun import RealFeatures, SparseRealFeatures, BinaryLabels - from modshogun import SVMLin, CSVFile + from shogun import RealFeatures, SparseRealFeatures, BinaryLabels + from shogun import SVMLin, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/classifier_svmocas.py b/examples/undocumented/python/classifier_svmocas.py index 0ebd7848125..69d9328d8fd 100644 --- a/examples/undocumented/python/classifier_svmocas.py +++ b/examples/undocumented/python/classifier_svmocas.py @@ -6,10 +6,10 @@ parameter_list = [[traindat,testdat,label_traindat,0.9,1e-5,1],[traindat,testdat,label_traindat,0.8,1e-5,1]] def classifier_svmocas (train_fname=traindat,test_fname=testdat,label_fname=label_traindat,C=0.9,epsilon=1e-5,num_threads=1): - from modshogun import RealFeatures, BinaryLabels - from modshogun import CSVFile + from shogun import RealFeatures, BinaryLabels + from shogun import CSVFile try: - from modshogun import SVMOcas + from shogun import SVMOcas except ImportError: print("SVMOcas not available") return diff --git a/examples/undocumented/python/classifier_svmsgd.py b/examples/undocumented/python/classifier_svmsgd.py index 0996ab322b7..de289376aff 100644 --- a/examples/undocumented/python/classifier_svmsgd.py +++ b/examples/undocumented/python/classifier_svmsgd.py @@ -6,8 +6,8 @@ parameter_list = [[traindat,testdat,label_traindat,0.9,1,6],[traindat,testdat,label_traindat,0.8,1,5]] def classifier_svmsgd (train_fname=traindat,test_fname=testdat,label_fname=label_traindat,C=0.9,num_threads=1,num_iter=5): - from modshogun import RealFeatures, SparseRealFeatures, BinaryLabels - from modshogun import SVMSGD, CSVFile + from shogun import RealFeatures, SparseRealFeatures, BinaryLabels + from shogun import SVMSGD, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/converter_diffusionmaps.py b/examples/undocumented/python/converter_diffusionmaps.py index c66ddb8f44b..ce134aae07f 100644 --- a/examples/undocumented/python/converter_diffusionmaps.py +++ b/examples/undocumented/python/converter_diffusionmaps.py @@ -4,7 +4,7 @@ def converter_diffusionmaps (data_fname,t): try: - from modshogun import RealFeatures, DiffusionMaps, GaussianKernel, CSVFile + from shogun import RealFeatures, DiffusionMaps, GaussianKernel, CSVFile features = RealFeatures(CSVFile(data_fname)) diff --git a/examples/undocumented/python/converter_factoranalysis.py b/examples/undocumented/python/converter_factoranalysis.py index 37c8182b3d1..775a8aa09a1 100644 --- a/examples/undocumented/python/converter_factoranalysis.py +++ b/examples/undocumented/python/converter_factoranalysis.py @@ -5,7 +5,7 @@ def converter_factoranalysis(data_fname): try: import numpy - from modshogun import RealFeatures, FactorAnalysis, EuclideanDistance, CSVFile + from shogun import RealFeatures, FactorAnalysis, EuclideanDistance, CSVFile features = RealFeatures(CSVFile(data_fname)) diff --git a/examples/undocumented/python/converter_hasheddoc.py b/examples/undocumented/python/converter_hasheddoc.py index d9f7e76d802..99299a3a964 100644 --- a/examples/undocumented/python/converter_hasheddoc.py +++ b/examples/undocumented/python/converter_hasheddoc.py @@ -5,9 +5,9 @@ parameter_list=[[strings]] def converter_hasheddoc(strings): - from modshogun import SparseRealFeatures, RAWBYTE, StringCharFeatures, Features, HashedDocDotFeatures - from modshogun import NGramTokenizer - from modshogun import HashedDocConverter + from shogun import SparseRealFeatures, RAWBYTE, StringCharFeatures, Features, HashedDocDotFeatures + from shogun import NGramTokenizer + from shogun import HashedDocConverter from numpy import array #create string features diff --git a/examples/undocumented/python/converter_hessianlocallylinearembedding.py b/examples/undocumented/python/converter_hessianlocallylinearembedding.py index ff124d83c37..61c07f43926 100644 --- a/examples/undocumented/python/converter_hessianlocallylinearembedding.py +++ b/examples/undocumented/python/converter_hessianlocallylinearembedding.py @@ -4,9 +4,9 @@ def converter_hessianlocallylinearembedding (data_fname,k): try: - from modshogun import RealFeatures, CSVFile + from shogun import RealFeatures, CSVFile try: - from modshogun import HessianLocallyLinearEmbedding + from shogun import HessianLocallyLinearEmbedding except ImportError: print("HessianLocallyLinearEmbedding not available") exit(0) diff --git a/examples/undocumented/python/converter_isomap.py b/examples/undocumented/python/converter_isomap.py index 17ff5993ac3..fb41999abd9 100644 --- a/examples/undocumented/python/converter_isomap.py +++ b/examples/undocumented/python/converter_isomap.py @@ -3,8 +3,8 @@ parameter_list = [[data]] def converter_isomap (data_fname): - from modshogun import RealFeatures, CSVFile - from modshogun import Isomap + from shogun import RealFeatures, CSVFile + from shogun import Isomap features = RealFeatures(CSVFile(data)) diff --git a/examples/undocumented/python/converter_kernellocallylinearembedding.py b/examples/undocumented/python/converter_kernellocallylinearembedding.py index c81d2918e2b..b8cf370b7a8 100644 --- a/examples/undocumented/python/converter_kernellocallylinearembedding.py +++ b/examples/undocumented/python/converter_kernellocallylinearembedding.py @@ -4,9 +4,9 @@ def converter_kernellocallylinearembedding (data_fname,k): try: - from modshogun import RealFeatures, LinearKernel, CSVFile + from shogun import RealFeatures, LinearKernel, CSVFile try: - from modshogun import KernelLocallyLinearEmbedding + from shogun import KernelLocallyLinearEmbedding except ImportError: print("KernelLocallyLinearEmbedding not available") exit(0) diff --git a/examples/undocumented/python/converter_laplacianeigenmaps.py b/examples/undocumented/python/converter_laplacianeigenmaps.py index 8016315f51c..810ded4cb55 100644 --- a/examples/undocumented/python/converter_laplacianeigenmaps.py +++ b/examples/undocumented/python/converter_laplacianeigenmaps.py @@ -4,9 +4,9 @@ def converter_laplacianeigenmaps (data_fname,k): try: - from modshogun import RealFeatures, CSVFile + from shogun import RealFeatures, CSVFile try: - from modshogun import LaplacianEigenmaps + from shogun import LaplacianEigenmaps except ImportError: print("LaplacianEigenmaps not available") exit(0) diff --git a/examples/undocumented/python/converter_linearlocaltangentspacealignment.py b/examples/undocumented/python/converter_linearlocaltangentspacealignment.py index 47d81f19992..65e7218c963 100644 --- a/examples/undocumented/python/converter_linearlocaltangentspacealignment.py +++ b/examples/undocumented/python/converter_linearlocaltangentspacealignment.py @@ -4,9 +4,9 @@ def converter_linearlocaltangentspacealignment (data_fname,k): try: - from modshogun import RealFeatures, CSVFile + from shogun import RealFeatures, CSVFile try: - from modshogun import LinearLocalTangentSpaceAlignment + from shogun import LinearLocalTangentSpaceAlignment except ImportError: print("LinearLocalTangentSpaceAlignment not available") exit(0) diff --git a/examples/undocumented/python/converter_localitypreservingprojections.py b/examples/undocumented/python/converter_localitypreservingprojections.py index c050a9c2c9d..2ff78bae35f 100644 --- a/examples/undocumented/python/converter_localitypreservingprojections.py +++ b/examples/undocumented/python/converter_localitypreservingprojections.py @@ -3,8 +3,8 @@ parameter_list = [[data,20],[data,30]] def converter_localitypreservingprojections (data_fname,k): - from modshogun import RealFeatures, CSVFile - from modshogun import LocalityPreservingProjections + from shogun import RealFeatures, CSVFile + from shogun import LocalityPreservingProjections features = RealFeatures(CSVFile(data_fname)) converter = LocalityPreservingProjections() diff --git a/examples/undocumented/python/converter_locallylinearembedding.py b/examples/undocumented/python/converter_locallylinearembedding.py index cd1ae691de9..1c85d3ffd11 100644 --- a/examples/undocumented/python/converter_locallylinearembedding.py +++ b/examples/undocumented/python/converter_locallylinearembedding.py @@ -4,9 +4,9 @@ def converter_locallylinearembedding (data_fname,k): try: - from modshogun import RealFeatures, CSVFile + from shogun import RealFeatures, CSVFile try: - from modshogun import LocallyLinearEmbedding + from shogun import LocallyLinearEmbedding except ImportError: print("LocallyLinearEmbedding not available") exit(0) diff --git a/examples/undocumented/python/converter_localtangentspacealignment.py b/examples/undocumented/python/converter_localtangentspacealignment.py index 81b8e29ffd1..d47e706b5d7 100644 --- a/examples/undocumented/python/converter_localtangentspacealignment.py +++ b/examples/undocumented/python/converter_localtangentspacealignment.py @@ -4,9 +4,9 @@ def converter_localtangentspacealignment (data_fname,k): try: - from modshogun import RealFeatures, CSVFile + from shogun import RealFeatures, CSVFile try: - from modshogun import LocalTangentSpaceAlignment + from shogun import LocalTangentSpaceAlignment except ImportError: print("LocalTangentSpaceAlignment not available") exit(0) diff --git a/examples/undocumented/python/converter_multidimensionalscaling.py b/examples/undocumented/python/converter_multidimensionalscaling.py index 2a2c16b57c9..8acaac5de4a 100644 --- a/examples/undocumented/python/converter_multidimensionalscaling.py +++ b/examples/undocumented/python/converter_multidimensionalscaling.py @@ -5,7 +5,7 @@ def converter_multidimensionalscaling (data_fname): try: import numpy - from modshogun import RealFeatures, MultidimensionalScaling, EuclideanDistance, CSVFile + from shogun import RealFeatures, MultidimensionalScaling, EuclideanDistance, CSVFile features = RealFeatures(CSVFile(data_fname)) diff --git a/examples/undocumented/python/converter_stochasticproximityembedding.py b/examples/undocumented/python/converter_stochasticproximityembedding.py index cd4aea9a86f..16684987d13 100644 --- a/examples/undocumented/python/converter_stochasticproximityembedding.py +++ b/examples/undocumented/python/converter_stochasticproximityembedding.py @@ -4,7 +4,7 @@ def converter_stochasticproximityembedding (data_fname, k): try: - from modshogun import RealFeatures,StochasticProximityEmbedding, SPE_GLOBAL, SPE_LOCAL, CSVFile + from shogun import RealFeatures,StochasticProximityEmbedding, SPE_GLOBAL, SPE_LOCAL, CSVFile features = RealFeatures(CSVFile(data_fname)) diff --git a/examples/undocumented/python/converter_tdistributedstochasticneighborembedding.py b/examples/undocumented/python/converter_tdistributedstochasticneighborembedding.py index ebfe9ccbaff..9d93083ec32 100644 --- a/examples/undocumented/python/converter_tdistributedstochasticneighborembedding.py +++ b/examples/undocumented/python/converter_tdistributedstochasticneighborembedding.py @@ -4,8 +4,8 @@ def converter_tdistributedstochasticneighborembedding(data_fname, seed=1): try: - from modshogun import RealFeatures, TDistributedStochasticNeighborEmbedding - from modshogun import Math_init_random, CSVFile + from shogun import RealFeatures, TDistributedStochasticNeighborEmbedding + from shogun import Math_init_random, CSVFile # reproducible results Math_init_random(seed) diff --git a/examples/undocumented/python/distance_canberra.py b/examples/undocumented/python/distance_canberra.py index 2a20024ae7f..6c006827a54 100644 --- a/examples/undocumented/python/distance_canberra.py +++ b/examples/undocumented/python/distance_canberra.py @@ -5,7 +5,7 @@ parameter_list = [[traindat,testdat],[traindat,testdat]] def distance_canberra (train_fname=traindat,test_fname=testdat): - from modshogun import RealFeatures, CanberraMetric, CSVFile + from shogun import RealFeatures, CanberraMetric, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/distance_canberraword.py b/examples/undocumented/python/distance_canberraword.py index 7ced3bb7ef7..b01198783b6 100644 --- a/examples/undocumented/python/distance_canberraword.py +++ b/examples/undocumented/python/distance_canberraword.py @@ -9,9 +9,9 @@ parameter_list = [[traindna,testdna,3,0,False],[traindna,testdna,3,0,False]] def distance_canberraword (fm_train_dna=traindna,fm_test_dna=testdna,order=3,gap=0,reverse=False): - from modshogun import StringCharFeatures, StringWordFeatures, DNA - from modshogun import SortWordString - from modshogun import CanberraWordDistance + from shogun import StringCharFeatures, StringWordFeatures, DNA + from shogun import SortWordString + from shogun import CanberraWordDistance charfeat=StringCharFeatures(DNA) charfeat.set_features(fm_train_dna) diff --git a/examples/undocumented/python/distance_chebyshew.py b/examples/undocumented/python/distance_chebyshew.py index e2e1e1c8a55..1a0a0bb6164 100644 --- a/examples/undocumented/python/distance_chebyshew.py +++ b/examples/undocumented/python/distance_chebyshew.py @@ -5,7 +5,7 @@ parameter_list = [[traindat,testdat],[traindat,testdat]] def distance_chebyshew (train_fname=traindat,test_fname=testdat): - from modshogun import RealFeatures, ChebyshewMetric, CSVFile + from shogun import RealFeatures, ChebyshewMetric, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/distance_chisquare.py b/examples/undocumented/python/distance_chisquare.py index 24673c8eb2e..ce8588b4a34 100644 --- a/examples/undocumented/python/distance_chisquare.py +++ b/examples/undocumented/python/distance_chisquare.py @@ -5,7 +5,7 @@ parameter_list = [[traindat,testdat,],[traindat,testdat]] def distance_chisquare (train_fname=traindat,test_fname=testdat): - from modshogun import RealFeatures, ChiSquareDistance, CSVFile + from shogun import RealFeatures, ChiSquareDistance, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/distance_director_euclidean.py b/examples/undocumented/python/distance_director_euclidean.py index 96b137f3c30..deab1aa6aee 100644 --- a/examples/undocumented/python/distance_director_euclidean.py +++ b/examples/undocumented/python/distance_director_euclidean.py @@ -1,6 +1,6 @@ #!/usr/bin/env python import numpy -from modshogun import RealFeatures, MSG_DEBUG +from shogun import RealFeatures, MSG_DEBUG numpy.random.seed(17) traindat = numpy.random.random_sample((10,10)) @@ -9,7 +9,7 @@ def distance_director_euclidean (fm_train_real=traindat,fm_test_real=testdat,scale=1.2): try: - from modshogun import DirectorDistance + from shogun import DirectorDistance except ImportError: print("recompile shogun with --enable-swig-directors") return @@ -22,8 +22,8 @@ def distance_function(self, idx_a, idx_b): seq2 = self.get_rhs().get_feature_vector(idx_b) return numpy.linalg.norm(seq1-seq2) - from modshogun import EuclideanDistance - from modshogun import Time + from shogun import EuclideanDistance + from shogun import Time feats_train=RealFeatures(fm_train_real) #feats_train.io.set_loglevel(MSG_DEBUG) diff --git a/examples/undocumented/python/distance_geodesic.py b/examples/undocumented/python/distance_geodesic.py index 3c49193ca21..eab7ba89811 100644 --- a/examples/undocumented/python/distance_geodesic.py +++ b/examples/undocumented/python/distance_geodesic.py @@ -6,7 +6,7 @@ def distance_geodesic (train_fname=traindat,test_fname=testdat): - from modshogun import RealFeatures, GeodesicMetric, CSVFile + from shogun import RealFeatures, GeodesicMetric, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/distance_hammingword.py b/examples/undocumented/python/distance_hammingword.py index 7dc32478e1e..e0534c0cbf9 100644 --- a/examples/undocumented/python/distance_hammingword.py +++ b/examples/undocumented/python/distance_hammingword.py @@ -12,9 +12,9 @@ def distance_hammingword (fm_train_dna=traindna,fm_test_dna=testdna, fm_test_real=testdat,order=3,gap=0,reverse=False,use_sign=False): - from modshogun import StringCharFeatures, StringWordFeatures, DNA - from modshogun import SortWordString - from modshogun import HammingWordDistance + from shogun import StringCharFeatures, StringWordFeatures, DNA + from shogun import SortWordString + from shogun import HammingWordDistance charfeat=StringCharFeatures(DNA) charfeat.set_features(fm_train_dna) diff --git a/examples/undocumented/python/distance_jensen.py b/examples/undocumented/python/distance_jensen.py index 40e58c66e95..43cd0233a95 100644 --- a/examples/undocumented/python/distance_jensen.py +++ b/examples/undocumented/python/distance_jensen.py @@ -6,7 +6,7 @@ def distance_jensen (train_fname=traindat,test_fname=testdat): - from modshogun import RealFeatures, JensenMetric, CSVFile + from shogun import RealFeatures, JensenMetric, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/distance_manhattenword.py b/examples/undocumented/python/distance_manhattenword.py index 18f925aa164..e377f757285 100644 --- a/examples/undocumented/python/distance_manhattenword.py +++ b/examples/undocumented/python/distance_manhattenword.py @@ -5,8 +5,8 @@ parameter_list = [[traindna,testdna,3,0,False],[traindna,testdna,4,0,False]] def distance_manhattenword (train_fname=traindna,test_fname=testdna,order=3,gap=0,reverse=False): - from modshogun import StringCharFeatures, StringWordFeatures, DNA - from modshogun import SortWordString, ManhattanWordDistance, CSVFile + from shogun import StringCharFeatures, StringWordFeatures, DNA + from shogun import SortWordString, ManhattanWordDistance, CSVFile charfeat=StringCharFeatures(CSVFile(train_fname), DNA) feats_train=StringWordFeatures(charfeat.get_alphabet()) diff --git a/examples/undocumented/python/distance_minkowski.py b/examples/undocumented/python/distance_minkowski.py index 685e643be80..765e9818e9b 100644 --- a/examples/undocumented/python/distance_minkowski.py +++ b/examples/undocumented/python/distance_minkowski.py @@ -5,7 +5,7 @@ parameter_list = [[traindat,testdat,3],[traindat,testdat,4]] def distance_minkowski (train_fname=traindat,test_fname=testdat,k=3): - from modshogun import RealFeatures, MinkowskiMetric, CSVFile + from shogun import RealFeatures, MinkowskiMetric, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/distance_normsquared.py b/examples/undocumented/python/distance_normsquared.py index 68def2bd218..0e1d435514b 100644 --- a/examples/undocumented/python/distance_normsquared.py +++ b/examples/undocumented/python/distance_normsquared.py @@ -5,7 +5,7 @@ parameter_list = [[traindat,testdat],[traindat,testdat]] def distance_normsquared (train_fname=traindat,test_fname=testdat): - from modshogun import RealFeatures, EuclideanDistance, CSVFile + from shogun import RealFeatures, EuclideanDistance, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/distance_sparseeuclidean.py b/examples/undocumented/python/distance_sparseeuclidean.py index 2b9ebd0e615..9f2c48eac01 100644 --- a/examples/undocumented/python/distance_sparseeuclidean.py +++ b/examples/undocumented/python/distance_sparseeuclidean.py @@ -5,7 +5,7 @@ parameter_list = [[traindat,testdat],[traindat,testdat]] def distance_sparseeuclidean (train_fname=traindat,test_fname=testdat): - from modshogun import RealFeatures, SparseRealFeatures, SparseEuclideanDistance, CSVFile + from shogun import RealFeatures, SparseRealFeatures, SparseEuclideanDistance, CSVFile realfeat=RealFeatures(CSVFile(train_fname)) feats_train=SparseRealFeatures() diff --git a/examples/undocumented/python/distance_tanimoto.py b/examples/undocumented/python/distance_tanimoto.py index 59d33323bac..471ec4bec2a 100644 --- a/examples/undocumented/python/distance_tanimoto.py +++ b/examples/undocumented/python/distance_tanimoto.py @@ -5,7 +5,7 @@ parameter_list = [[traindat,testdat],[traindat,testdat]] def distance_tanimoto (train_fname=traindat,test_fname=testdat): - from modshogun import RealFeatures, TanimotoDistance, CSVFile + from shogun import RealFeatures, TanimotoDistance, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/distribution_histogram.py b/examples/undocumented/python/distribution_histogram.py index a1e4acac8f5..52f1752c1f4 100644 --- a/examples/undocumented/python/distribution_histogram.py +++ b/examples/undocumented/python/distribution_histogram.py @@ -7,8 +7,8 @@ parameter_list = [[traindna,3,0,False],[traindna,4,0,False]] def distribution_histogram (fm_dna=traindna,order=3,gap=0,reverse=False): - from modshogun import StringWordFeatures, StringCharFeatures, DNA - from modshogun import Histogram + from shogun import StringWordFeatures, StringCharFeatures, DNA + from shogun import Histogram charfeat=StringCharFeatures(DNA) charfeat.set_features(fm_dna) diff --git a/examples/undocumented/python/distribution_hmm.py b/examples/undocumented/python/distribution_hmm.py index ae4ce639b51..a3019d33c8e 100644 --- a/examples/undocumented/python/distribution_hmm.py +++ b/examples/undocumented/python/distribution_hmm.py @@ -6,8 +6,8 @@ parameter_list=[[data, 1, 64, 1e-5, 2, 0, False, 5], [data, 3, 6, 1e-1, 1, 0, False, 2]] def distribution_hmm(fm_cube, N, M, pseudo, order, gap, reverse, num_examples): - from modshogun import StringWordFeatures, StringCharFeatures, CUBE - from modshogun import HMM, BW_NORMAL + from shogun import StringWordFeatures, StringCharFeatures, CUBE + from shogun import HMM, BW_NORMAL charfeat=StringCharFeatures(CUBE) charfeat.set_features(fm_cube) diff --git a/examples/undocumented/python/distribution_linearhmm.py b/examples/undocumented/python/distribution_linearhmm.py index 128f726b88d..defb8e0f366 100644 --- a/examples/undocumented/python/distribution_linearhmm.py +++ b/examples/undocumented/python/distribution_linearhmm.py @@ -8,8 +8,8 @@ def distribution_linearhmm (fm_dna=traindna,order=3,gap=0,reverse=False): - from modshogun import StringWordFeatures, StringCharFeatures, DNA - from modshogun import LinearHMM + from shogun import StringWordFeatures, StringCharFeatures, DNA + from shogun import LinearHMM charfeat=StringCharFeatures(DNA) charfeat.set_features(fm_dna) diff --git a/examples/undocumented/python/distribution_ppwm.py b/examples/undocumented/python/distribution_ppwm.py index a6d9151583f..11097a4f631 100644 --- a/examples/undocumented/python/distribution_ppwm.py +++ b/examples/undocumented/python/distribution_ppwm.py @@ -7,8 +7,8 @@ parameter_list = [[traindna,3],[traindna,4]] def distribution_ppwm (fm_dna=traindna, order=3): - from modshogun import StringByteFeatures, StringCharFeatures, DNA - from modshogun import PositionalPWM + from shogun import StringByteFeatures, StringCharFeatures, DNA + from shogun import PositionalPWM from numpy import array,e,log,exp diff --git a/examples/undocumented/python/evaluation_clustering.py b/examples/undocumented/python/evaluation_clustering.py index 22c5388eb3f..b0376772240 100644 --- a/examples/undocumented/python/evaluation_clustering.py +++ b/examples/undocumented/python/evaluation_clustering.py @@ -26,9 +26,9 @@ def prepare_data(): def run_clustering(data, k): - from modshogun import KMeans - from modshogun import EuclideanDistance - from modshogun import RealFeatures + from shogun import KMeans + from shogun import EuclideanDistance + from shogun import RealFeatures fea = RealFeatures(data) distance = EuclideanDistance(fea, fea) @@ -40,9 +40,9 @@ def run_clustering(data, k): return kmeans.get_cluster_centers() def assign_labels(data, centroids, ncenters): - from modshogun import EuclideanDistance - from modshogun import RealFeatures, MulticlassLabels - from modshogun import KNN + from shogun import EuclideanDistance + from shogun import RealFeatures, MulticlassLabels + from shogun import KNN from numpy import arange labels = MulticlassLabels(arange(0.,ncenters)) @@ -54,9 +54,9 @@ def assign_labels(data, centroids, ncenters): return knn.apply(fea) def evaluation_clustering (features=fea, ground_truth=gnd_raw, ncenters=10): - from modshogun import ClusteringAccuracy, ClusteringMutualInformation - from modshogun import MulticlassLabels - from modshogun import Math + from shogun import ClusteringAccuracy, ClusteringMutualInformation + from shogun import MulticlassLabels + from shogun import Math # reproducable results Math.init_random(1) diff --git a/examples/undocumented/python/evaluation_clustering_simple.py b/examples/undocumented/python/evaluation_clustering_simple.py index a98c9d2c138..fbce11084ad 100644 --- a/examples/undocumented/python/evaluation_clustering_simple.py +++ b/examples/undocumented/python/evaluation_clustering_simple.py @@ -5,10 +5,10 @@ #from pylab import * def run_clustering(data, k): - from modshogun import KMeans - from modshogun import Math_init_random - from modshogun import EuclideanDistance - from modshogun import RealFeatures + from shogun import KMeans + from shogun import Math_init_random + from shogun import EuclideanDistance + from shogun import RealFeatures fea = RealFeatures(data) distance = EuclideanDistance(fea, fea) @@ -20,9 +20,9 @@ def run_clustering(data, k): return kmeans.get_cluster_centers() def assign_labels(data, centroids, ncenters): - from modshogun import EuclideanDistance - from modshogun import RealFeatures, MulticlassLabels - from modshogun import KNN + from shogun import EuclideanDistance + from shogun import RealFeatures, MulticlassLabels + from shogun import KNN from numpy import arange labels = MulticlassLabels(arange(0.,ncenters)) @@ -34,9 +34,9 @@ def assign_labels(data, centroids, ncenters): return knn.apply(fea) def evaluation_clustering_simple (n_data=100, sqrt_num_blobs=4, distance=5): - from modshogun import ClusteringAccuracy, ClusteringMutualInformation - from modshogun import MulticlassLabels, GaussianBlobsDataGenerator - from modshogun import Math + from shogun import ClusteringAccuracy, ClusteringMutualInformation + from shogun import MulticlassLabels, GaussianBlobsDataGenerator + from shogun import Math # reproducable results Math.init_random(1) diff --git a/examples/undocumented/python/evaluation_contingencytableevaluation.py b/examples/undocumented/python/evaluation_contingencytableevaluation.py index 7496a893c7c..8868e2ca310 100644 --- a/examples/undocumented/python/evaluation_contingencytableevaluation.py +++ b/examples/undocumented/python/evaluation_contingencytableevaluation.py @@ -10,11 +10,11 @@ parameter_list = [[ground_truth,predicted]] def evaluation_contingencytableevaluation (ground_truth, predicted): - from modshogun import BinaryLabels - from modshogun import ContingencyTableEvaluation - from modshogun import AccuracyMeasure,ErrorRateMeasure,BALMeasure - from modshogun import WRACCMeasure,F1Measure,CrossCorrelationMeasure - from modshogun import RecallMeasure,PrecisionMeasure,SpecificityMeasure + from shogun import BinaryLabels + from shogun import ContingencyTableEvaluation + from shogun import AccuracyMeasure,ErrorRateMeasure,BALMeasure + from shogun import WRACCMeasure,F1Measure,CrossCorrelationMeasure + from shogun import RecallMeasure,PrecisionMeasure,SpecificityMeasure ground_truth_labels = BinaryLabels(ground_truth) predicted_labels = BinaryLabels(predicted) diff --git a/examples/undocumented/python/evaluation_cross_validation_classification.py b/examples/undocumented/python/evaluation_cross_validation_classification.py index deafd88a9e6..5a7def4bace 100644 --- a/examples/undocumented/python/evaluation_cross_validation_classification.py +++ b/examples/undocumented/python/evaluation_cross_validation_classification.py @@ -22,12 +22,12 @@ parameter_list = [[traindat,label_traindat]] def evaluation_cross_validation_classification (traindat=traindat, label_traindat=label_traindat): - from modshogun import CrossValidation, CrossValidationResult - from modshogun import ContingencyTableEvaluation, ACCURACY - from modshogun import StratifiedCrossValidationSplitting - from modshogun import BinaryLabels - from modshogun import RealFeatures - from modshogun import LibLinear, L2R_L2LOSS_SVC + from shogun import CrossValidation, CrossValidationResult + from shogun import ContingencyTableEvaluation, ACCURACY + from shogun import StratifiedCrossValidationSplitting + from shogun import BinaryLabels + from shogun import RealFeatures + from shogun import LibLinear, L2R_L2LOSS_SVC # training data features=RealFeatures(traindat) diff --git a/examples/undocumented/python/evaluation_cross_validation_mkl_weight_storage.py b/examples/undocumented/python/evaluation_cross_validation_mkl_weight_storage.py index 9c8bd61d398..cf607d35bba 100644 --- a/examples/undocumented/python/evaluation_cross_validation_mkl_weight_storage.py +++ b/examples/undocumented/python/evaluation_cross_validation_mkl_weight_storage.py @@ -22,15 +22,15 @@ parameter_list = [[traindat,label_traindat]] def evaluation_cross_validation_mkl_weight_storage(traindat=traindat, label_traindat=label_traindat): - from modshogun import CrossValidation, CrossValidationResult - from modshogun import CrossValidationPrintOutput - from modshogun import CrossValidationMKLStorage - from modshogun import ContingencyTableEvaluation, ACCURACY - from modshogun import StratifiedCrossValidationSplitting - from modshogun import BinaryLabels - from modshogun import RealFeatures, CombinedFeatures - from modshogun import GaussianKernel, CombinedKernel - from modshogun import LibSVM, MKLClassification + from shogun import CrossValidation, CrossValidationResult + from shogun import CrossValidationPrintOutput + from shogun import CrossValidationMKLStorage + from shogun import ContingencyTableEvaluation, ACCURACY + from shogun import StratifiedCrossValidationSplitting + from shogun import BinaryLabels + from shogun import RealFeatures, CombinedFeatures + from shogun import GaussianKernel, CombinedKernel + from shogun import LibSVM, MKLClassification # training data, combined features all on same data features=RealFeatures(traindat) diff --git a/examples/undocumented/python/evaluation_cross_validation_multiclass_storage.py b/examples/undocumented/python/evaluation_cross_validation_multiclass_storage.py index 03dad281383..4d2236c5866 100644 --- a/examples/undocumented/python/evaluation_cross_validation_multiclass_storage.py +++ b/examples/undocumented/python/evaluation_cross_validation_multiclass_storage.py @@ -23,16 +23,16 @@ parameter_list = [[traindat,label_traindat]] def evaluation_cross_validation_multiclass_storage (traindat=traindat, label_traindat=label_traindat): - from modshogun import CrossValidation, CrossValidationResult - from modshogun import CrossValidationPrintOutput - from modshogun import CrossValidationMKLStorage, CrossValidationMulticlassStorage - from modshogun import MulticlassAccuracy, F1Measure - from modshogun import StratifiedCrossValidationSplitting - from modshogun import MulticlassLabels - from modshogun import RealFeatures, CombinedFeatures - from modshogun import GaussianKernel, CombinedKernel - from modshogun import MKLMulticlass - from modshogun import Statistics, MSG_DEBUG, Math + from shogun import CrossValidation, CrossValidationResult + from shogun import CrossValidationPrintOutput + from shogun import CrossValidationMKLStorage, CrossValidationMulticlassStorage + from shogun import MulticlassAccuracy, F1Measure + from shogun import StratifiedCrossValidationSplitting + from shogun import MulticlassLabels + from shogun import RealFeatures, CombinedFeatures + from shogun import GaussianKernel, CombinedKernel + from shogun import MKLMulticlass + from shogun import Statistics, MSG_DEBUG, Math Math.init_random(1) diff --git a/examples/undocumented/python/evaluation_cross_validation_regression.py b/examples/undocumented/python/evaluation_cross_validation_regression.py index 45ce5bd5c4b..f124809b6ca 100644 --- a/examples/undocumented/python/evaluation_cross_validation_regression.py +++ b/examples/undocumented/python/evaluation_cross_validation_regression.py @@ -14,10 +14,10 @@ parameter_list = [[traindat,label_traindat,0.8,1e-6],[traindat,label_traindat,0.9,1e-7]] def evaluation_cross_validation_regression (train_fname=traindat,label_fname=label_traindat,width=0.8,tau=1e-6): - from modshogun import CrossValidation, CrossValidationResult - from modshogun import MeanSquaredError, CrossValidationSplitting - from modshogun import RegressionLabels, RealFeatures - from modshogun import GaussianKernel, KernelRidgeRegression, CSVFile + from shogun import CrossValidation, CrossValidationResult + from shogun import MeanSquaredError, CrossValidationSplitting + from shogun import RegressionLabels, RealFeatures + from shogun import GaussianKernel, KernelRidgeRegression, CSVFile # training data features=RealFeatures(CSVFile(train_fname)) diff --git a/examples/undocumented/python/evaluation_director_contingencytableevaluation.py b/examples/undocumented/python/evaluation_director_contingencytableevaluation.py index f8581683a2f..2f839bd3b54 100644 --- a/examples/undocumented/python/evaluation_director_contingencytableevaluation.py +++ b/examples/undocumented/python/evaluation_director_contingencytableevaluation.py @@ -11,7 +11,7 @@ def evaluation_director_contingencytableevaluation (ground_truth, predicted): try: - from modshogun import DirectorContingencyTableEvaluation, ED_MAXIMIZE + from shogun import DirectorContingencyTableEvaluation, ED_MAXIMIZE except ImportError: print("recompile shogun with --enable-swig-directors") return @@ -24,7 +24,7 @@ def get_custom_direction(self): def get_custom_score(self): return self.get_WRACC()+self.get_BAL() - from modshogun import BinaryLabels + from shogun import BinaryLabels evaluator = SimpleWeightedBinaryEvaluator() r = evaluator.evaluate(BinaryLabels(ground_truth), BinaryLabels(predicted)) diff --git a/examples/undocumented/python/evaluation_meansquarederror.py b/examples/undocumented/python/evaluation_meansquarederror.py index b0c3b87d665..141b281f845 100644 --- a/examples/undocumented/python/evaluation_meansquarederror.py +++ b/examples/undocumented/python/evaluation_meansquarederror.py @@ -12,8 +12,8 @@ parameter_list = [[ground_truth,predicted]] def evaluation_meansquarederror (ground_truth, predicted): - from modshogun import RegressionLabels - from modshogun import MeanSquaredError + from shogun import RegressionLabels + from shogun import MeanSquaredError ground_truth_labels = RegressionLabels(ground_truth) predicted_labels = RegressionLabels(predicted) diff --git a/examples/undocumented/python/evaluation_meansquaredlogerror.py b/examples/undocumented/python/evaluation_meansquaredlogerror.py index ec4946eadc3..b15c4a00b2d 100644 --- a/examples/undocumented/python/evaluation_meansquaredlogerror.py +++ b/examples/undocumented/python/evaluation_meansquaredlogerror.py @@ -12,8 +12,8 @@ parameter_list = [[ground_truth,predicted]] def evaluation_meansquaredlogerror (ground_truth, predicted): - from modshogun import RegressionLabels - from modshogun import MeanSquaredLogError + from shogun import RegressionLabels + from shogun import MeanSquaredLogError ground_truth_labels = RegressionLabels(ground_truth) predicted_labels = RegressionLabels(predicted) diff --git a/examples/undocumented/python/evaluation_multiclassaccuracy.py b/examples/undocumented/python/evaluation_multiclassaccuracy.py index 747d8a0f02b..3c38486fed9 100644 --- a/examples/undocumented/python/evaluation_multiclassaccuracy.py +++ b/examples/undocumented/python/evaluation_multiclassaccuracy.py @@ -10,8 +10,8 @@ parameter_list = [[ground_truth,predicted]] def evaluation_multiclassaccuracy (ground_truth, predicted): - from modshogun import MulticlassLabels - from modshogun import MulticlassAccuracy + from shogun import MulticlassLabels + from shogun import MulticlassAccuracy ground_truth_labels = MulticlassLabels(ground_truth) predicted_labels = MulticlassLabels(predicted) diff --git a/examples/undocumented/python/evaluation_multiclassovrevaluation.py b/examples/undocumented/python/evaluation_multiclassovrevaluation.py index 572c44dbe81..0e2f8d6a959 100644 --- a/examples/undocumented/python/evaluation_multiclassovrevaluation.py +++ b/examples/undocumented/python/evaluation_multiclassovrevaluation.py @@ -5,9 +5,9 @@ parameter_list = [[traindat, label_traindat]] def evaluation_multiclassovrevaluation(train_fname=traindat, label_fname=label_traindat): - from modshogun import MulticlassOVREvaluation,ROCEvaluation - from modshogun import MulticlassLibLinear,RealFeatures,ContingencyTableEvaluation,ACCURACY - from modshogun import MulticlassLabels, Math, CSVFile + from shogun import MulticlassOVREvaluation,ROCEvaluation + from shogun import MulticlassLibLinear,RealFeatures,ContingencyTableEvaluation,ACCURACY + from shogun import MulticlassLabels, Math, CSVFile Math.init_random(1) ground_truth_labels = MulticlassLabels(CSVFile(label_fname)) diff --git a/examples/undocumented/python/evaluation_prcevaluation.py b/examples/undocumented/python/evaluation_prcevaluation.py index 1dc94cffe26..6c5325ac66d 100644 --- a/examples/undocumented/python/evaluation_prcevaluation.py +++ b/examples/undocumented/python/evaluation_prcevaluation.py @@ -10,8 +10,8 @@ parameter_list = [[ground_truth,predicted]] def evaluation_prcevaluation (ground_truth, predicted): - from modshogun import BinaryLabels - from modshogun import PRCEvaluation + from shogun import BinaryLabels + from shogun import PRCEvaluation ground_truth_labels = BinaryLabels(ground_truth) predicted_labels = BinaryLabels(predicted) diff --git a/examples/undocumented/python/evaluation_rocevaluation.py b/examples/undocumented/python/evaluation_rocevaluation.py index 19c1493e078..932c2e009f5 100644 --- a/examples/undocumented/python/evaluation_rocevaluation.py +++ b/examples/undocumented/python/evaluation_rocevaluation.py @@ -10,8 +10,8 @@ parameter_list = [[ground_truth,predicted]] def evaluation_rocevaluation (ground_truth, predicted): - from modshogun import BinaryLabels - from modshogun import ROCEvaluation + from shogun import BinaryLabels + from shogun import ROCEvaluation ground_truth_labels = BinaryLabels(ground_truth) predicted_labels = BinaryLabels(predicted) diff --git a/examples/undocumented/python/evaluation_thresholds.py b/examples/undocumented/python/evaluation_thresholds.py index 97f2f7e72c2..cd6f1e516b6 100644 --- a/examples/undocumented/python/evaluation_thresholds.py +++ b/examples/undocumented/python/evaluation_thresholds.py @@ -2,7 +2,7 @@ parameter_list = [[1000]] def evaluation_thresholds (index): - from modshogun import BinaryLabels, ROCEvaluation + from shogun import BinaryLabels, ROCEvaluation import numpy numpy.random.seed(17) output=numpy.arange(-1,1,0.001) diff --git a/examples/undocumented/python/features_binned_dot.py b/examples/undocumented/python/features_binned_dot.py index f3a8192ffda..a4ef9b18141 100644 --- a/examples/undocumented/python/features_binned_dot.py +++ b/examples/undocumented/python/features_binned_dot.py @@ -8,7 +8,7 @@ parameter_list = [(matrix,bins)] def features_binned_dot (matrix, bins): - from modshogun import RealFeatures, BinnedDotFeatures + from shogun import RealFeatures, BinnedDotFeatures rf=RealFeatures(matrix) #print(rf.get_feature_matrix()) diff --git a/examples/undocumented/python/features_dense.py b/examples/undocumented/python/features_dense.py index 6ffddd83928..136bc216d4a 100644 --- a/examples/undocumented/python/features_dense.py +++ b/examples/undocumented/python/features_dense.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from modshogun import RealFeatures, LongIntFeatures, ByteFeatures +from shogun import RealFeatures, LongIntFeatures, ByteFeatures from numpy import array, float64, int64, uint8, all # create dense matrices A,B,C diff --git a/examples/undocumented/python/features_dense_byte.py b/examples/undocumented/python/features_dense_byte.py index 082b06c4206..f85645529c9 100644 --- a/examples/undocumented/python/features_dense_byte.py +++ b/examples/undocumented/python/features_dense_byte.py @@ -7,7 +7,7 @@ parameter_list=[[A]] def features_dense_byte (A): - from modshogun import ByteFeatures + from shogun import ByteFeatures # create dense features a # ... of type Byte diff --git a/examples/undocumented/python/features_dense_io.py b/examples/undocumented/python/features_dense_io.py index aa83a4cfd4e..630468c0d3c 100644 --- a/examples/undocumented/python/features_dense_io.py +++ b/examples/undocumented/python/features_dense_io.py @@ -2,7 +2,7 @@ parameter_list=[[]] def features_dense_io(): - from modshogun import RealFeatures, CSVFile + from shogun import RealFeatures, CSVFile feats=RealFeatures() f=CSVFile("../data/fm_train_real.dat","r") f.set_delimiter(" ") diff --git a/examples/undocumented/python/features_dense_longint.py b/examples/undocumented/python/features_dense_longint.py index 8d5435f4f56..5a21f5b1f42 100644 --- a/examples/undocumented/python/features_dense_longint.py +++ b/examples/undocumented/python/features_dense_longint.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from modshogun import LongIntFeatures +from shogun import LongIntFeatures from numpy import array, int64, all # create dense matrix A diff --git a/examples/undocumented/python/features_dense_protocols.py b/examples/undocumented/python/features_dense_protocols.py index 6867c208463..a11a8639fc3 100644 --- a/examples/undocumented/python/features_dense_protocols.py +++ b/examples/undocumented/python/features_dense_protocols.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import numpy -from modshogun import RealFeatures -from modshogun import LongIntFeatures +from shogun import RealFeatures +from shogun import LongIntFeatures from numpy import array, float64, int64 diff --git a/examples/undocumented/python/features_dense_real.py b/examples/undocumented/python/features_dense_real.py index 4e397fdeecd..169f8011abd 100644 --- a/examples/undocumented/python/features_dense_real.py +++ b/examples/undocumented/python/features_dense_real.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from modshogun import RealFeatures +from shogun import RealFeatures from numpy import array, float64, all # create dense matrices A,B,C diff --git a/examples/undocumented/python/features_dense_zero_copy.py b/examples/undocumented/python/features_dense_zero_copy.py index 24e213beab6..9e7e0c5a40c 100644 --- a/examples/undocumented/python/features_dense_zero_copy.py +++ b/examples/undocumented/python/features_dense_zero_copy.py @@ -1,6 +1,6 @@ #!/usr/bin/env python import numpy -from modshogun import RealFeatures +from shogun import RealFeatures from numpy import array, float64, int64 # create dense matrice diff --git a/examples/undocumented/python/features_director_dot.py b/examples/undocumented/python/features_director_dot.py index 70e4b80bd66..047e2c2fda3 100644 --- a/examples/undocumented/python/features_director_dot.py +++ b/examples/undocumented/python/features_director_dot.py @@ -12,8 +12,8 @@ def features_director_dot (fm_train_real, fm_test_real, label_train_twoclass, C, epsilon): try: - from modshogun import DirectorDotFeatures - from modshogun import RealVector + from shogun import DirectorDotFeatures + from shogun import RealVector except ImportError: print("recompile shogun with --enable-swig-directors") return @@ -61,9 +61,9 @@ def get_dim_feature_space(self): # return NumpyFeatures(self.data-other.data) - #from modshogun import RealFeatures, SparseRealFeatures, BinaryLabels - #from modshogun import LibLinear, L2R_L2LOSS_SVC_DUAL - #from modshogun import Math_init_random + #from shogun import RealFeatures, SparseRealFeatures, BinaryLabels + #from shogun import LibLinear, L2R_L2LOSS_SVC_DUAL + #from shogun import Math_init_random #Math_init_random(17) #feats_train=RealFeatures(fm_train_real) diff --git a/examples/undocumented/python/features_hasheddocdot.py b/examples/undocumented/python/features_hasheddocdot.py index 8bb00b4049a..06b4bc78695 100644 --- a/examples/undocumented/python/features_hasheddocdot.py +++ b/examples/undocumented/python/features_hasheddocdot.py @@ -4,9 +4,9 @@ parameter_list=[[strings]] def features_hasheddocdot(strings): - from modshogun import StringCharFeatures, RAWBYTE - from modshogun import HashedDocDotFeatures - from modshogun import NGramTokenizer + from shogun import StringCharFeatures, RAWBYTE + from shogun import HashedDocDotFeatures + from shogun import NGramTokenizer from numpy import array #create string features diff --git a/examples/undocumented/python/features_io.py b/examples/undocumented/python/features_io.py index 8d1069e41df..ba41c42d3d0 100644 --- a/examples/undocumented/python/features_io.py +++ b/examples/undocumented/python/features_io.py @@ -8,9 +8,9 @@ def features_io (fm_train_real, label_train_twoclass): import numpy - from modshogun import SparseRealFeatures, RealFeatures, MulticlassLabels - from modshogun import GaussianKernel - from modshogun import LibSVMFile, CSVFile, BinaryFile, HDF5File + from shogun import SparseRealFeatures, RealFeatures, MulticlassLabels + from shogun import GaussianKernel + from shogun import LibSVMFile, CSVFile, BinaryFile, HDF5File from tempfile import NamedTemporaryFile feats=SparseRealFeatures(fm_train_real) diff --git a/examples/undocumented/python/features_read_svmlight_format.py b/examples/undocumented/python/features_read_svmlight_format.py index 3551b6bd536..741fd59571b 100644 --- a/examples/undocumented/python/features_read_svmlight_format.py +++ b/examples/undocumented/python/features_read_svmlight_format.py @@ -3,8 +3,8 @@ def features_read_svmlight_format (fname): from tempfile import NamedTemporaryFile - from modshogun import SparseRealFeatures - from modshogun import LibSVMFile + from shogun import SparseRealFeatures + from shogun import LibSVMFile f=SparseRealFeatures() lab=f.load_with_labels(LibSVMFile(fname)) diff --git a/examples/undocumented/python/features_snp.py b/examples/undocumented/python/features_snp.py index 4bc1ff0ad01..afaa31aecf3 100644 --- a/examples/undocumented/python/features_snp.py +++ b/examples/undocumented/python/features_snp.py @@ -2,7 +2,7 @@ parameter_list=[['../data/snps.dat']] def features_snp (fname): - from modshogun import StringByteFeatures, SNPFeatures, SNP + from shogun import StringByteFeatures, SNPFeatures, SNP sf=StringByteFeatures(SNP) sf.load_ascii_file(fname, False, SNP, SNP) diff --git a/examples/undocumented/python/features_sparse.py b/examples/undocumented/python/features_sparse.py index 02ad70eaf61..8c80f69f461 100644 --- a/examples/undocumented/python/features_sparse.py +++ b/examples/undocumented/python/features_sparse.py @@ -6,7 +6,7 @@ parameter_list=[[A]] def features_sparse (A): from scipy.sparse import csc_matrix - from modshogun import SparseRealFeatures + from shogun import SparseRealFeatures from numpy import array, float64, all # sparse representation X of dense matrix A diff --git a/examples/undocumented/python/features_string_char.py b/examples/undocumented/python/features_string_char.py index 9be1c8f4dee..cab77c02af4 100644 --- a/examples/undocumented/python/features_string_char.py +++ b/examples/undocumented/python/features_string_char.py @@ -4,7 +4,7 @@ parameter_list=[[strings]] def features_string_char (strings): - from modshogun import StringCharFeatures, RAWBYTE + from shogun import StringCharFeatures, RAWBYTE from numpy import array #create string features diff --git a/examples/undocumented/python/features_string_char_compressed.py b/examples/undocumented/python/features_string_char_compressed.py index 7922f67e7bb..462809c66bc 100644 --- a/examples/undocumented/python/features_string_char_compressed.py +++ b/examples/undocumented/python/features_string_char_compressed.py @@ -2,9 +2,9 @@ parameter_list = [['features_string_char_compressed.py']] def features_string_char_compressed (fname): - from modshogun import StringCharFeatures, StringFileCharFeatures, RAWBYTE - from modshogun import UNCOMPRESSED,SNAPPY,LZO,GZIP,BZIP2,LZMA, MSG_DEBUG - from modshogun import DecompressCharString + from shogun import StringCharFeatures, StringFileCharFeatures, RAWBYTE + from shogun import UNCOMPRESSED,SNAPPY,LZO,GZIP,BZIP2,LZMA, MSG_DEBUG + from shogun import DecompressCharString f=StringFileCharFeatures(fname, RAWBYTE) diff --git a/examples/undocumented/python/features_string_file.py b/examples/undocumented/python/features_string_file.py index cc05ea8dd69..d0e633d1226 100644 --- a/examples/undocumented/python/features_string_file.py +++ b/examples/undocumented/python/features_string_file.py @@ -2,8 +2,8 @@ parameter_list=[[".", "features_string_char.py"]] def features_string_file (directory, fname): - from modshogun import StringCharFeatures, RAWBYTE - from modshogun import CSVFile + from shogun import StringCharFeatures, RAWBYTE + from shogun import CSVFile # load features from directory f=StringCharFeatures(RAWBYTE) diff --git a/examples/undocumented/python/features_string_file_char.py b/examples/undocumented/python/features_string_file_char.py index 5de183de0a0..3335b668535 100644 --- a/examples/undocumented/python/features_string_file_char.py +++ b/examples/undocumented/python/features_string_file_char.py @@ -2,7 +2,7 @@ parameter_list = [['features_string_file_char.py']] def features_string_file_char (fname): - from modshogun import StringFileCharFeatures, RAWBYTE + from shogun import StringFileCharFeatures, RAWBYTE f = StringFileCharFeatures(fname, RAWBYTE) #print("strings", f.get_features()) return f diff --git a/examples/undocumented/python/features_string_hashed_wd.py b/examples/undocumented/python/features_string_hashed_wd.py index 734d5c2cacf..7ee0679fcee 100644 --- a/examples/undocumented/python/features_string_hashed_wd.py +++ b/examples/undocumented/python/features_string_hashed_wd.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from modshogun import LongIntFeatures +from shogun import LongIntFeatures from numpy import array, int64, all # create dense matrix A @@ -12,8 +12,8 @@ def features_string_hashed_wd (A=matrix,order=3,start_order=1,hash_bits=2): a=LongIntFeatures(A) from numpy import array, uint8 - from modshogun import HashedWDFeatures, StringByteFeatures, RAWDNA - from modshogun import MSG_DEBUG + from shogun import HashedWDFeatures, StringByteFeatures, RAWDNA + from shogun import MSG_DEBUG x=[array([0,1,2,3,0,1,2,3,3,2,2,1,1],dtype=uint8)] from_order=order diff --git a/examples/undocumented/python/features_string_sliding_window.py b/examples/undocumented/python/features_string_sliding_window.py index 29f29cd3da1..05ac8de69c7 100644 --- a/examples/undocumented/python/features_string_sliding_window.py +++ b/examples/undocumented/python/features_string_sliding_window.py @@ -5,8 +5,8 @@ parameter_list=[[s]] def features_string_sliding_window (strings): - from modshogun import StringCharFeatures, DNA - from modshogun import DynamicIntArray + from shogun import StringCharFeatures, DNA + from shogun import DynamicIntArray f=StringCharFeatures([strings], DNA) diff --git a/examples/undocumented/python/features_string_ulong.py b/examples/undocumented/python/features_string_ulong.py index e6e0733016f..ca0808299fa 100644 --- a/examples/undocumented/python/features_string_ulong.py +++ b/examples/undocumented/python/features_string_ulong.py @@ -4,7 +4,7 @@ def features_string_ulong (start=0,order=2,gap=0,rev=False): - from modshogun import StringCharFeatures, StringUlongFeatures, RAWBYTE + from shogun import StringCharFeatures, StringUlongFeatures, RAWBYTE from numpy import array, uint64 #create string features diff --git a/examples/undocumented/python/features_string_word.py b/examples/undocumented/python/features_string_word.py index 09865a65c5e..0bba571d6a8 100644 --- a/examples/undocumented/python/features_string_word.py +++ b/examples/undocumented/python/features_string_word.py @@ -4,7 +4,7 @@ parameter_list=[[strings,0,2,0,False]] def features_string_word (strings, start, order, gap, rev): - from modshogun import StringCharFeatures, StringWordFeatures, RAWBYTE + from shogun import StringCharFeatures, StringWordFeatures, RAWBYTE from numpy import array, uint16 #create string features diff --git a/examples/undocumented/python/graphical/classifier_gaussian_process_binary_classification.py b/examples/undocumented/python/graphical/classifier_gaussian_process_binary_classification.py index ce8e06feb56..2d88b9693c6 100644 --- a/examples/undocumented/python/graphical/classifier_gaussian_process_binary_classification.py +++ b/examples/undocumented/python/graphical/classifier_gaussian_process_binary_classification.py @@ -35,7 +35,7 @@ def gaussian_process_binary_classification_laplace(X_train, y_train, n_test=50): # import all necessary modules from Shogun (some of them require Eigen3) try: - from modshogun import RealFeatures, BinaryLabels, GaussianKernel, \ + from shogun import RealFeatures, BinaryLabels, GaussianKernel, \ LogitLikelihood, ProbitLikelihood, ZeroMean, SingleLaplacianInferenceMethod, \ EPInferenceMethod, GaussianProcessClassification except ImportError: diff --git a/examples/undocumented/python/graphical/classifier_perceptron_graphical.py b/examples/undocumented/python/graphical/classifier_perceptron_graphical.py index d7efc844432..2064921b835 100644 --- a/examples/undocumented/python/graphical/classifier_perceptron_graphical.py +++ b/examples/undocumented/python/graphical/classifier_perceptron_graphical.py @@ -7,9 +7,9 @@ parameter_list = [[20, 5, 1., 1000, 1, None, 5], [100, 5, 1., 1000, 1, None, 10]] def classifier_perceptron_graphical(n=100, distance=5, learn_rate=1., max_iter=1000, num_threads=1, seed=None, nperceptrons=5): - from modshogun import RealFeatures, BinaryLabels - from modshogun import Perceptron - from modshogun import MSG_INFO + from shogun import RealFeatures, BinaryLabels + from shogun import Perceptron + from shogun import MSG_INFO # 2D data _DIM = 2 diff --git a/examples/undocumented/python/graphical/cluster_kmeans.py b/examples/undocumented/python/graphical/cluster_kmeans.py index e549ab3bbbf..63a82911954 100644 --- a/examples/undocumented/python/graphical/cluster_kmeans.py +++ b/examples/undocumented/python/graphical/cluster_kmeans.py @@ -2,7 +2,7 @@ from numpy import ones,zeros,cos,sin,concatenate from numpy.random import randn -from modshogun import * +from shogun import * k=4 num=1000 diff --git a/examples/undocumented/python/graphical/cluster_kpp.py b/examples/undocumented/python/graphical/cluster_kpp.py index c0c0f6f9b9a..70b76cdeeeb 100644 --- a/examples/undocumented/python/graphical/cluster_kpp.py +++ b/examples/undocumented/python/graphical/cluster_kpp.py @@ -11,7 +11,7 @@ from numpy import array,ones,zeros,cos,sin,concatenate from numpy.random import randn -from modshogun import * +from shogun import * k=2 num=500 diff --git a/examples/undocumented/python/graphical/converter_ffsep_bss.py b/examples/undocumented/python/graphical/converter_ffsep_bss.py index 64e01a94a3a..cfb4527e568 100644 --- a/examples/undocumented/python/graphical/converter_ffsep_bss.py +++ b/examples/undocumented/python/graphical/converter_ffsep_bss.py @@ -11,8 +11,8 @@ import numpy as np import pylab as pl -from modshogun import RealFeatures -from modshogun import FFSep +from shogun import RealFeatures +from shogun import FFSep # Generate sample data np.random.seed(0) diff --git a/examples/undocumented/python/graphical/converter_jade_bss.py b/examples/undocumented/python/graphical/converter_jade_bss.py index 973508a27c0..f06b2efe033 100644 --- a/examples/undocumented/python/graphical/converter_jade_bss.py +++ b/examples/undocumented/python/graphical/converter_jade_bss.py @@ -11,8 +11,8 @@ import numpy as np import pylab as pl -from modshogun import RealFeatures -from modshogun import Jade +from shogun import RealFeatures +from shogun import Jade # Generate sample data np.random.seed(0) diff --git a/examples/undocumented/python/graphical/converter_jedi_bss.py b/examples/undocumented/python/graphical/converter_jedi_bss.py index 184f86f5a33..b110ccc493b 100644 --- a/examples/undocumented/python/graphical/converter_jedi_bss.py +++ b/examples/undocumented/python/graphical/converter_jedi_bss.py @@ -11,8 +11,8 @@ import numpy as np import pylab as pl -from modshogun import RealFeatures -from modshogun import JediSep +from shogun import RealFeatures +from shogun import JediSep # Generate sample data np.random.seed(0) diff --git a/examples/undocumented/python/graphical/converter_sobi_bss.py b/examples/undocumented/python/graphical/converter_sobi_bss.py index 808f0880ad8..67b11eaab4e 100644 --- a/examples/undocumented/python/graphical/converter_sobi_bss.py +++ b/examples/undocumented/python/graphical/converter_sobi_bss.py @@ -11,8 +11,8 @@ import numpy as np import pylab as pl -from modshogun import RealFeatures -from modshogun import SOBI +from shogun import RealFeatures +from shogun import SOBI # Generate sample data np.random.seed(0) diff --git a/examples/undocumented/python/graphical/converter_spe_helix.py b/examples/undocumented/python/graphical/converter_spe_helix.py index c3c79aaf6d3..08164b1d2d0 100644 --- a/examples/undocumented/python/graphical/converter_spe_helix.py +++ b/examples/undocumented/python/graphical/converter_spe_helix.py @@ -19,9 +19,9 @@ import pylab import util -from modshogun import RealFeatures -from modshogun import StochasticProximityEmbedding, SPE_GLOBAL -from modshogun import SPE_LOCAL, Isomap +from shogun import RealFeatures +from shogun import StochasticProximityEmbedding, SPE_GLOBAL +from shogun import SPE_LOCAL, Isomap # Number of data points N = 500 diff --git a/examples/undocumented/python/graphical/converter_uwedge_bss.py b/examples/undocumented/python/graphical/converter_uwedge_bss.py index 0450d7fee1f..bbab4c6ccaa 100644 --- a/examples/undocumented/python/graphical/converter_uwedge_bss.py +++ b/examples/undocumented/python/graphical/converter_uwedge_bss.py @@ -8,8 +8,8 @@ import numpy as np import pylab as pl -from modshogun import RealFeatures -from modshogun import UWedgeSep +from shogun import RealFeatures +from shogun import UWedgeSep # Generate sample data np.random.seed(0) diff --git a/examples/undocumented/python/graphical/eigenfaces.py b/examples/undocumented/python/graphical/eigenfaces.py index d4a888f4627..60253957680 100644 --- a/examples/undocumented/python/graphical/eigenfaces.py +++ b/examples/undocumented/python/graphical/eigenfaces.py @@ -41,9 +41,9 @@ import numpy as np from numpy import random -from modshogun import RealFeatures -from modshogun import PCA -from modshogun import EuclideanDistance +from shogun import RealFeatures +from shogun import PCA +from shogun import EuclideanDistance import math import os import pylab as pl diff --git a/examples/undocumented/python/graphical/em_1d_gmm.py b/examples/undocumented/python/graphical/em_1d_gmm.py index cb00495acb2..1e826e3a514 100644 --- a/examples/undocumented/python/graphical/em_1d_gmm.py +++ b/examples/undocumented/python/graphical/em_1d_gmm.py @@ -1,7 +1,7 @@ from pylab import figure,show,connect,hist,plot,legend from numpy import array, append, arange, empty, exp -from modshogun import Gaussian, GMM -from modshogun import RealFeatures +from shogun import Gaussian, GMM +from shogun import RealFeatures import util util.set_title('EM for 1d GMM example') diff --git a/examples/undocumented/python/graphical/em_2d_gmm.py b/examples/undocumented/python/graphical/em_2d_gmm.py index 92cb298de37..90551c7b440 100644 --- a/examples/undocumented/python/graphical/em_2d_gmm.py +++ b/examples/undocumented/python/graphical/em_2d_gmm.py @@ -1,7 +1,7 @@ from pylab import figure,scatter,contour,show,legend,connect from numpy import array, append, arange, reshape, empty, exp -from modshogun import Gaussian, GMM -from modshogun import RealFeatures +from shogun import Gaussian, GMM +from shogun import RealFeatures import util util.set_title('EM for 2d GMM example') diff --git a/examples/undocumented/python/graphical/group_lasso.py b/examples/undocumented/python/graphical/group_lasso.py index fb27e2361c9..1de54d418b6 100644 --- a/examples/undocumented/python/graphical/group_lasso.py +++ b/examples/undocumented/python/graphical/group_lasso.py @@ -4,7 +4,7 @@ import matplotlib.pyplot as plt from numpy.random import rand, randn, permutation, multivariate_normal -from modshogun import BinaryLabels, RealFeatures, IndexBlock, IndexBlockGroup, FeatureBlockLogisticRegression +from shogun import BinaryLabels, RealFeatures, IndexBlock, IndexBlockGroup, FeatureBlockLogisticRegression def generate_synthetic_logistic_data(n, p, L, blk_nnz, gcov, nstd): diff --git a/examples/undocumented/python/graphical/interactive_clustering_demo.py b/examples/undocumented/python/graphical/interactive_clustering_demo.py index ad434521619..38c14597cae 100644 --- a/examples/undocumented/python/graphical/interactive_clustering_demo.py +++ b/examples/undocumented/python/graphical/interactive_clustering_demo.py @@ -16,9 +16,9 @@ from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar from matplotlib.figure import Figure -from modshogun import * -from modshogun import * -from modshogun import * +from shogun import * +from shogun import * +from shogun import * import util class Form(QMainWindow): diff --git a/examples/undocumented/python/graphical/interactive_gp_demo.py b/examples/undocumented/python/graphical/interactive_gp_demo.py index ebbff94d0e2..9e1846eb52c 100644 --- a/examples/undocumented/python/graphical/interactive_gp_demo.py +++ b/examples/undocumented/python/graphical/interactive_gp_demo.py @@ -29,9 +29,9 @@ from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar from matplotlib.figure import Figure -from modshogun import * -from modshogun import * -from modshogun import * +from shogun import * +from shogun import * +from shogun import * import util class Form(QMainWindow): diff --git a/examples/undocumented/python/graphical/interactive_kmm_demo.py b/examples/undocumented/python/graphical/interactive_kmm_demo.py index 80f957201b7..9eae0833371 100644 --- a/examples/undocumented/python/graphical/interactive_kmm_demo.py +++ b/examples/undocumented/python/graphical/interactive_kmm_demo.py @@ -25,9 +25,9 @@ from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar from matplotlib.figure import Figure -from modshogun import * -from modshogun import KernelMeanMatching -from modshogun import Math +from shogun import * +from shogun import KernelMeanMatching +from shogun import Math import util class Form(QMainWindow): diff --git a/examples/undocumented/python/graphical/interactive_svm_demo.py b/examples/undocumented/python/graphical/interactive_svm_demo.py index 14b00292d29..1732f89394d 100644 --- a/examples/undocumented/python/graphical/interactive_svm_demo.py +++ b/examples/undocumented/python/graphical/interactive_svm_demo.py @@ -16,7 +16,7 @@ from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar from matplotlib.figure import Figure -from modshogun import * +from shogun import * import util class Form(QMainWindow): diff --git a/examples/undocumented/python/graphical/interactive_svr_demo.py b/examples/undocumented/python/graphical/interactive_svr_demo.py index b0276ae3765..302e9e86c82 100644 --- a/examples/undocumented/python/graphical/interactive_svr_demo.py +++ b/examples/undocumented/python/graphical/interactive_svr_demo.py @@ -16,7 +16,7 @@ from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar from matplotlib.figure import Figure -from modshogun import * +from shogun import * class Form(QMainWindow): def __init__(self, parent=None): diff --git a/examples/undocumented/python/graphical/inverse_covariance_estimation_demo.py b/examples/undocumented/python/graphical/inverse_covariance_estimation_demo.py index 09faf32ac6f..91848758b03 100755 --- a/examples/undocumented/python/graphical/inverse_covariance_estimation_demo.py +++ b/examples/undocumented/python/graphical/inverse_covariance_estimation_demo.py @@ -5,7 +5,7 @@ from pylab import show, imshow def simulate_data (n,p): - from modshogun import SparseInverseCovariance + from shogun import SparseInverseCovariance import numpy as np #create a random pxp covariance matrix @@ -18,7 +18,7 @@ def simulate_data (n,p): return data def inverse_covariance (data,lc): - from modshogun import SparseInverseCovariance + from shogun import SparseInverseCovariance from numpy import dot sic = SparseInverseCovariance() diff --git a/examples/undocumented/python/graphical/kernel_ridge_regression.py b/examples/undocumented/python/graphical/kernel_ridge_regression.py index 7d9a9227b32..be72f275076 100644 --- a/examples/undocumented/python/graphical/kernel_ridge_regression.py +++ b/examples/undocumented/python/graphical/kernel_ridge_regression.py @@ -1,7 +1,7 @@ from pylab import figure,pcolor,scatter,contour,colorbar,show,subplot,plot,connect from numpy import array,meshgrid,reshape,linspace,min,max from numpy import concatenate,transpose,ravel -from modshogun import * +from shogun import * import util util.set_title('KernelRidgeRegression') diff --git a/examples/undocumented/python/graphical/kernel_ridge_regression_sinc.py b/examples/undocumented/python/graphical/kernel_ridge_regression_sinc.py index 2ea9a0aa311..7f9d68d8284 100644 --- a/examples/undocumented/python/graphical/kernel_ridge_regression_sinc.py +++ b/examples/undocumented/python/graphical/kernel_ridge_regression_sinc.py @@ -1,5 +1,5 @@ from pylab import figure,pcolor,scatter,contour,colorbar,show,subplot,plot,legend,connect -from modshogun import * +from shogun import * import util util.set_title('KernelRidgeRegression on Sine') diff --git a/examples/undocumented/python/graphical/lda.py b/examples/undocumented/python/graphical/lda.py index 14b4ccf9c47..9eef3796f2f 100644 --- a/examples/undocumented/python/graphical/lda.py +++ b/examples/undocumented/python/graphical/lda.py @@ -1,5 +1,5 @@ from pylab import figure,pcolor,scatter,contour,colorbar,show,subplot,plot,connect -from modshogun import * +from shogun import * import util util.set_title('LDA') diff --git a/examples/undocumented/python/graphical/mclda.py b/examples/undocumented/python/graphical/mclda.py index 961b93dfe7d..eae10a4ec65 100644 --- a/examples/undocumented/python/graphical/mclda.py +++ b/examples/undocumented/python/graphical/mclda.py @@ -1,6 +1,6 @@ -from modshogun import RealFeatures -from modshogun import MulticlassLabels -from modshogun import MCLDA +from shogun import RealFeatures +from shogun import MulticlassLabels +from shogun import MCLDA from pylab import pcolor, contour, colorbar, connect, show, plot, axis import numpy as np diff --git a/examples/undocumented/python/graphical/metric_lmnn_objective.py b/examples/undocumented/python/graphical/metric_lmnn_objective.py index 1fc83932eb0..bae796fd351 100644 --- a/examples/undocumented/python/graphical/metric_lmnn_objective.py +++ b/examples/undocumented/python/graphical/metric_lmnn_objective.py @@ -36,10 +36,10 @@ def load_compressed_features(fname_features): def metric_lmnn_statistics(k=3, fname_features='../../data/fm_train_multiclass_digits.dat.gz', fname_labels='../../data/label_train_multiclass_digits.dat'): try: - from modshogun import LMNN, CSVFile, RealFeatures, MulticlassLabels, MSG_DEBUG + from shogun import LMNN, CSVFile, RealFeatures, MulticlassLabels, MSG_DEBUG import matplotlib.pyplot as pyplot except ImportError: - print 'Error importing modshogun or other required modules. Please, verify their installation.' + print 'Error importing shogun or other required modules. Please, verify their installation.' return features = RealFeatures(load_compressed_features(fname_features).T) diff --git a/examples/undocumented/python/graphical/multiclass_qda.py b/examples/undocumented/python/graphical/multiclass_qda.py index 91afb419078..53419f45e57 100644 --- a/examples/undocumented/python/graphical/multiclass_qda.py +++ b/examples/undocumented/python/graphical/multiclass_qda.py @@ -10,8 +10,8 @@ import util from scipy import linalg -from modshogun import QDA -from modshogun import RealFeatures, MulticlassLabels +from shogun import QDA +from shogun import RealFeatures, MulticlassLabels # colormap cmap = mpl.colors.LinearSegmentedColormap('color_classes', diff --git a/examples/undocumented/python/graphical/multiple_smvs.py b/examples/undocumented/python/graphical/multiple_smvs.py index 21ad567584e..a728ba5b03a 100644 --- a/examples/undocumented/python/graphical/multiple_smvs.py +++ b/examples/undocumented/python/graphical/multiple_smvs.py @@ -4,7 +4,7 @@ from pylab import figure,pcolor,scatter,contour,colorbar,show,subplot,connect,axis from numpy import concatenate from numpy.random import randn -from modshogun import * +from shogun import * import util util.set_title('Multiple SVMS') diff --git a/examples/undocumented/python/graphical/prc.py b/examples/undocumented/python/graphical/prc.py index d13eda7ada1..79ef6c0c942 100644 --- a/examples/undocumented/python/graphical/prc.py +++ b/examples/undocumented/python/graphical/prc.py @@ -1,7 +1,7 @@ from pylab import plot,grid,title,subplot,xlabel,ylabel,text,subplots_adjust,fill_between,mean,connect,show -from modshogun import GaussianKernel -from modshogun import LibSVM, LDA -from modshogun import PRCEvaluation +from shogun import GaussianKernel +from shogun import LibSVM, LDA +from shogun import PRCEvaluation import util util.set_title('PRC example') diff --git a/examples/undocumented/python/graphical/preprocessor_kpca_graphical.py b/examples/undocumented/python/graphical/preprocessor_kpca_graphical.py index a2344ef8629..c6ef1437235 100644 --- a/examples/undocumented/python/graphical/preprocessor_kpca_graphical.py +++ b/examples/undocumented/python/graphical/preprocessor_kpca_graphical.py @@ -25,9 +25,9 @@ parameter_list = [[data,0.01,1.0], [data,0.05,2.0]] def preprocessor_kernelpca_modular (data, threshold, width): - from modshogun import RealFeatures - from modshogun import KernelPCA - from modshogun import GaussianKernel + from shogun import RealFeatures + from shogun import KernelPCA + from shogun import GaussianKernel features = RealFeatures(data) kernel=GaussianKernel(features,features,width) preprocessor=KernelPCA(kernel) diff --git a/examples/undocumented/python/graphical/qda.py b/examples/undocumented/python/graphical/qda.py index 3361cf12378..e8486410e5d 100644 --- a/examples/undocumented/python/graphical/qda.py +++ b/examples/undocumented/python/graphical/qda.py @@ -1,6 +1,6 @@ -from modshogun import RealFeatures -from modshogun import MulticlassLabels -from modshogun import QDA +from shogun import RealFeatures +from shogun import MulticlassLabels +from shogun import QDA from pylab import pcolor, contour, colorbar, connect, show, plot, axis import numpy as np diff --git a/examples/undocumented/python/graphical/regression_gaussian_process_demo.py b/examples/undocumented/python/graphical/regression_gaussian_process_demo.py index eb24bf4f1b9..132d6a71ebc 100644 --- a/examples/undocumented/python/graphical/regression_gaussian_process_demo.py +++ b/examples/undocumented/python/graphical/regression_gaussian_process_demo.py @@ -6,14 +6,14 @@ ########################################################################### from numpy import * from numpy.random import randn -from modshogun import * +from shogun import * import pylab as PL import matplotlib import logging as LG import scipy as SP -from modshogun import GradientModelSelection -from modshogun import ModelSelectionParameters, R_EXP, R_LINEAR -from modshogun import ParameterCombination +from shogun import GradientModelSelection +from shogun import ModelSelectionParameters, R_EXP, R_LINEAR +from shogun import ParameterCombination def plot_training_data(x, y, shift=None, diff --git a/examples/undocumented/python/graphical/regression_gaussian_process_modelselection.py b/examples/undocumented/python/graphical/regression_gaussian_process_modelselection.py index d9621f259cc..f916e7a4ea8 100644 --- a/examples/undocumented/python/graphical/regression_gaussian_process_modelselection.py +++ b/examples/undocumented/python/graphical/regression_gaussian_process_modelselection.py @@ -6,10 +6,10 @@ def regression_gaussian_process_modelselection (n=100, n_test=100, \ x_range=5, x_range_test=10, noise_var=0.4): - from modshogun import RealFeatures, RegressionLabels - from modshogun import GaussianKernel - from modshogun import GradientModelSelection, ModelSelectionParameters - from modshogun import GaussianLikelihood, ZeroMean, \ + from shogun import RealFeatures, RegressionLabels + from shogun import GaussianKernel + from shogun import GradientModelSelection, ModelSelectionParameters + from shogun import GaussianLikelihood, ZeroMean, \ ExactInferenceMethod, GaussianProcessRegression, GradientCriterion, \ GradientEvaluation diff --git a/examples/undocumented/python/graphical/regression_lars.py b/examples/undocumented/python/graphical/regression_lars.py index d78aef010c0..bab8189130a 100644 --- a/examples/undocumented/python/graphical/regression_lars.py +++ b/examples/undocumented/python/graphical/regression_lars.py @@ -3,9 +3,9 @@ import numpy as np import matplotlib.pyplot as plt -from modshogun import RegressionLabels, RealFeatures -from modshogun import LeastAngleRegression, LinearRidgeRegression, LeastSquaresRegression -from modshogun import MeanSquaredError +from shogun import RegressionLabels, RealFeatures +from shogun import LeastAngleRegression, LinearRidgeRegression, LeastSquaresRegression +from shogun import MeanSquaredError # we compare LASSO with ordinary least-squares (OLE) # in the ideal case, the MSE of OLE should coincide diff --git a/examples/undocumented/python/graphical/roc.py b/examples/undocumented/python/graphical/roc.py index aeb16c4275e..0c0b6c60438 100644 --- a/examples/undocumented/python/graphical/roc.py +++ b/examples/undocumented/python/graphical/roc.py @@ -1,7 +1,7 @@ from pylab import plot,grid,title,subplot,xlabel,ylabel,text,subplots_adjust,fill_between,mean,connect,show -from modshogun import GaussianKernel -from modshogun import LibSVM, LDA -from modshogun import ROCEvaluation +from shogun import GaussianKernel +from shogun import LibSVM, LDA +from shogun import ROCEvaluation import util util.set_title('ROC example') diff --git a/examples/undocumented/python/graphical/smem_1d_gmm.py b/examples/undocumented/python/graphical/smem_1d_gmm.py index 46daf184344..256404c93f7 100644 --- a/examples/undocumented/python/graphical/smem_1d_gmm.py +++ b/examples/undocumented/python/graphical/smem_1d_gmm.py @@ -1,7 +1,7 @@ from pylab import figure,show,connect,hist,plot,legend from numpy import array, append, arange, empty, exp -from modshogun import Gaussian, GMM -from modshogun import RealFeatures +from shogun import Gaussian, GMM +from shogun import RealFeatures import util util.set_title('SMEM for 1d GMM example') diff --git a/examples/undocumented/python/graphical/smem_2d_gmm.py b/examples/undocumented/python/graphical/smem_2d_gmm.py index 1b113a96989..6655aceee30 100644 --- a/examples/undocumented/python/graphical/smem_2d_gmm.py +++ b/examples/undocumented/python/graphical/smem_2d_gmm.py @@ -1,7 +1,7 @@ from pylab import figure,scatter,contour,show,legend,connect from numpy import array, append, arange, reshape, empty, exp -from modshogun import Gaussian, GMM -from modshogun import RealFeatures +from shogun import Gaussian, GMM +from shogun import RealFeatures import util util.set_title('SMEM for 2d GMM example') diff --git a/examples/undocumented/python/graphical/so_multiclass_BMRM.py b/examples/undocumented/python/graphical/so_multiclass_BMRM.py index 64295040669..8c59826e060 100644 --- a/examples/undocumented/python/graphical/so_multiclass_BMRM.py +++ b/examples/undocumented/python/graphical/so_multiclass_BMRM.py @@ -3,10 +3,10 @@ import numpy as np import matplotlib.pyplot as plt -from modshogun import RealFeatures -from modshogun import MulticlassModel, MulticlassSOLabels, RealNumber, DualLibQPBMSOSVM -from modshogun import BMRM, PPBMRM, P3BMRM -from modshogun import StructuredAccuracy +from shogun import RealFeatures +from shogun import MulticlassModel, MulticlassSOLabels, RealNumber, DualLibQPBMSOSVM +from shogun import BMRM, PPBMRM, P3BMRM +from shogun import StructuredAccuracy def fill_data(cnt, minv, maxv): x1 = np.linspace(minv, maxv, cnt) diff --git a/examples/undocumented/python/graphical/so_multiclass_director_BMRM.py b/examples/undocumented/python/graphical/so_multiclass_director_BMRM.py index e49e28987eb..0edbe80b833 100644 --- a/examples/undocumented/python/graphical/so_multiclass_director_BMRM.py +++ b/examples/undocumented/python/graphical/so_multiclass_director_BMRM.py @@ -3,10 +3,10 @@ import numpy as np import matplotlib.pyplot as plt -from modshogun import RealFeatures -from modshogun import MulticlassModel, MulticlassSOLabels, RealNumber, DualLibQPBMSOSVM, DirectorStructuredModel -from modshogun import BMRM, PPBMRM, P3BMRM, ResultSet, RealVector -from modshogun import StructuredAccuracy +from shogun import RealFeatures +from shogun import MulticlassModel, MulticlassSOLabels, RealNumber, DualLibQPBMSOSVM, DirectorStructuredModel +from shogun import BMRM, PPBMRM, P3BMRM, ResultSet, RealVector +from shogun import StructuredAccuracy class MulticlassStructuredModel(DirectorStructuredModel): def __init__(self,features,labels): diff --git a/examples/undocumented/python/graphical/statistics_hsic.py b/examples/undocumented/python/graphical/statistics_hsic.py index c5b76658179..a0e44f24d3b 100644 --- a/examples/undocumented/python/graphical/statistics_hsic.py +++ b/examples/undocumented/python/graphical/statistics_hsic.py @@ -10,13 +10,13 @@ from pylab import * from scipy import * -from modshogun import RealFeatures -from modshogun import DataGenerator -from modshogun import GaussianKernel -from modshogun import HSIC -from modshogun import PERMUTATION, HSIC_GAMMA -from modshogun import EuclideanDistance -from modshogun import Statistics, Math +from shogun import RealFeatures +from shogun import DataGenerator +from shogun import GaussianKernel +from shogun import HSIC +from shogun import PERMUTATION, HSIC_GAMMA +from shogun import EuclideanDistance +from shogun import Statistics, Math # for nice plotting that fits into our shogun tutorial import latex_plot_inits diff --git a/examples/undocumented/python/graphical/statistics_linear_time_mmd.py b/examples/undocumented/python/graphical/statistics_linear_time_mmd.py index f57ef905866..c2e001dc399 100644 --- a/examples/undocumented/python/graphical/statistics_linear_time_mmd.py +++ b/examples/undocumented/python/graphical/statistics_linear_time_mmd.py @@ -10,13 +10,13 @@ from pylab import * from scipy import * -from modshogun import RealFeatures -from modshogun import MeanShiftDataGenerator -from modshogun import GaussianKernel, CombinedKernel -from modshogun import LinearTimeMMD, MMDKernelSelectionOpt -from modshogun import PERMUTATION, MMD1_GAUSSIAN -from modshogun import EuclideanDistance -from modshogun import Statistics, Math +from shogun import RealFeatures +from shogun import MeanShiftDataGenerator +from shogun import GaussianKernel, CombinedKernel +from shogun import LinearTimeMMD, MMDKernelSelectionOpt +from shogun import PERMUTATION, MMD1_GAUSSIAN +from shogun import EuclideanDistance +from shogun import Statistics, Math # for nice plotting that fits into our shogun tutorial import latex_plot_inits diff --git a/examples/undocumented/python/graphical/statistics_quadratic_time_mmd.py b/examples/undocumented/python/graphical/statistics_quadratic_time_mmd.py index f70459583fe..1fc33ff41f6 100644 --- a/examples/undocumented/python/graphical/statistics_quadratic_time_mmd.py +++ b/examples/undocumented/python/graphical/statistics_quadratic_time_mmd.py @@ -10,13 +10,13 @@ from pylab import * from scipy import * -from modshogun import RealFeatures -from modshogun import MeanShiftDataGenerator -from modshogun import GaussianKernel, CombinedKernel -from modshogun import QuadraticTimeMMD, MMDKernelSelectionMax -from modshogun import PERMUTATION, MMD2_SPECTRUM, MMD2_GAMMA, BIASED, UNBIASED -from modshogun import EuclideanDistance -from modshogun import Statistics, Math +from shogun import RealFeatures +from shogun import MeanShiftDataGenerator +from shogun import GaussianKernel, CombinedKernel +from shogun import QuadraticTimeMMD, MMDKernelSelectionMax +from shogun import PERMUTATION, MMD2_SPECTRUM, MMD2_GAMMA, BIASED, UNBIASED +from shogun import EuclideanDistance +from shogun import Statistics, Math # for nice plotting that fits into our shogun tutorial import latex_plot_inits diff --git a/examples/undocumented/python/graphical/svm.py b/examples/undocumented/python/graphical/svm.py index 688aeea0637..9f6146fa259 100644 --- a/examples/undocumented/python/graphical/svm.py +++ b/examples/undocumented/python/graphical/svm.py @@ -1,6 +1,6 @@ from pylab import figure,pcolor,scatter,contour,colorbar,show,subplot,plot,connect,axis from numpy.random import randn -from modshogun import * +from shogun import * import util util.set_title('SVM') diff --git a/examples/undocumented/python/graphical/svmlin.py b/examples/undocumented/python/graphical/svmlin.py index 402edcdf85d..b380b7cf4ae 100644 --- a/examples/undocumented/python/graphical/svmlin.py +++ b/examples/undocumented/python/graphical/svmlin.py @@ -1,5 +1,5 @@ from pylab import figure,pcolor,scatter,contour,colorbar,show,subplot,plot,axis, connect -from modshogun import * +from shogun import * import util util.set_title('SVM Linear 1') diff --git a/examples/undocumented/python/graphical/svr_sinc.py b/examples/undocumented/python/graphical/svr_sinc.py index d1245f71aee..54ff5b96b3b 100644 --- a/examples/undocumented/python/graphical/svr_sinc.py +++ b/examples/undocumented/python/graphical/svr_sinc.py @@ -1,5 +1,5 @@ from pylab import figure,pcolor,scatter,contour,colorbar,show,subplot,plot,legend, connect -from modshogun import * +from shogun import * import util util.set_title('SVR on Sinus') diff --git a/examples/undocumented/python/graphical/util.py b/examples/undocumented/python/graphical/util.py index e4b749e014c..00bf51f917d 100644 --- a/examples/undocumented/python/graphical/util.py +++ b/examples/undocumented/python/graphical/util.py @@ -4,7 +4,7 @@ from numpy import ones, array, double, meshgrid, reshape, linspace, \ concatenate, ravel, pi, sinc from numpy.random import randn, rand -from modshogun import BinaryLabels, RegressionLabels, RealFeatures, SparseRealFeatures +from shogun import BinaryLabels, RegressionLabels, RealFeatures, SparseRealFeatures QUITKEY='q' NUM_EXAMPLES=100 diff --git a/examples/undocumented/python/kernel_anova.py b/examples/undocumented/python/kernel_anova.py index 8336fc2bc3d..e1ab024add1 100644 --- a/examples/undocumented/python/kernel_anova.py +++ b/examples/undocumented/python/kernel_anova.py @@ -4,7 +4,7 @@ parameter_list = [[traindat,testdat,2,10], [traindat,testdat,5,10]] def kernel_anova (train_fname=traindat,test_fname=testdat,cardinality=2, size_cache=10): - from modshogun import ANOVAKernel,RealFeatures,CSVFile + from shogun import ANOVAKernel,RealFeatures,CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_auc.py b/examples/undocumented/python/kernel_auc.py index 8594419bc4a..eb62666c13b 100644 --- a/examples/undocumented/python/kernel_auc.py +++ b/examples/undocumented/python/kernel_auc.py @@ -4,8 +4,8 @@ parameter_list = [[traindat,label_traindat,1.7], [traindat,label_traindat,1.6]] def kernel_auc (train_fname=traindat,label_fname=label_traindat,width=1.7): - from modshogun import GaussianKernel, AUCKernel, RealFeatures - from modshogun import BinaryLabels, CSVFile + from shogun import GaussianKernel, AUCKernel, RealFeatures + from shogun import BinaryLabels, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) subkernel=GaussianKernel(feats_train, feats_train, width) diff --git a/examples/undocumented/python/kernel_cauchy.py b/examples/undocumented/python/kernel_cauchy.py index 272bc041db4..10814ebf1eb 100644 --- a/examples/undocumented/python/kernel_cauchy.py +++ b/examples/undocumented/python/kernel_cauchy.py @@ -5,7 +5,7 @@ parameter_list=[[traindat,testdat, 1.0],[traindat,testdat, 10.0]] def kernel_cauchy (train_fname=traindat,test_fname=testdat, sigma=1.0): - from modshogun import RealFeatures, CauchyKernel, CSVFile, EuclideanDistance + from shogun import RealFeatures, CauchyKernel, CSVFile, EuclideanDistance feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_chi2.py b/examples/undocumented/python/kernel_chi2.py index 11f4eedee5d..95c4b4a62b8 100644 --- a/examples/undocumented/python/kernel_chi2.py +++ b/examples/undocumented/python/kernel_chi2.py @@ -5,7 +5,7 @@ parameter_list = [[traindat,testdat,1.4,10], [traindat,testdat,1.5,10]] def kernel_chi2 (train_fname=traindat,test_fname=testdat,width=1.4, size_cache=10): - from modshogun import RealFeatures, Chi2Kernel, CSVFile, NormOne + from shogun import RealFeatures, Chi2Kernel, CSVFile, NormOne feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_circular.py b/examples/undocumented/python/kernel_circular.py index cddc9452c2f..872a523c365 100644 --- a/examples/undocumented/python/kernel_circular.py +++ b/examples/undocumented/python/kernel_circular.py @@ -5,7 +5,7 @@ parameter_list=[[traindat,testdat, 1.0],[traindat,testdat, 5.0]] def kernel_circular(train_fname=traindat,test_fname=testdat, sigma=1.0): - from modshogun import RealFeatures, CircularKernel, EuclideanDistance, CSVFile + from shogun import RealFeatures, CircularKernel, EuclideanDistance, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_combined.py b/examples/undocumented/python/kernel_combined.py index a691e2f1011..50227811a12 100644 --- a/examples/undocumented/python/kernel_combined.py +++ b/examples/undocumented/python/kernel_combined.py @@ -10,8 +10,8 @@ parameter_list = [[traindat,testdat,traindna,testdna],[traindat,testdat,traindna,testdna]] def kernel_combined (fm_train_real=traindat,fm_test_real=testdat,fm_train_dna=traindna,fm_test_dna=testdna ): - from modshogun import CombinedKernel, GaussianKernel, FixedDegreeStringKernel, LocalAlignmentStringKernel - from modshogun import RealFeatures, StringCharFeatures, CombinedFeatures, DNA + from shogun import CombinedKernel, GaussianKernel, FixedDegreeStringKernel, LocalAlignmentStringKernel + from shogun import RealFeatures, StringCharFeatures, CombinedFeatures, DNA kernel=CombinedKernel() feats_train=CombinedFeatures() diff --git a/examples/undocumented/python/kernel_combined_custom_poly.py b/examples/undocumented/python/kernel_combined_custom_poly.py index c57f593858c..490f7fecac9 100644 --- a/examples/undocumented/python/kernel_combined_custom_poly.py +++ b/examples/undocumented/python/kernel_combined_custom_poly.py @@ -8,9 +8,9 @@ def kernel_combined_custom_poly (train_fname = traindat,test_fname = testdat,train_label_fname=label_traindat): - from modshogun import CombinedFeatures, RealFeatures, BinaryLabels - from modshogun import CombinedKernel, PolyKernel, CustomKernel - from modshogun import LibSVM, CSVFile + from shogun import CombinedFeatures, RealFeatures, BinaryLabels + from shogun import CombinedKernel, PolyKernel, CustomKernel + from shogun import LibSVM, CSVFile kernel = CombinedKernel() feats_train = CombinedFeatures() diff --git a/examples/undocumented/python/kernel_comm_ulong_string.py b/examples/undocumented/python/kernel_comm_ulong_string.py index 84db703ae5c..f6f04e45521 100644 --- a/examples/undocumented/python/kernel_comm_ulong_string.py +++ b/examples/undocumented/python/kernel_comm_ulong_string.py @@ -8,9 +8,9 @@ def kernel_comm_ulong_string (fm_train_dna=traindat,fm_test_dna=testdat, order=3, gap=0, reverse = False): - from modshogun import CommUlongStringKernel - from modshogun import StringUlongFeatures, StringCharFeatures, DNA - from modshogun import SortUlongString + from shogun import CommUlongStringKernel + from shogun import StringUlongFeatures, StringCharFeatures, DNA + from shogun import SortUlongString charfeat=StringCharFeatures(DNA) charfeat.set_features(fm_train_dna) diff --git a/examples/undocumented/python/kernel_comm_word_string.py b/examples/undocumented/python/kernel_comm_word_string.py index 683e6525f9e..8054abb9081 100644 --- a/examples/undocumented/python/kernel_comm_word_string.py +++ b/examples/undocumented/python/kernel_comm_word_string.py @@ -8,9 +8,9 @@ def kernel_comm_word_string (fm_train_dna=traindat, fm_test_dna=testdat, order=3, gap=0, reverse = False, use_sign = False): - from modshogun import CommWordStringKernel - from modshogun import StringWordFeatures, StringCharFeatures, DNA - from modshogun import SortWordString + from shogun import CommWordStringKernel + from shogun import StringWordFeatures, StringCharFeatures, DNA + from shogun import SortWordString charfeat=StringCharFeatures(DNA) charfeat.set_features(fm_train_dna) diff --git a/examples/undocumented/python/kernel_const.py b/examples/undocumented/python/kernel_const.py index 06e185204b0..5c3f0658df2 100644 --- a/examples/undocumented/python/kernel_const.py +++ b/examples/undocumented/python/kernel_const.py @@ -2,8 +2,8 @@ parameter_list =[[23],[24]] def kernel_const (c=23): - from modshogun import DummyFeatures - from modshogun import ConstKernel + from shogun import DummyFeatures + from shogun import ConstKernel feats_train=DummyFeatures(10) feats_test=DummyFeatures(17) diff --git a/examples/undocumented/python/kernel_custom.py b/examples/undocumented/python/kernel_custom.py index 1b1276424b1..c77d1017166 100644 --- a/examples/undocumented/python/kernel_custom.py +++ b/examples/undocumented/python/kernel_custom.py @@ -7,9 +7,9 @@ def kernel_custom (dim=7): from numpy.random import rand, seed from numpy import array, float32, int32 - from modshogun import RealFeatures - from modshogun import CustomKernel - from modshogun import IndexFeatures + from shogun import RealFeatures + from shogun import CustomKernel + from shogun import IndexFeatures seed(17) data=rand(dim, dim) diff --git a/examples/undocumented/python/kernel_diag.py b/examples/undocumented/python/kernel_diag.py index 8c038bc6215..6c24a4e9614 100644 --- a/examples/undocumented/python/kernel_diag.py +++ b/examples/undocumented/python/kernel_diag.py @@ -1,8 +1,8 @@ #!/usr/bin/env python parameter_list =[[23],[24]] def kernel_diag (diag=23): - from modshogun import DummyFeatures - from modshogun import DiagKernel + from shogun import DummyFeatures + from shogun import DiagKernel feats_train=DummyFeatures(10) feats_test=DummyFeatures(17) diff --git a/examples/undocumented/python/kernel_director_linear.py b/examples/undocumented/python/kernel_director_linear.py index b36fa5487bd..6892d7e9d24 100644 --- a/examples/undocumented/python/kernel_director_linear.py +++ b/examples/undocumented/python/kernel_director_linear.py @@ -1,13 +1,13 @@ #!/usr/bin/env python import numpy -from modshogun import RealFeatures, MSG_DEBUG +from shogun import RealFeatures, MSG_DEBUG traindat = numpy.random.random_sample((10,10)) testdat = numpy.random.random_sample((10,10)) parameter_list=[[traindat,testdat,1.2],[traindat,testdat,1.4]] def kernel_director_linear (fm_train_real=traindat,fm_test_real=testdat,scale=1.2): try: - from modshogun import DirectorKernel + from shogun import DirectorKernel except ImportError: print("recompile shogun with --enable-swig-directors") return @@ -21,8 +21,8 @@ def kernel_function(self, idx_a, idx_b): return numpy.dot(seq1, seq2) - from modshogun import LinearKernel, AvgDiagKernelNormalizer - from modshogun import Time + from shogun import LinearKernel, AvgDiagKernelNormalizer + from shogun import Time feats_train=RealFeatures(fm_train_real) #feats_train.io.set_loglevel(MSG_DEBUG) diff --git a/examples/undocumented/python/kernel_distance.py b/examples/undocumented/python/kernel_distance.py index e54efd4201e..29ce767eefa 100644 --- a/examples/undocumented/python/kernel_distance.py +++ b/examples/undocumented/python/kernel_distance.py @@ -5,7 +5,7 @@ parameter_list=[[traindat,testdat,1.7],[traindat,testdat,1.8]] def kernel_distance (train_fname=traindat,test_fname=testdat,width=1.7): - from modshogun import RealFeatures, DistanceKernel, EuclideanDistance, CSVFile + from shogun import RealFeatures, DistanceKernel, EuclideanDistance, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_distantsegments.py b/examples/undocumented/python/kernel_distantsegments.py index 7e50d76a363..082ec2f7fde 100644 --- a/examples/undocumented/python/kernel_distantsegments.py +++ b/examples/undocumented/python/kernel_distantsegments.py @@ -7,8 +7,8 @@ parameter_list = [[traindat,testdat,5,5],[traindat,testdat,6,6]] def kernel_distantsegments (fm_train_dna=traindat,fm_test_dna=testdat,delta=5, theta=5): - from modshogun import StringCharFeatures, DNA - from modshogun import DistantSegmentsKernel + from shogun import StringCharFeatures, DNA + from shogun import DistantSegmentsKernel feats_train=StringCharFeatures(fm_train_dna, DNA) feats_test=StringCharFeatures(fm_test_dna, DNA) diff --git a/examples/undocumented/python/kernel_exponential.py b/examples/undocumented/python/kernel_exponential.py index 0726f339f59..4bf809a8642 100644 --- a/examples/undocumented/python/kernel_exponential.py +++ b/examples/undocumented/python/kernel_exponential.py @@ -5,7 +5,7 @@ parameter_list=[[traindat,testdat, 1.0],[traindat,testdat, 5.0]] def kernel_exponential (train_fname=traindat,test_fname=testdat, tau_coef=1.0): - from modshogun import RealFeatures, ExponentialKernel, EuclideanDistance, CSVFile + from shogun import RealFeatures, ExponentialKernel, EuclideanDistance, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_fisher.py b/examples/undocumented/python/kernel_fisher.py index 10abaf60ee2..99a452e07ea 100644 --- a/examples/undocumented/python/kernel_fisher.py +++ b/examples/undocumented/python/kernel_fisher.py @@ -16,9 +16,9 @@ def kernel_fisher (fm_train_dna=traindat, fm_test_dna=testdat, N=1,M=4,pseudo=1e-1,order=1,gap=0,reverse=False, kargs=[1,False,True]): - from modshogun import StringCharFeatures, StringWordFeatures, FKFeatures, DNA - from modshogun import PolyKernel - from modshogun import HMM, BW_NORMAL#, MSG_DEBUG + from shogun import StringCharFeatures, StringWordFeatures, FKFeatures, DNA + from shogun import PolyKernel + from shogun import HMM, BW_NORMAL#, MSG_DEBUG # train HMM for positive class charfeat=StringCharFeatures(fm_hmm_pos, DNA) diff --git a/examples/undocumented/python/kernel_fixed_degree_string.py b/examples/undocumented/python/kernel_fixed_degree_string.py index 47cbad80399..51c8a5d42f0 100644 --- a/examples/undocumented/python/kernel_fixed_degree_string.py +++ b/examples/undocumented/python/kernel_fixed_degree_string.py @@ -7,8 +7,8 @@ parameter_list=[[traindat, testdat,3],[traindat,testdat,4]] def kernel_fixed_degree_string (fm_train_dna=traindat, fm_test_dna=testdat,degree=3): - from modshogun import StringCharFeatures, DNA - from modshogun import FixedDegreeStringKernel + from shogun import StringCharFeatures, DNA + from shogun import FixedDegreeStringKernel feats_train=StringCharFeatures(fm_train_dna, DNA) feats_test=StringCharFeatures(fm_test_dna, DNA) diff --git a/examples/undocumented/python/kernel_gaussian.py b/examples/undocumented/python/kernel_gaussian.py index c351ba9f389..181465ffe2d 100644 --- a/examples/undocumented/python/kernel_gaussian.py +++ b/examples/undocumented/python/kernel_gaussian.py @@ -5,7 +5,7 @@ parameter_list=[[traindat,testdat, 1.3],[traindat,testdat, 1.4]] def kernel_gaussian (train_fname=traindat,test_fname=testdat, width=1.3): - from modshogun import RealFeatures, GaussianKernel, CSVFile + from shogun import RealFeatures, GaussianKernel, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_gaussian_shift.py b/examples/undocumented/python/kernel_gaussian_shift.py index b848f29d0ac..460dd43bedb 100644 --- a/examples/undocumented/python/kernel_gaussian_shift.py +++ b/examples/undocumented/python/kernel_gaussian_shift.py @@ -8,7 +8,7 @@ parameter_list=[[traindat,testdat,1.8,2,1],[traindat,testdat,1.9,2,1]] def kernel_gaussian_shift (train_fname=traindat,test_fname=testdat,width=1.8,max_shift=2,shift_step=1): - from modshogun import RealFeatures, GaussianShiftKernel, CSVFile + from shogun import RealFeatures, GaussianShiftKernel, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_histogram_word_string.py b/examples/undocumented/python/kernel_histogram_word_string.py index 42644e6d14a..92b955b63e2 100644 --- a/examples/undocumented/python/kernel_histogram_word_string.py +++ b/examples/undocumented/python/kernel_histogram_word_string.py @@ -9,9 +9,9 @@ def kernel_histogram_word_string (fm_train_dna=traindat,fm_test_dna=testdat,label_train_dna=label_traindat,order=3,ppseudo_count=1,npseudo_count=1): - from modshogun import StringCharFeatures, StringWordFeatures, DNA, BinaryLabels - from modshogun import HistogramWordStringKernel, AvgDiagKernelNormalizer - from modshogun import PluginEstimate#, MSG_DEBUG + from shogun import StringCharFeatures, StringWordFeatures, DNA, BinaryLabels + from shogun import HistogramWordStringKernel, AvgDiagKernelNormalizer + from shogun import PluginEstimate#, MSG_DEBUG charfeat=StringCharFeatures(DNA) #charfeat.io.set_loglevel(MSG_DEBUG) diff --git a/examples/undocumented/python/kernel_inversemultiquadric.py b/examples/undocumented/python/kernel_inversemultiquadric.py index b45bad8292b..4efefd7f4e1 100644 --- a/examples/undocumented/python/kernel_inversemultiquadric.py +++ b/examples/undocumented/python/kernel_inversemultiquadric.py @@ -5,7 +5,7 @@ parameter_list=[[traindat,testdat, 1.0],[traindat,testdat, 5.0]] def kernel_inversemultiquadric (train_fname=traindat,test_fname=testdat, shift_coef=1.0): - from modshogun import RealFeatures, InverseMultiQuadricKernel, EuclideanDistance, CSVFile + from shogun import RealFeatures, InverseMultiQuadricKernel, EuclideanDistance, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_io.py b/examples/undocumented/python/kernel_io.py index 9aa9863e2ce..720cb738763 100644 --- a/examples/undocumented/python/kernel_io.py +++ b/examples/undocumented/python/kernel_io.py @@ -5,7 +5,7 @@ parameter_list=[[traindat,testdat,1.9],[traindat,testdat,1.7]] def kernel_io (train_fname=traindat,test_fname=testdat,width=1.9): - from modshogun import RealFeatures, GaussianKernel, CSVFile + from shogun import RealFeatures, GaussianKernel, CSVFile from tempfile import NamedTemporaryFile feats_train=RealFeatures(CSVFile(train_fname)) diff --git a/examples/undocumented/python/kernel_linear.py b/examples/undocumented/python/kernel_linear.py index 79cbbb6a5dd..2f668b453b4 100644 --- a/examples/undocumented/python/kernel_linear.py +++ b/examples/undocumented/python/kernel_linear.py @@ -6,7 +6,7 @@ def kernel_linear (train_fname=traindat,test_fname=testdat,scale=1.2): - from modshogun import RealFeatures, LinearKernel, AvgDiagKernelNormalizer, CSVFile + from shogun import RealFeatures, LinearKernel, AvgDiagKernelNormalizer, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_linear_byte.py b/examples/undocumented/python/kernel_linear_byte.py index 798872cb755..41ebbee28a9 100644 --- a/examples/undocumented/python/kernel_linear_byte.py +++ b/examples/undocumented/python/kernel_linear_byte.py @@ -5,7 +5,7 @@ parameter_list=[[traindat,testdat],[traindat,testdat]] def kernel_linear_byte (train_fname=traindat,test_fname=testdat): - from modshogun import LinearKernel, ByteFeatures, CSVFile + from shogun import LinearKernel, ByteFeatures, CSVFile feats_train=ByteFeatures(CSVFile(train_fname)) feats_test=ByteFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_linear_string.py b/examples/undocumented/python/kernel_linear_string.py index 9b9f143cf60..22eeb1d63ef 100644 --- a/examples/undocumented/python/kernel_linear_string.py +++ b/examples/undocumented/python/kernel_linear_string.py @@ -7,8 +7,8 @@ parameter_list=[[traindat,testdat],[traindat,testdat]] def kernel_linear_string (fm_train_dna=traindat,fm_test_dna=testdat): - from modshogun import StringCharFeatures, DNA - from modshogun import LinearStringKernel + from shogun import StringCharFeatures, DNA + from shogun import LinearStringKernel feats_train=StringCharFeatures(fm_train_dna, DNA) feats_test=StringCharFeatures(fm_test_dna, DNA) diff --git a/examples/undocumented/python/kernel_linear_word.py b/examples/undocumented/python/kernel_linear_word.py index bc1e2c917e8..1ac78017dd0 100644 --- a/examples/undocumented/python/kernel_linear_word.py +++ b/examples/undocumented/python/kernel_linear_word.py @@ -10,8 +10,8 @@ def kernel_linear_word (fm_train_word=traindat,fm_test_word=testdat,scale=1.2): - from modshogun import LinearKernel, AvgDiagKernelNormalizer - from modshogun import WordFeatures + from shogun import LinearKernel, AvgDiagKernelNormalizer + from shogun import WordFeatures feats_train=WordFeatures(fm_train_word) feats_test=WordFeatures(fm_test_word) diff --git a/examples/undocumented/python/kernel_local_alignment_string.py b/examples/undocumented/python/kernel_local_alignment_string.py index da0da5e5f1c..e2ab9aeb245 100644 --- a/examples/undocumented/python/kernel_local_alignment_string.py +++ b/examples/undocumented/python/kernel_local_alignment_string.py @@ -8,8 +8,8 @@ def kernel_local_alignment_string (fm_train_dna=traindat,fm_test_dna=testdat): - from modshogun import StringCharFeatures, DNA - from modshogun import LocalAlignmentStringKernel + from shogun import StringCharFeatures, DNA + from shogun import LocalAlignmentStringKernel feats_train=StringCharFeatures(fm_train_dna, DNA) feats_test=StringCharFeatures(fm_test_dna, DNA) diff --git a/examples/undocumented/python/kernel_locality_improved_string.py b/examples/undocumented/python/kernel_locality_improved_string.py index f885cabc2aa..95d01f499b0 100644 --- a/examples/undocumented/python/kernel_locality_improved_string.py +++ b/examples/undocumented/python/kernel_locality_improved_string.py @@ -8,8 +8,8 @@ def kernel_locality_improved_string (fm_train_dna=traindat,fm_test_dna=testdat,length=5,inner_degree=5,outer_degree=7): - from modshogun import StringCharFeatures, DNA - from modshogun import LocalityImprovedStringKernel + from shogun import StringCharFeatures, DNA + from shogun import LocalityImprovedStringKernel feats_train=StringCharFeatures(fm_train_dna, DNA) feats_test=StringCharFeatures(fm_test_dna, DNA) diff --git a/examples/undocumented/python/kernel_log.py b/examples/undocumented/python/kernel_log.py index 76d037f415f..3c6cc15f84b 100644 --- a/examples/undocumented/python/kernel_log.py +++ b/examples/undocumented/python/kernel_log.py @@ -5,7 +5,7 @@ parameter_list=[[traindat,testdat, 2.0],[traindat,testdat, 3.0]] def kernel_log (train_fname=traindat,test_fname=testdat, degree=2.0): - from modshogun import RealFeatures, LogKernel, EuclideanDistance, CSVFile + from shogun import RealFeatures, LogKernel, EuclideanDistance, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_match_word_string.py b/examples/undocumented/python/kernel_match_word_string.py index 9c7630fb18c..f7a81e02162 100644 --- a/examples/undocumented/python/kernel_match_word_string.py +++ b/examples/undocumented/python/kernel_match_word_string.py @@ -9,8 +9,8 @@ def kernel_match_word_string (fm_train_dna=traindat,fm_test_dna=testdat, degree=3,scale=1.4,size_cache=10,order=3,gap=0,reverse=False): - from modshogun import MatchWordStringKernel, AvgDiagKernelNormalizer - from modshogun import StringWordFeatures, StringCharFeatures, DNA + from shogun import MatchWordStringKernel, AvgDiagKernelNormalizer + from shogun import StringWordFeatures, StringCharFeatures, DNA charfeat=StringCharFeatures(fm_train_dna, DNA) feats_train=StringWordFeatures(DNA) diff --git a/examples/undocumented/python/kernel_multiquadric.py b/examples/undocumented/python/kernel_multiquadric.py index 6b0ffe038bf..f377e35ebc7 100644 --- a/examples/undocumented/python/kernel_multiquadric.py +++ b/examples/undocumented/python/kernel_multiquadric.py @@ -6,7 +6,7 @@ parameter_list=[[traindat,testdat, 1.0],[traindat,testdat, 5.0]] def kernel_multiquadric (train_fname=traindat,test_fname=testdat, shift_coef=1.0): - from modshogun import RealFeatures, MultiquadricKernel, EuclideanDistance, CSVFile + from shogun import RealFeatures, MultiquadricKernel, EuclideanDistance, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_oligo_string.py b/examples/undocumented/python/kernel_oligo_string.py index 7b09109bfdb..466a739ef0d 100644 --- a/examples/undocumented/python/kernel_oligo_string.py +++ b/examples/undocumented/python/kernel_oligo_string.py @@ -7,8 +7,8 @@ parameter_list = [[traindat,testdat,3,1.2,10],[traindat,testdat,4,1.3,10]] def kernel_oligo_string (fm_train_dna=traindat,fm_test_dna=testdat,k=3,width=1.2,size_cache=10): - from modshogun import StringCharFeatures, DNA - from modshogun import OligoStringKernel + from shogun import StringCharFeatures, DNA + from shogun import OligoStringKernel feats_train=StringCharFeatures(fm_train_dna, DNA) feats_test=StringCharFeatures(fm_test_dna, DNA) diff --git a/examples/undocumented/python/kernel_poly.py b/examples/undocumented/python/kernel_poly.py index d83bc583f3b..56b481a59be 100644 --- a/examples/undocumented/python/kernel_poly.py +++ b/examples/undocumented/python/kernel_poly.py @@ -6,7 +6,7 @@ def kernel_poly (train_fname=traindat,test_fname=testdat,degree=4,inhomogene=False, use_normalization=True): - from modshogun import RealFeatures, PolyKernel, CSVFile + from shogun import RealFeatures, PolyKernel, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_poly_match_string.py b/examples/undocumented/python/kernel_poly_match_string.py index a3a385e3035..2fc6bb0ce5a 100644 --- a/examples/undocumented/python/kernel_poly_match_string.py +++ b/examples/undocumented/python/kernel_poly_match_string.py @@ -6,8 +6,8 @@ parameter_list = [[traindat,testdat,3,False],[traindat,testdat,4,False]] def kernel_poly_match_string (fm_train_dna=traindat,fm_test_dna=testdat,degree=3,inhomogene=False): - from modshogun import PolyMatchStringKernel - from modshogun import StringCharFeatures, DNA + from shogun import PolyMatchStringKernel + from shogun import StringCharFeatures, DNA feats_train=StringCharFeatures(fm_train_dna, DNA) feats_test=StringCharFeatures(fm_train_dna, DNA) diff --git a/examples/undocumented/python/kernel_poly_match_word_string.py b/examples/undocumented/python/kernel_poly_match_word_string.py index 85c971f99d9..c2ac3017603 100644 --- a/examples/undocumented/python/kernel_poly_match_word_string.py +++ b/examples/undocumented/python/kernel_poly_match_word_string.py @@ -8,8 +8,8 @@ def kernel_poly_match_word_string (fm_train_dna=traindat,fm_test_dna=testdat, degree=2,inhomogene=True,order=3,gap=0,reverse=False): - from modshogun import PolyMatchWordStringKernel - from modshogun import StringWordFeatures, StringCharFeatures, DNA + from shogun import PolyMatchWordStringKernel + from shogun import StringWordFeatures, StringCharFeatures, DNA diff --git a/examples/undocumented/python/kernel_power.py b/examples/undocumented/python/kernel_power.py index de6e40f5cb5..52c7c471808 100644 --- a/examples/undocumented/python/kernel_power.py +++ b/examples/undocumented/python/kernel_power.py @@ -5,7 +5,7 @@ parameter_list=[[traindat,testdat, 2.0],[traindat,testdat, 3.0]] def kernel_power (train_fname=traindat,test_fname=testdat, degree=2.0): - from modshogun import RealFeatures, PowerKernel, EuclideanDistance, CSVFile + from shogun import RealFeatures, PowerKernel, EuclideanDistance, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_rationalquadratic.py b/examples/undocumented/python/kernel_rationalquadratic.py index 6c7b5fccd2f..f2e4a991c7a 100644 --- a/examples/undocumented/python/kernel_rationalquadratic.py +++ b/examples/undocumented/python/kernel_rationalquadratic.py @@ -5,7 +5,7 @@ parameter_list=[[traindat,testdat, 1.0],[traindat,testdat, 5.0]] def kernel_rationalquadratic (train_fname=traindat,test_fname=testdat, shift_coef=1.0): - from modshogun import RealFeatures, RationalQuadraticKernel, EuclideanDistance, CSVFile + from shogun import RealFeatures, RationalQuadraticKernel, EuclideanDistance, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_salzberg_word_string.py b/examples/undocumented/python/kernel_salzberg_word_string.py index b979b6f0bf8..88a4773896e 100644 --- a/examples/undocumented/python/kernel_salzberg_word_string.py +++ b/examples/undocumented/python/kernel_salzberg_word_string.py @@ -8,9 +8,9 @@ parameter_list = [[traindat,testdat,label_traindat,3,0,False],[traindat,testdat,label_traindat,3,0,False]] def kernel_salzberg_word_string (fm_train_dna=traindat,fm_test_dna=testdat,label_train_dna=label_traindat, order=3,gap=0,reverse=False): - from modshogun import StringCharFeatures, StringWordFeatures, DNA, BinaryLabels - from modshogun import SalzbergWordStringKernel - from modshogun import PluginEstimate + from shogun import StringCharFeatures, StringWordFeatures, DNA, BinaryLabels + from shogun import SalzbergWordStringKernel + from shogun import PluginEstimate charfeat=StringCharFeatures(fm_train_dna, DNA) feats_train=StringWordFeatures(charfeat.get_alphabet()) diff --git a/examples/undocumented/python/kernel_sigmoid.py b/examples/undocumented/python/kernel_sigmoid.py index 37586303dce..64ad32595ba 100644 --- a/examples/undocumented/python/kernel_sigmoid.py +++ b/examples/undocumented/python/kernel_sigmoid.py @@ -5,7 +5,7 @@ parameter_list = [[traindat,testdat,10,1.2,1.3],[traindat,testdat,10,1.2,1.3]] def kernel_sigmoid (train_fname=traindat,test_fname=testdat,size_cache=10,gamma=1.2,coef0=1.3): - from modshogun import RealFeatures, SigmoidKernel, CSVFile + from shogun import RealFeatures, SigmoidKernel, CSVFile feats_train=RealFeatures(CSVFile(train_fname)) feats_test=RealFeatures(CSVFile(test_fname)) diff --git a/examples/undocumented/python/kernel_simple_locality_improved_string.py b/examples/undocumented/python/kernel_simple_locality_improved_string.py index 66285167554..cd9e33053d8 100644 --- a/examples/undocumented/python/kernel_simple_locality_improved_string.py +++ b/examples/undocumented/python/kernel_simple_locality_improved_string.py @@ -9,8 +9,8 @@ def kernel_simple_locality_improved_string (fm_train_dna=traindat,fm_test_dna=testdat, length=5,inner_degree=5,outer_degree=1 ): - from modshogun import StringCharFeatures, DNA - from modshogun import SimpleLocalityImprovedStringKernel, MSG_DEBUG + from shogun import StringCharFeatures, DNA + from shogun import SimpleLocalityImprovedStringKernel, MSG_DEBUG feats_train=StringCharFeatures(fm_train_dna, DNA) #feats_train.io.set_loglevel(MSG_DEBUG) diff --git a/examples/undocumented/python/kernel_sparse_gaussian.py b/examples/undocumented/python/kernel_sparse_gaussian.py index e1b35f8ff1a..1ad4623d420 100644 --- a/examples/undocumented/python/kernel_sparse_gaussian.py +++ b/examples/undocumented/python/kernel_sparse_gaussian.py @@ -7,8 +7,8 @@ parameter_list = [[traindat,testdat,1.1],[traindat,testdat,1.2]] def kernel_sparse_gaussian (fm_train_real=traindat,fm_test_real=testdat,width=1.1 ): - from modshogun import SparseRealFeatures - from modshogun import GaussianKernel + from shogun import SparseRealFeatures + from shogun import GaussianKernel feats_train=SparseRealFeatures(fm_train_real) feats_test=SparseRealFeatures(fm_test_real) diff --git a/examples/undocumented/python/kernel_sparse_linear.py b/examples/undocumented/python/kernel_sparse_linear.py index 6989feba921..8ca21aa1831 100644 --- a/examples/undocumented/python/kernel_sparse_linear.py +++ b/examples/undocumented/python/kernel_sparse_linear.py @@ -8,8 +8,8 @@ parameter_list = [[traindat,testdat,1.1],[traindat,testdat,1.2]] def kernel_sparse_linear (fm_train_real=traindat,fm_test_real=testdat,scale=1.1): - from modshogun import SparseRealFeatures - from modshogun import LinearKernel, AvgDiagKernelNormalizer + from shogun import SparseRealFeatures + from shogun import LinearKernel, AvgDiagKernelNormalizer feats_train=SparseRealFeatures(fm_train_real) feats_test=SparseRealFeatures(fm_test_real) diff --git a/examples/undocumented/python/kernel_sparse_poly.py b/examples/undocumented/python/kernel_sparse_poly.py index 29e3ad2c540..b881012da50 100644 --- a/examples/undocumented/python/kernel_sparse_poly.py +++ b/examples/undocumented/python/kernel_sparse_poly.py @@ -9,8 +9,8 @@ def kernel_sparse_poly (fm_train_real=traindat,fm_test_real=testdat, size_cache=10,degree=3,inhomogene=True ): - from modshogun import SparseRealFeatures - from modshogun import PolyKernel + from shogun import SparseRealFeatures + from shogun import PolyKernel feats_train=SparseRealFeatures(fm_train_real) feats_test=SparseRealFeatures(fm_test_real) diff --git a/examples/undocumented/python/kernel_spherical.py b/examples/undocumented/python/kernel_spherical.py index e2d9f39161d..52a429e8a99 100644 --- a/examples/undocumented/python/kernel_spherical.py +++ b/examples/undocumented/python/kernel_spherical.py @@ -9,9 +9,9 @@ parameter_list=[[traindat,testdat, 1.0],[traindat,testdat, 5.0]] def kernel_spherical (fm_train_real=traindat,fm_test_real=testdat, sigma=1.0): - from modshogun import RealFeatures - from modshogun import MultiquadricKernel - from modshogun import EuclideanDistance + from shogun import RealFeatures + from shogun import MultiquadricKernel + from shogun import EuclideanDistance feats_train=RealFeatures(fm_train_real) feats_test=RealFeatures(fm_test_real) diff --git a/examples/undocumented/python/kernel_spline.py b/examples/undocumented/python/kernel_spline.py index 5c5785920a7..26aae43c802 100644 --- a/examples/undocumented/python/kernel_spline.py +++ b/examples/undocumented/python/kernel_spline.py @@ -9,8 +9,8 @@ parameter_list=[[traindat,testdat],[traindat,testdat]] def kernel_spline (fm_train_real=traindat,fm_test_real=testdat): - from modshogun import RealFeatures - from modshogun import SplineKernel + from shogun import RealFeatures + from shogun import SplineKernel feats_train=RealFeatures(fm_train_real) feats_test=RealFeatures(fm_test_real) diff --git a/examples/undocumented/python/kernel_ssk_string.py b/examples/undocumented/python/kernel_ssk_string.py index 3a19ca83c59..bfa5e28ed1a 100644 --- a/examples/undocumented/python/kernel_ssk_string.py +++ b/examples/undocumented/python/kernel_ssk_string.py @@ -18,8 +18,8 @@ parameter_list = [[traindat,testdat,2,0.75],[traindat,testdat,3,0.75]] def kernel_ssk_string (fm_train_dna=traindat, fm_test_dna=testdat, maxlen=1, decay=1): - from modshogun import SubsequenceStringKernel - from modshogun import StringCharFeatures, DNA + from shogun import SubsequenceStringKernel + from shogun import StringCharFeatures, DNA feats_train=StringCharFeatures(fm_train_dna, DNA) feats_test=StringCharFeatures(fm_test_dna, DNA) diff --git a/examples/undocumented/python/kernel_top.py b/examples/undocumented/python/kernel_top.py index cb5835f75ea..5f76324121e 100644 --- a/examples/undocumented/python/kernel_top.py +++ b/examples/undocumented/python/kernel_top.py @@ -15,9 +15,9 @@ def kernel_top (fm_train_dna=traindat,fm_test_dna=testdat,label_train_dna=label_traindat,pseudo=1e-1, order=1,gap=0,reverse=False,kargs=[1, False, True]): - from modshogun import StringCharFeatures, StringWordFeatures, TOPFeatures, DNA - from modshogun import PolyKernel - from modshogun import HMM, BW_NORMAL + from shogun import StringCharFeatures, StringWordFeatures, TOPFeatures, DNA + from shogun import PolyKernel + from shogun import HMM, BW_NORMAL N=1 # toy HMM with 1 state M=4 # 4 observations -> DNA diff --git a/examples/undocumented/python/kernel_tstudent.py b/examples/undocumented/python/kernel_tstudent.py index f3df33e1967..3cca9640459 100644 --- a/examples/undocumented/python/kernel_tstudent.py +++ b/examples/undocumented/python/kernel_tstudent.py @@ -9,9 +9,9 @@ parameter_list=[[traindat,testdat, 2.0],[traindat,testdat, 3.0]] def kernel_tstudent (fm_train_real=traindat,fm_test_real=testdat, degree=2.0): - from modshogun import RealFeatures - from modshogun import TStudentKernel - from modshogun import EuclideanDistance + from shogun import RealFeatures + from shogun import TStudentKernel + from shogun import EuclideanDistance feats_train=RealFeatures(fm_train_real) feats_test=RealFeatures(fm_test_real) diff --git a/examples/undocumented/python/kernel_wave.py b/examples/undocumented/python/kernel_wave.py index 3935711cbb3..accf91cbe96 100644 --- a/examples/undocumented/python/kernel_wave.py +++ b/examples/undocumented/python/kernel_wave.py @@ -9,9 +9,9 @@ parameter_list=[[traindat,testdat, 1.0],[traindat,testdat, 10.0]] def kernel_wave (fm_train_real=traindat,fm_test_real=testdat, theta=1.0): - from modshogun import RealFeatures - from modshogun import WaveKernel - from modshogun import EuclideanDistance + from shogun import RealFeatures + from shogun import WaveKernel + from shogun import EuclideanDistance feats_train=RealFeatures(fm_train_real) feats_test=RealFeatures(fm_test_real) diff --git a/examples/undocumented/python/kernel_wavelet.py b/examples/undocumented/python/kernel_wavelet.py index cf92ea7d384..f18df45b22b 100644 --- a/examples/undocumented/python/kernel_wavelet.py +++ b/examples/undocumented/python/kernel_wavelet.py @@ -9,8 +9,8 @@ parameter_list=[[traindat,testdat, 1.5, 1.0],[traindat,testdat, 1.0, 1.5]] def kernel_wavelet (fm_train_real=traindat,fm_test_real=testdat, dilation=1.5, translation=1.0): - from modshogun import RealFeatures - from modshogun import WaveletKernel + from shogun import RealFeatures + from shogun import WaveletKernel feats_train=RealFeatures(fm_train_real) feats_test=RealFeatures(fm_test_real) diff --git a/examples/undocumented/python/kernel_weighted_comm_word_string.py b/examples/undocumented/python/kernel_weighted_comm_word_string.py index 23d7d8bdf6e..763d4705b27 100644 --- a/examples/undocumented/python/kernel_weighted_comm_word_string.py +++ b/examples/undocumented/python/kernel_weighted_comm_word_string.py @@ -7,9 +7,9 @@ parameter_list = [[traindat,testdat],[traindat,testdat]] def kernel_weighted_comm_word_string (fm_train_dna=traindat,fm_test_dna=testdat,order=3,gap=0,reverse=True ): - from modshogun import WeightedCommWordStringKernel - from modshogun import StringWordFeatures, StringCharFeatures, DNA - from modshogun import SortWordString + from shogun import WeightedCommWordStringKernel + from shogun import StringWordFeatures, StringCharFeatures, DNA + from shogun import SortWordString charfeat=StringCharFeatures(fm_train_dna, DNA) feats_train=StringWordFeatures(charfeat.get_alphabet()) diff --git a/examples/undocumented/python/kernel_weighted_degree_position_string.py b/examples/undocumented/python/kernel_weighted_degree_position_string.py index f49e2c68c52..9c515b12ecf 100644 --- a/examples/undocumented/python/kernel_weighted_degree_position_string.py +++ b/examples/undocumented/python/kernel_weighted_degree_position_string.py @@ -7,8 +7,8 @@ parameter_list = [[traindat,testdat,20],[traindat,testdat,22]] def kernel_weighted_degree_position_string (fm_train_dna=traindat,fm_test_dna=testdat,degree=20): - from modshogun import StringCharFeatures, DNA - from modshogun import WeightedDegreePositionStringKernel, MSG_DEBUG + from shogun import StringCharFeatures, DNA + from shogun import WeightedDegreePositionStringKernel, MSG_DEBUG feats_train=StringCharFeatures(fm_train_dna, DNA) #feats_train.io.set_loglevel(MSG_DEBUG) diff --git a/examples/undocumented/python/kernel_weighted_degree_string.py b/examples/undocumented/python/kernel_weighted_degree_string.py index 60ea708ab21..96c131ceba0 100644 --- a/examples/undocumented/python/kernel_weighted_degree_string.py +++ b/examples/undocumented/python/kernel_weighted_degree_string.py @@ -7,8 +7,8 @@ parameter_list = [[traindat,testdat,3],[traindat,testdat,20]] def kernel_weighted_degree_string (fm_train_dna=traindat,fm_test_dna=testdat,degree=20): - from modshogun import StringCharFeatures, DNA - from modshogun import WeightedDegreeStringKernel, MSG_DEBUG + from shogun import StringCharFeatures, DNA + from shogun import WeightedDegreeStringKernel, MSG_DEBUG feats_train=StringCharFeatures(fm_train_dna, DNA) #feats_train.io.set_loglevel(MSG_DEBUG) diff --git a/examples/undocumented/python/labels_io.py b/examples/undocumented/python/labels_io.py index e88dc0fea81..b98179d0d6f 100644 --- a/examples/undocumented/python/labels_io.py +++ b/examples/undocumented/python/labels_io.py @@ -2,7 +2,7 @@ parameter_list=[[]] def labels_io(): - from modshogun import RegressionLabels, CSVFile + from shogun import RegressionLabels, CSVFile lab=RegressionLabels() f=CSVFile("../data/label_train_regression.dat","r") f.set_delimiter(" ") diff --git a/examples/undocumented/python/library_fisher2x3.py b/examples/undocumented/python/library_fisher2x3.py index a4c56f030e8..fc6de163164 100644 --- a/examples/undocumented/python/library_fisher2x3.py +++ b/examples/undocumented/python/library_fisher2x3.py @@ -1,6 +1,6 @@ #!/usr/bin/env python from numpy import * -from modshogun import * +from shogun import * x=array([[20.0,15,15],[10,20,20]]) y=array([[21.0,21,18],[19,19,22]]) diff --git a/examples/undocumented/python/library_time.py b/examples/undocumented/python/library_time.py index 58ef6ea6779..cf7fde8309e 100644 --- a/examples/undocumented/python/library_time.py +++ b/examples/undocumented/python/library_time.py @@ -1,6 +1,6 @@ #!/usr/bin/env python import time -from modshogun import Time +from shogun import Time parameter_list = [[5],[1.0]] def library_time (sleep_secs): diff --git a/examples/undocumented/python/mathematics_sparseinversecovariance.py b/examples/undocumented/python/mathematics_sparseinversecovariance.py index e047ece8fa7..3f82d661005 100644 --- a/examples/undocumented/python/mathematics_sparseinversecovariance.py +++ b/examples/undocumented/python/mathematics_sparseinversecovariance.py @@ -8,7 +8,7 @@ def mathematics_sparseinversecovariance (data,lc): try: - from modshogun import SparseInverseCovariance + from shogun import SparseInverseCovariance except ImportError: print("SparseInverseCovariance not available") exit(0) diff --git a/examples/undocumented/python/metric_lmnn.py b/examples/undocumented/python/metric_lmnn.py index eafb4e9b728..f9aa05d1184 100644 --- a/examples/undocumented/python/metric_lmnn.py +++ b/examples/undocumented/python/metric_lmnn.py @@ -8,7 +8,7 @@ def metric_lmnn(train_fname=traindat,test_fname=testdat,label_train_fname=label_traindat,k=3): try: - from modshogun import RealFeatures,MulticlassLabels,LMNN,KNN,CSVFile + from shogun import RealFeatures,MulticlassLabels,LMNN,KNN,CSVFile except ImportError: return diff --git a/examples/undocumented/python/mkl_binclass.py b/examples/undocumented/python/mkl_binclass.py index 1a72fbda3cb..c5211faa5e4 100644 --- a/examples/undocumented/python/mkl_binclass.py +++ b/examples/undocumented/python/mkl_binclass.py @@ -1,13 +1,13 @@ #!/usr/bin/env python -from modshogun import CombinedFeatures, RealFeatures, BinaryLabels -from modshogun import CombinedKernel, PolyKernel, CustomKernel -from modshogun import MKLClassification +from shogun import CombinedFeatures, RealFeatures, BinaryLabels +from shogun import CombinedKernel, PolyKernel, CustomKernel +from shogun import MKLClassification from tools.load import LoadMatrix lm=LoadMatrix() #only run example if SVMLight is included as LibSVM solver crashes in MKLClassification try: - from modshogun import SVMLight + from shogun import SVMLight except ImportError: print("SVMLight not available") exit(0) diff --git a/examples/undocumented/python/mkl_multiclass.py b/examples/undocumented/python/mkl_multiclass.py index 61df41ee970..d88cc7bdf58 100644 --- a/examples/undocumented/python/mkl_multiclass.py +++ b/examples/undocumented/python/mkl_multiclass.py @@ -12,9 +12,9 @@ def mkl_multiclass (fm_train_real, fm_test_real, label_train_multiclass, width, C, epsilon, num_threads, mkl_epsilon, mkl_norm): - from modshogun import CombinedFeatures, RealFeatures, MulticlassLabels - from modshogun import CombinedKernel, GaussianKernel, LinearKernel,PolyKernel - from modshogun import MKLMulticlass + from shogun import CombinedFeatures, RealFeatures, MulticlassLabels + from shogun import CombinedKernel, GaussianKernel, LinearKernel,PolyKernel + from shogun import MKLMulticlass kernel = CombinedKernel() feats_train = CombinedFeatures() diff --git a/examples/undocumented/python/modelselection_grid_search_kernel.py b/examples/undocumented/python/modelselection_grid_search_kernel.py index 6f41f34b28a..63caf4dddab 100644 --- a/examples/undocumented/python/modelselection_grid_search_kernel.py +++ b/examples/undocumented/python/modelselection_grid_search_kernel.py @@ -12,18 +12,18 @@ from numpy import random import math -from modshogun import CrossValidation, CrossValidationResult -from modshogun import ContingencyTableEvaluation, ACCURACY -from modshogun import StratifiedCrossValidationSplitting -from modshogun import BinaryLabels -from modshogun import RealFeatures -from modshogun import GaussianKernel, PowerKernel -from modshogun import LibSVM -from modshogun import MinkowskiMetric -from modshogun import GridSearchModelSelection -from modshogun import ModelSelectionParameters, R_EXP, R_LINEAR -from modshogun import ParameterCombination -from modshogun import Math +from shogun import CrossValidation, CrossValidationResult +from shogun import ContingencyTableEvaluation, ACCURACY +from shogun import StratifiedCrossValidationSplitting +from shogun import BinaryLabels +from shogun import RealFeatures +from shogun import GaussianKernel, PowerKernel +from shogun import LibSVM +from shogun import MinkowskiMetric +from shogun import GridSearchModelSelection +from shogun import ModelSelectionParameters, R_EXP, R_LINEAR +from shogun import ParameterCombination +from shogun import Math def create_param_tree(): root=ModelSelectionParameters() diff --git a/examples/undocumented/python/modelselection_grid_search_krr.py b/examples/undocumented/python/modelselection_grid_search_krr.py index 64f9ec3cc00..dd673c53ede 100644 --- a/examples/undocumented/python/modelselection_grid_search_krr.py +++ b/examples/undocumented/python/modelselection_grid_search_krr.py @@ -24,14 +24,14 @@ def modelselection_grid_search_krr (fm_train=traindat,fm_test=testdat,label_train=label_traindat,\ width=2.1,C=1,epsilon=1e-5,tube_epsilon=1e-2): - from modshogun import CrossValidation, CrossValidationResult - from modshogun import MeanSquaredError - from modshogun import CrossValidationSplitting - from modshogun import RegressionLabels - from modshogun import RealFeatures - from modshogun import KernelRidgeRegression - from modshogun import GridSearchModelSelection - from modshogun import ModelSelectionParameters + from shogun import CrossValidation, CrossValidationResult + from shogun import MeanSquaredError + from shogun import CrossValidationSplitting + from shogun import RegressionLabels + from shogun import RealFeatures + from shogun import KernelRidgeRegression + from shogun import GridSearchModelSelection + from shogun import ModelSelectionParameters # training data features_train=RealFeatures(traindat) @@ -91,9 +91,9 @@ def modelselection_grid_search_krr (fm_train=traindat,fm_test=testdat,label_trai # creates all the parameters to optimize def create_param_tree(): - from modshogun import ModelSelectionParameters, R_EXP, R_LINEAR - from modshogun import ParameterCombination - from modshogun import GaussianKernel, PolyKernel + from shogun import ModelSelectionParameters, R_EXP, R_LINEAR + from shogun import ParameterCombination + from shogun import GaussianKernel, PolyKernel import math root=ModelSelectionParameters() diff --git a/examples/undocumented/python/modelselection_grid_search_liblinear.py b/examples/undocumented/python/modelselection_grid_search_liblinear.py index 89788dc25e3..dd267c97f32 100644 --- a/examples/undocumented/python/modelselection_grid_search_liblinear.py +++ b/examples/undocumented/python/modelselection_grid_search_liblinear.py @@ -22,15 +22,15 @@ parameter_list = [[traindat,label_traindat]] def modelselection_grid_search_liblinear (traindat=traindat, label_traindat=label_traindat): - from modshogun import CrossValidation, CrossValidationResult - from modshogun import ContingencyTableEvaluation, ACCURACY - from modshogun import StratifiedCrossValidationSplitting - from modshogun import GridSearchModelSelection - from modshogun import ModelSelectionParameters, R_EXP - from modshogun import ParameterCombination - from modshogun import BinaryLabels - from modshogun import RealFeatures - from modshogun import LibLinear, L2R_L2LOSS_SVC + from shogun import CrossValidation, CrossValidationResult + from shogun import ContingencyTableEvaluation, ACCURACY + from shogun import StratifiedCrossValidationSplitting + from shogun import GridSearchModelSelection + from shogun import ModelSelectionParameters, R_EXP + from shogun import ParameterCombination + from shogun import BinaryLabels + from shogun import RealFeatures + from shogun import LibLinear, L2R_L2LOSS_SVC # build parameter tree to select C1 and C2 param_tree_root=ModelSelectionParameters() diff --git a/examples/undocumented/python/modelselection_grid_search_libsvr.py b/examples/undocumented/python/modelselection_grid_search_libsvr.py index 5fc5b9e9e16..deaf18a7495 100644 --- a/examples/undocumented/python/modelselection_grid_search_libsvr.py +++ b/examples/undocumented/python/modelselection_grid_search_libsvr.py @@ -24,16 +24,16 @@ def modelselection_grid_search_libsvr (fm_train=traindat,fm_test=testdat,label_train=label_traindat,\ width=2.1,C=1,epsilon=1e-5,tube_epsilon=1e-2): - from modshogun import CrossValidation, CrossValidationResult - from modshogun import MeanSquaredError - from modshogun import CrossValidationSplitting - from modshogun import RegressionLabels - from modshogun import RealFeatures - from modshogun import GaussianKernel - from modshogun import LibSVR - from modshogun import GridSearchModelSelection - from modshogun import ModelSelectionParameters, R_EXP - from modshogun import ParameterCombination + from shogun import CrossValidation, CrossValidationResult + from shogun import MeanSquaredError + from shogun import CrossValidationSplitting + from shogun import RegressionLabels + from shogun import RealFeatures + from shogun import GaussianKernel + from shogun import LibSVR + from shogun import GridSearchModelSelection + from shogun import ModelSelectionParameters, R_EXP + from shogun import ParameterCombination # training data features_train=RealFeatures(traindat) diff --git a/examples/undocumented/python/modelselection_parameter_tree.py b/examples/undocumented/python/modelselection_parameter_tree.py index f756a86af04..d1b221bbdb8 100644 --- a/examples/undocumented/python/modelselection_parameter_tree.py +++ b/examples/undocumented/python/modelselection_parameter_tree.py @@ -12,12 +12,12 @@ parameter_list=[[None]] def modelselection_parameter_tree (dummy): - from modshogun import ParameterCombination - from modshogun import ModelSelectionParameters, R_EXP, R_LINEAR - from modshogun import PowerKernel - from modshogun import GaussianKernel - from modshogun import DistantSegmentsKernel - from modshogun import MinkowskiMetric + from shogun import ParameterCombination + from shogun import ModelSelectionParameters, R_EXP, R_LINEAR + from shogun import PowerKernel + from shogun import GaussianKernel + from shogun import DistantSegmentsKernel + from shogun import MinkowskiMetric import math root=ModelSelectionParameters() diff --git a/examples/undocumented/python/modelselection_random_search_liblinear.py b/examples/undocumented/python/modelselection_random_search_liblinear.py index 466637ce245..3eef55e44ba 100644 --- a/examples/undocumented/python/modelselection_random_search_liblinear.py +++ b/examples/undocumented/python/modelselection_random_search_liblinear.py @@ -20,15 +20,15 @@ parameter_list = [[traindat,label_traindat]] def modelselection_random_search_liblinear (traindat=traindat, label_traindat=label_traindat): - from modshogun import CrossValidation, CrossValidationResult - from modshogun import ContingencyTableEvaluation, ACCURACY - from modshogun import StratifiedCrossValidationSplitting - from modshogun import RandomSearchModelSelection - from modshogun import ModelSelectionParameters, R_EXP - from modshogun import ParameterCombination - from modshogun import BinaryLabels - from modshogun import RealFeatures - from modshogun import LibLinear, L2R_L2LOSS_SVC + from shogun import CrossValidation, CrossValidationResult + from shogun import ContingencyTableEvaluation, ACCURACY + from shogun import StratifiedCrossValidationSplitting + from shogun import RandomSearchModelSelection + from shogun import ModelSelectionParameters, R_EXP + from shogun import ParameterCombination + from shogun import BinaryLabels + from shogun import RealFeatures + from shogun import LibLinear, L2R_L2LOSS_SVC # build parameter tree to select C1 and C2 param_tree_root=ModelSelectionParameters() diff --git a/examples/undocumented/python/multiclass_c45classifiertree.py b/examples/undocumented/python/multiclass_c45classifiertree.py index a6364e4c6f1..aca26ef09b3 100644 --- a/examples/undocumented/python/multiclass_c45classifiertree.py +++ b/examples/undocumented/python/multiclass_c45classifiertree.py @@ -12,7 +12,7 @@ def multiclass_c45classifiertree(train=traindat,test=testdat,labels=label_traindat,ft=feattypes): try: - from modshogun import RealFeatures, MulticlassLabels, CSVFile, C45ClassifierTree + from shogun import RealFeatures, MulticlassLabels, CSVFile, C45ClassifierTree from numpy import random, int32 except ImportError: print("Could not import Shogun and/or numpy modules") diff --git a/examples/undocumented/python/multiclass_id3classifiertree.py b/examples/undocumented/python/multiclass_id3classifiertree.py index e9fcccafd13..58f7cb0ed74 100644 --- a/examples/undocumented/python/multiclass_id3classifiertree.py +++ b/examples/undocumented/python/multiclass_id3classifiertree.py @@ -18,7 +18,7 @@ def multiclass_id3classifiertree(train=train_data,labels=train_labels,test=test_data): try: - from modshogun import RealFeatures, MulticlassLabels, ID3ClassifierTree + from shogun import RealFeatures, MulticlassLabels, ID3ClassifierTree except ImportError: return diff --git a/examples/undocumented/python/multiclass_randomforest.py b/examples/undocumented/python/multiclass_randomforest.py index b1c91c1a582..a110b58e739 100644 --- a/examples/undocumented/python/multiclass_randomforest.py +++ b/examples/undocumented/python/multiclass_randomforest.py @@ -12,7 +12,7 @@ def multiclass_randomforest(train=traindat,test=testdat,labels=label_traindat,ft=feattypes): try: - from modshogun import RealFeatures, MulticlassLabels, CSVFile, RandomForest, MajorityVote + from shogun import RealFeatures, MulticlassLabels, CSVFile, RandomForest, MajorityVote except ImportError: print("Could not import Shogun modules") return diff --git a/examples/undocumented/python/preprocessor_dimensionreductionpreprocessor.py b/examples/undocumented/python/preprocessor_dimensionreductionpreprocessor.py index 27ff5f23506..577def4dc9a 100644 --- a/examples/undocumented/python/preprocessor_dimensionreductionpreprocessor.py +++ b/examples/undocumented/python/preprocessor_dimensionreductionpreprocessor.py @@ -7,10 +7,10 @@ parameter_list = [[data, 20], [data, 30]] def preprocessor_dimensionreductionpreprocessor (data, k): - from modshogun import RealFeatures - from modshogun import DimensionReductionPreprocessor + from shogun import RealFeatures + from shogun import DimensionReductionPreprocessor try: - from modshogun import LocallyLinearEmbedding + from shogun import LocallyLinearEmbedding except ImportError: print("LocallyLinearEmbedding not available") exit(0) diff --git a/examples/undocumented/python/preprocessor_fisherlda.py b/examples/undocumented/python/preprocessor_fisherlda.py index af6fc69790c..5ff12da25dd 100644 --- a/examples/undocumented/python/preprocessor_fisherlda.py +++ b/examples/undocumented/python/preprocessor_fisherlda.py @@ -1,6 +1,6 @@ #!/usr/bin/env python from tools.load import LoadMatrix -from modshogun import * +from shogun import * lm=LoadMatrix() @@ -10,9 +10,9 @@ parameter_list = [[data, labels, CANVAR_FLDA], [data, labels, CLASSIC_FLDA]] def preprocessor_fisherlda (data, labels, method): - from modshogun import RealFeatures, MulticlassLabels, CANVAR_FLDA - from modshogun import FisherLda - from modshogun import MulticlassLabels + from shogun import RealFeatures, MulticlassLabels, CANVAR_FLDA + from shogun import FisherLda + from shogun import MulticlassLabels sg_features = RealFeatures(data) sg_labels = MulticlassLabels(labels) diff --git a/examples/undocumented/python/preprocessor_kernelpca.py b/examples/undocumented/python/preprocessor_kernelpca.py index 7484a33298b..40905167fb2 100644 --- a/examples/undocumented/python/preprocessor_kernelpca.py +++ b/examples/undocumented/python/preprocessor_kernelpca.py @@ -7,9 +7,9 @@ parameter_list = [[data, 0.01, 1.0], [data, 0.05, 2.0]] def preprocessor_kernelpca (data, threshold, width): - from modshogun import RealFeatures - from modshogun import KernelPCA - from modshogun import GaussianKernel + from shogun import RealFeatures + from shogun import KernelPCA + from shogun import GaussianKernel features = RealFeatures(data) diff --git a/examples/undocumented/python/preprocessor_logplusone.py b/examples/undocumented/python/preprocessor_logplusone.py index ebe72278f35..11115edac6b 100644 --- a/examples/undocumented/python/preprocessor_logplusone.py +++ b/examples/undocumented/python/preprocessor_logplusone.py @@ -9,9 +9,9 @@ def preprocessor_logplusone (fm_train_real=traindat,fm_test_real=testdat,width=1.4,size_cache=10): - from modshogun import Chi2Kernel - from modshogun import RealFeatures - from modshogun import LogPlusOne + from shogun import Chi2Kernel + from shogun import RealFeatures + from shogun import LogPlusOne feats_train=RealFeatures(fm_train_real) feats_test=RealFeatures(fm_test_real) diff --git a/examples/undocumented/python/preprocessor_normone.py b/examples/undocumented/python/preprocessor_normone.py index 93483fb034c..24afe917cdd 100644 --- a/examples/undocumented/python/preprocessor_normone.py +++ b/examples/undocumented/python/preprocessor_normone.py @@ -9,9 +9,9 @@ def preprocessor_normone (fm_train_real=traindat,fm_test_real=testdat,width=1.4,size_cache=10): - from modshogun import Chi2Kernel - from modshogun import RealFeatures - from modshogun import NormOne + from shogun import Chi2Kernel + from shogun import RealFeatures + from shogun import NormOne feats_train=RealFeatures(fm_train_real) feats_test=RealFeatures(fm_test_real) diff --git a/examples/undocumented/python/preprocessor_pca.py b/examples/undocumented/python/preprocessor_pca.py index e0f69258786..23149502390 100644 --- a/examples/undocumented/python/preprocessor_pca.py +++ b/examples/undocumented/python/preprocessor_pca.py @@ -7,8 +7,8 @@ parameter_list = [[data]] def preprocessor_pca (data): - from modshogun import RealFeatures - from modshogun import PCA + from shogun import RealFeatures + from shogun import PCA features = RealFeatures(data) diff --git a/examples/undocumented/python/preprocessor_prunevarsubmean.py b/examples/undocumented/python/preprocessor_prunevarsubmean.py index 1dc4e8e500a..91bcc0376a4 100644 --- a/examples/undocumented/python/preprocessor_prunevarsubmean.py +++ b/examples/undocumented/python/preprocessor_prunevarsubmean.py @@ -8,9 +8,9 @@ parameter_list = [[traindat,testdat,1.5,10],[traindat,testdat,1.5,10]] def preprocessor_prunevarsubmean (fm_train_real=traindat,fm_test_real=testdat,width=1.4,size_cache=10): - from modshogun import Chi2Kernel - from modshogun import RealFeatures - from modshogun import PruneVarSubMean + from shogun import Chi2Kernel + from shogun import RealFeatures + from shogun import PruneVarSubMean feats_train=RealFeatures(fm_train_real) feats_test=RealFeatures(fm_test_real) diff --git a/examples/undocumented/python/preprocessor_randomfouriergausspreproc.py b/examples/undocumented/python/preprocessor_randomfouriergausspreproc.py index 9d608381abc..f1e9a0dc656 100644 --- a/examples/undocumented/python/preprocessor_randomfouriergausspreproc.py +++ b/examples/undocumented/python/preprocessor_randomfouriergausspreproc.py @@ -7,13 +7,13 @@ parameter_list = [[traindat,testdat,1.5,10],[traindat,testdat,1.5,10]] -from modshogun import Math_init_random; +from shogun import Math_init_random; Math_init_random(12345); def preprocessor_randomfouriergausspreproc (fm_train_real=traindat,fm_test_real=testdat,width=1.4,size_cache=10): - from modshogun import Chi2Kernel - from modshogun import RealFeatures - from modshogun import RandomFourierGaussPreproc + from shogun import Chi2Kernel + from shogun import RealFeatures + from shogun import RandomFourierGaussPreproc feats_train=RealFeatures(fm_train_real) feats_test=RealFeatures(fm_test_real) diff --git a/examples/undocumented/python/preprocessor_sortulongstring.py b/examples/undocumented/python/preprocessor_sortulongstring.py index 364845c401d..4b817b2996f 100644 --- a/examples/undocumented/python/preprocessor_sortulongstring.py +++ b/examples/undocumented/python/preprocessor_sortulongstring.py @@ -9,9 +9,9 @@ def preprocessor_sortulongstring (fm_train_dna=traindna,fm_test_dna=testdna,order=3,gap=0,reverse=False,use_sign=False): - from modshogun import CommUlongStringKernel - from modshogun import StringCharFeatures, StringUlongFeatures, DNA - from modshogun import SortUlongString + from shogun import CommUlongStringKernel + from shogun import StringCharFeatures, StringUlongFeatures, DNA + from shogun import SortUlongString charfeat=StringCharFeatures(DNA) diff --git a/examples/undocumented/python/preprocessor_sortwordstring.py b/examples/undocumented/python/preprocessor_sortwordstring.py index a99c175bd30..231d334298a 100644 --- a/examples/undocumented/python/preprocessor_sortwordstring.py +++ b/examples/undocumented/python/preprocessor_sortwordstring.py @@ -9,9 +9,9 @@ def preprocessor_sortwordstring (fm_train_dna=traindna,fm_test_dna=testdna,order=3,gap=0,reverse=False,use_sign=False): - from modshogun import CommWordStringKernel - from modshogun import StringCharFeatures, StringWordFeatures, DNA - from modshogun import SortWordString + from shogun import CommWordStringKernel + from shogun import StringCharFeatures, StringWordFeatures, DNA + from shogun import SortWordString charfeat=StringCharFeatures(fm_train_dna, DNA) feats_train=StringWordFeatures(charfeat.get_alphabet()) diff --git a/examples/undocumented/python/regression_cartree.py b/examples/undocumented/python/regression_cartree.py index b478b9db637..ad89191af11 100644 --- a/examples/undocumented/python/regression_cartree.py +++ b/examples/undocumented/python/regression_cartree.py @@ -8,7 +8,7 @@ def regression_cartree(num_train=500,num_test=50,x_range=15,noise_var=0.2,ft=feattypes): try: - from modshogun import RealFeatures, RegressionLabels, CSVFile, CARTree, PT_REGRESSION + from shogun import RealFeatures, RegressionLabels, CSVFile, CARTree, PT_REGRESSION from numpy import random except ImportError: print("Could not import Shogun and/or numpy modules") diff --git a/examples/undocumented/python/regression_chaidtree.py b/examples/undocumented/python/regression_chaidtree.py index 02dd22f906b..60b7f883ca6 100644 --- a/examples/undocumented/python/regression_chaidtree.py +++ b/examples/undocumented/python/regression_chaidtree.py @@ -8,7 +8,7 @@ def regression_chaidtree(num_train=500,num_test=50,x_range=15,noise_var=0.2,ft=feattypes): try: - from modshogun import RealFeatures, RegressionLabels, CSVFile, CHAIDTree, PT_REGRESSION + from shogun import RealFeatures, RegressionLabels, CSVFile, CHAIDTree, PT_REGRESSION from numpy import random except ImportError: print("Could not import Shogun and/or numpy modules") diff --git a/examples/undocumented/python/regression_randomforest.py b/examples/undocumented/python/regression_randomforest.py index 7dce6cd4db7..acfc0d2073e 100644 --- a/examples/undocumented/python/regression_randomforest.py +++ b/examples/undocumented/python/regression_randomforest.py @@ -12,7 +12,7 @@ def regression_randomforest(num_train=500,num_test=50,x_range=15,noise_var=0.2,ft=feattypes): try: - from modshogun import RealFeatures, RegressionLabels, CSVFile, RandomForest, MeanRule, PT_REGRESSION + from shogun import RealFeatures, RegressionLabels, CSVFile, RandomForest, MeanRule, PT_REGRESSION except ImportError: print("Could not import Shogun modules") return diff --git a/examples/undocumented/python/regression_svrlight.py b/examples/undocumented/python/regression_svrlight.py index 3be9f624af9..e9126fc8c7d 100644 --- a/examples/undocumented/python/regression_svrlight.py +++ b/examples/undocumented/python/regression_svrlight.py @@ -17,10 +17,10 @@ def regression_svrlight (fm_train=traindat,fm_test=testdat,label_train=label_tra width=1.2,C=1,epsilon=1e-5,tube_epsilon=1e-2,num_threads=3): - from modshogun import RegressionLabels, RealFeatures - from modshogun import GaussianKernel + from shogun import RegressionLabels, RealFeatures + from shogun import GaussianKernel try: - from modshogun import SVRLight + from shogun import SVRLight except ImportError: print('No support for SVRLight available.') return diff --git a/examples/undocumented/python/serialization_complex_example.py b/examples/undocumented/python/serialization_complex_example.py index 56ec37e6f68..33966a40452 100644 --- a/examples/undocumented/python/serialization_complex_example.py +++ b/examples/undocumented/python/serialization_complex_example.py @@ -9,12 +9,12 @@ def serialization_complex_example (num=5, dist=1, dim=10, C=2.0, width=10): import os from numpy import concatenate, zeros, ones from numpy.random import randn, seed - from modshogun import RealFeatures, MulticlassLabels - from modshogun import GMNPSVM - from modshogun import GaussianKernel - from modshogun import SerializableHdf5File,SerializableAsciiFile, \ + from shogun import RealFeatures, MulticlassLabels + from shogun import GMNPSVM + from shogun import GaussianKernel + from shogun import SerializableHdf5File,SerializableAsciiFile, \ SerializableJsonFile,SerializableXmlFile,MSG_DEBUG - from modshogun import NormOne, LogPlusOne + from shogun import NormOne, LogPlusOne from tempfile import NamedTemporaryFile seed(17) diff --git a/examples/undocumented/python/serialization_matrix.py b/examples/undocumented/python/serialization_matrix.py index 3e946b8feda..6d6be7ea5b3 100644 --- a/examples/undocumented/python/serialization_matrix.py +++ b/examples/undocumented/python/serialization_matrix.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from modshogun import * +from shogun import * from numpy import array parameter_list=[[[[1.0,2,3],[4,5,6]]]] diff --git a/examples/undocumented/python/serialization_string_kernels.py b/examples/undocumented/python/serialization_string_kernels.py index 3116006290c..9971b8532b8 100644 --- a/examples/undocumented/python/serialization_string_kernels.py +++ b/examples/undocumented/python/serialization_string_kernels.py @@ -1,17 +1,17 @@ #!/usr/bin/env python -from modshogun import WeightedDegreeStringKernel, LinearKernel, PolyKernel, GaussianKernel, CTaxonomy -from modshogun import CombinedKernel, WeightedDegreeRBFKernel -from modshogun import StringCharFeatures, RealFeatures, CombinedFeatures, StringWordFeatures, SortWordString -from modshogun import DNA, PROTEIN, Labels -from modshogun import WeightedDegreeStringKernel, CombinedKernel, WeightedCommWordStringKernel, WeightedDegreePositionStringKernel -from modshogun import StringCharFeatures, DNA, StringWordFeatures, CombinedFeatures - -from modshogun import MSG_DEBUG -from modshogun import RealFeatures, BinaryLabels, DNA, Alphabet -from modshogun import WeightedDegreeStringKernel, GaussianKernel +from shogun import WeightedDegreeStringKernel, LinearKernel, PolyKernel, GaussianKernel, CTaxonomy +from shogun import CombinedKernel, WeightedDegreeRBFKernel +from shogun import StringCharFeatures, RealFeatures, CombinedFeatures, StringWordFeatures, SortWordString +from shogun import DNA, PROTEIN, Labels +from shogun import WeightedDegreeStringKernel, CombinedKernel, WeightedCommWordStringKernel, WeightedDegreePositionStringKernel +from shogun import StringCharFeatures, DNA, StringWordFeatures, CombinedFeatures + +from shogun import MSG_DEBUG +from shogun import RealFeatures, BinaryLabels, DNA, Alphabet +from shogun import WeightedDegreeStringKernel, GaussianKernel try: - from modshogun import SVMLight + from shogun import SVMLight except ImportError: print("SVMLight is not available") exit(0) diff --git a/examples/undocumented/python/serialization_svmlight.py b/examples/undocumented/python/serialization_svmlight.py index 0db71cd698c..f130c61a071 100644 --- a/examples/undocumented/python/serialization_svmlight.py +++ b/examples/undocumented/python/serialization_svmlight.py @@ -2,11 +2,11 @@ parameter_list=[[10, 1, 2.1, 2.0]] def serialization_svmlight (num, dist, width, C): - from modshogun import MSG_DEBUG - from modshogun import RealFeatures, BinaryLabels, DNA, Alphabet - from modshogun import WeightedDegreeStringKernel, GaussianKernel + from shogun import MSG_DEBUG + from shogun import RealFeatures, BinaryLabels, DNA, Alphabet + from shogun import WeightedDegreeStringKernel, GaussianKernel try: - from modshogun import SVMLight + from shogun import SVMLight except ImportError: print("SVMLight not available") exit(0) diff --git a/examples/undocumented/python/so_multiclass.py b/examples/undocumented/python/so_multiclass.py index 4923ea553c8..b6ba20bd0a9 100644 --- a/examples/undocumented/python/so_multiclass.py +++ b/examples/undocumented/python/so_multiclass.py @@ -26,8 +26,8 @@ def gen_data(num_classes,num_samples,dim): def so_multiclass (fm_train_real=traindat,label_train_multiclass=label_traindat): try: - from modshogun import RealFeatures - from modshogun import MulticlassModel, MulticlassSOLabels, PrimalMosekSOSVM, RealNumber + from shogun import RealFeatures + from shogun import MulticlassModel, MulticlassSOLabels, PrimalMosekSOSVM, RealNumber except ImportError: print("Mosek not available") return diff --git a/examples/undocumented/python/stochasticgbmachine.py b/examples/undocumented/python/stochasticgbmachine.py index 5fbd12b74ec..dae5d67ffce 100644 --- a/examples/undocumented/python/stochasticgbmachine.py +++ b/examples/undocumented/python/stochasticgbmachine.py @@ -11,7 +11,7 @@ def stochasticgbmachine(train=traindat,train_labels=label_traindat,ft=feat_types): try: - from modshogun import RealFeatures, RegressionLabels, CSVFile, CARTree, StochasticGBMachine, SquaredLoss + from shogun import RealFeatures, RegressionLabels, CSVFile, CARTree, StochasticGBMachine, SquaredLoss except ImportError: print("Could not import Shogun modules") return diff --git a/examples/undocumented/python/streaming_vw.py b/examples/undocumented/python/streaming_vw.py index e93ac0ed3d6..8e21dbdbccb 100644 --- a/examples/undocumented/python/streaming_vw.py +++ b/examples/undocumented/python/streaming_vw.py @@ -1,8 +1,8 @@ #!/usr/bin/env python -from modshogun import StreamingVwFile -from modshogun import T_SVMLIGHT -from modshogun import StreamingVwFeatures -from modshogun import VowpalWabbit +from shogun import StreamingVwFile +from shogun import T_SVMLIGHT +from shogun import StreamingVwFeatures +from shogun import VowpalWabbit parameter_list=[[None]] diff --git a/examples/undocumented/python/streaming_vw_createcache.py b/examples/undocumented/python/streaming_vw_createcache.py index ae28748603a..2404f0350b7 100644 --- a/examples/undocumented/python/streaming_vw_createcache.py +++ b/examples/undocumented/python/streaming_vw_createcache.py @@ -1,9 +1,9 @@ #!/usr/bin/env python -from modshogun import StreamingVwFile -from modshogun import StreamingVwCacheFile -from modshogun import T_SVMLIGHT -from modshogun import StreamingVwFeatures -from modshogun import VowpalWabbit +from shogun import StreamingVwFile +from shogun import StreamingVwCacheFile +from shogun import T_SVMLIGHT +from shogun import StreamingVwFeatures +from shogun import VowpalWabbit parameter_list=[['../data/fm_train_sparsereal.dat']] diff --git a/examples/undocumented/python/structure_discrete_hmsvm_bmrm.py b/examples/undocumented/python/structure_discrete_hmsvm_bmrm.py index 9fee3bd2826..59cf961f4b8 100644 --- a/examples/undocumented/python/structure_discrete_hmsvm_bmrm.py +++ b/examples/undocumented/python/structure_discrete_hmsvm_bmrm.py @@ -9,10 +9,10 @@ parameter_list=[[data_dict]] def structure_discrete_hmsvm_bmrm (m_data_dict=data_dict): - from modshogun import RealMatrixFeatures, SequenceLabels, HMSVMModel, Sequence, TwoStateModel - from modshogun import StructuredAccuracy, SMT_TWO_STATE + from shogun import RealMatrixFeatures, SequenceLabels, HMSVMModel, Sequence, TwoStateModel + from shogun import StructuredAccuracy, SMT_TWO_STATE try: - from modshogun import DualLibQPBMSOSVM + from shogun import DualLibQPBMSOSVM except ImportError: print("DualLibQPBMSOSVM not available") exit(0) diff --git a/examples/undocumented/python/structure_discrete_hmsvm_mosek.py b/examples/undocumented/python/structure_discrete_hmsvm_mosek.py index 14cecf439bf..47ac6e4b161 100644 --- a/examples/undocumented/python/structure_discrete_hmsvm_mosek.py +++ b/examples/undocumented/python/structure_discrete_hmsvm_mosek.py @@ -9,11 +9,11 @@ parameter_list=[[data_dict]] def structure_discrete_hmsvm_mosek (m_data_dict=data_dict): - from modshogun import RealMatrixFeatures, SequenceLabels, HMSVMModel, Sequence, TwoStateModel - from modshogun import StructuredAccuracy, SMT_TWO_STATE + from shogun import RealMatrixFeatures, SequenceLabels, HMSVMModel, Sequence, TwoStateModel + from shogun import StructuredAccuracy, SMT_TWO_STATE try: - from modshogun import PrimalMosekSOSVM + from shogun import PrimalMosekSOSVM except ImportError: print("Mosek not available") return diff --git a/examples/undocumented/python/structure_dynprog.py b/examples/undocumented/python/structure_dynprog.py index b0cb2f13036..e97ddbf5954 100644 --- a/examples/undocumented/python/structure_dynprog.py +++ b/examples/undocumented/python/structure_dynprog.py @@ -4,7 +4,7 @@ parameter_list=[['../data/DynProg_example_py.pickle.gz']] -from modshogun import * +from shogun import * import numpy from numpy import array,Inf,float64,matrix,frompyfunc,zeros diff --git a/examples/undocumented/python/structure_factor_graph_model.py b/examples/undocumented/python/structure_factor_graph_model.py index 2c37f7582cc..face601195c 100644 --- a/examples/undocumented/python/structure_factor_graph_model.py +++ b/examples/undocumented/python/structure_factor_graph_model.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import numpy as np -from modshogun import TableFactorType +from shogun import TableFactorType # create the factor type with GT parameters tid = 0 @@ -20,10 +20,10 @@ fac_type_b = TableFactorType(tid_b, cards_b, w_gt_b) def gen_data(ftype, num_samples, show_data = False): - from modshogun import Math - from modshogun import FactorType, Factor, TableFactorType, FactorGraph - from modshogun import FactorGraphObservation, FactorGraphLabels, FactorGraphFeatures - from modshogun import MAPInference, TREE_MAX_PROD + from shogun import Math + from shogun import FactorType, Factor, TableFactorType, FactorGraph + from shogun import FactorGraphObservation, FactorGraphLabels, FactorGraphFeatures + from shogun import MAPInference, TREE_MAX_PROD Math.init_random(17) @@ -95,11 +95,11 @@ def gen_data(ftype, num_samples, show_data = False): parameter_list = [[samples,labels,w_all,ftype_all]] def structure_factor_graph_model(tr_samples = samples, tr_labels = labels, w = w_all, ftype = ftype_all): - from modshogun import SOSVMHelper, LabelsFactory - from modshogun import FactorGraphModel, MAPInference, TREE_MAX_PROD - from modshogun import StochasticSOSVM, FWSOSVM + from shogun import SOSVMHelper, LabelsFactory + from shogun import FactorGraphModel, MAPInference, TREE_MAX_PROD + from shogun import StochasticSOSVM, FWSOSVM try: - from modshogun import DualLibQPBMSOSVM + from shogun import DualLibQPBMSOSVM except ImportError: print("DualLibQPBMSOSVM not available") exit(0) diff --git a/examples/undocumented/python/structure_graphcuts.py b/examples/undocumented/python/structure_graphcuts.py index 3615f90c6e8..59174ea05a1 100644 --- a/examples/undocumented/python/structure_graphcuts.py +++ b/examples/undocumented/python/structure_graphcuts.py @@ -3,11 +3,11 @@ import numpy as np import itertools -from modshogun import Factor, TableFactorType, FactorGraph -from modshogun import FactorGraphObservation, FactorGraphLabels, FactorGraphFeatures -from modshogun import FactorGraphModel, GRAPH_CUT -from modshogun import GraphCut -from modshogun import StochasticSOSVM +from shogun import Factor, TableFactorType, FactorGraph +from shogun import FactorGraphObservation, FactorGraphLabels, FactorGraphFeatures +from shogun import FactorGraphModel, GRAPH_CUT +from shogun import GraphCut +from shogun import StochasticSOSVM def generate_data(num_train_samples, len_label, len_feat): """ Generate synthetic dataset diff --git a/examples/undocumented/python/structure_hierarchical_multilabel_classification.py b/examples/undocumented/python/structure_hierarchical_multilabel_classification.py index 05392a2fab1..05c3e70e3ee 100644 --- a/examples/undocumented/python/structure_hierarchical_multilabel_classification.py +++ b/examples/undocumented/python/structure_hierarchical_multilabel_classification.py @@ -7,10 +7,10 @@ http://kt.ijs.si/DragiKocev/PhD/resources/doku.php?id=hmc_classification#imageclef07d """ -from modshogun import MultilabelSOLabels, HierarchicalMultilabelModel -from modshogun import RealFeatures -from modshogun import StochasticSOSVM -from modshogun import StructuredAccuracy, LabelsFactory +from shogun import MultilabelSOLabels, HierarchicalMultilabelModel +from shogun import RealFeatures +from shogun import StochasticSOSVM +from shogun import StructuredAccuracy, LabelsFactory import numpy as np import time diff --git a/examples/undocumented/python/structure_multiclass_bmrm.py b/examples/undocumented/python/structure_multiclass_bmrm.py index 1a293763b79..d7dbd034a47 100644 --- a/examples/undocumented/python/structure_multiclass_bmrm.py +++ b/examples/undocumented/python/structure_multiclass_bmrm.py @@ -25,15 +25,15 @@ def gen_data(num_classes,num_samples,dim): parameter_list = [[traindat,label_traindat]] def structure_multiclass_bmrm(fm_train_real=traindat,label_train_multiclass=label_traindat): - from modshogun import MulticlassSOLabels, LabelsFactory - from modshogun import RealFeatures - from modshogun import SOSVMHelper + from shogun import MulticlassSOLabels, LabelsFactory + from shogun import RealFeatures + from shogun import SOSVMHelper try: - from modshogun import BMRM, PPBMRM, P3BMRM, DualLibQPBMSOSVM + from shogun import BMRM, PPBMRM, P3BMRM, DualLibQPBMSOSVM except ImportError: print("At least one of BMRM, PPBMRM, P3BMRM, DualLibQPBMSOSVM not available") exit(0) - from modshogun import MulticlassModel, RealNumber + from shogun import MulticlassModel, RealNumber labels = MulticlassSOLabels(label_train_multiclass) features = RealFeatures(fm_train_real.T) diff --git a/examples/undocumented/python/structure_plif_hmsvm_bmrm.py b/examples/undocumented/python/structure_plif_hmsvm_bmrm.py index 91822d366a6..bd7542607a0 100644 --- a/examples/undocumented/python/structure_plif_hmsvm_bmrm.py +++ b/examples/undocumented/python/structure_plif_hmsvm_bmrm.py @@ -3,9 +3,9 @@ parameter_list=[[50, 125, 10, 2]] def structure_plif_hmsvm_bmrm (num_examples, example_length, num_features, num_noise_features): - from modshogun import RealMatrixFeatures, TwoStateModel, StructuredAccuracy + from shogun import RealMatrixFeatures, TwoStateModel, StructuredAccuracy try: - from modshogun import DualLibQPBMSOSVM + from shogun import DualLibQPBMSOSVM except ImportError: print("DualLibQPBMSOSVM not available") exit(0) diff --git a/examples/undocumented/python/structure_plif_hmsvm_mosek.py b/examples/undocumented/python/structure_plif_hmsvm_mosek.py index 2ef2e0dc40c..8e918f08512 100644 --- a/examples/undocumented/python/structure_plif_hmsvm_mosek.py +++ b/examples/undocumented/python/structure_plif_hmsvm_mosek.py @@ -3,10 +3,10 @@ parameter_list=[[100, 250, 10, 2]] def structure_plif_hmsvm_mosek (num_examples, example_length, num_features, num_noise_features): - from modshogun import RealMatrixFeatures, TwoStateModel, StructuredAccuracy + from shogun import RealMatrixFeatures, TwoStateModel, StructuredAccuracy try: - from modshogun import PrimalMosekSOSVM + from shogun import PrimalMosekSOSVM except ImportError: print("Mosek not available") return diff --git a/examples/undocumented/python/tests_check_commwordkernel_memleak.py b/examples/undocumented/python/tests_check_commwordkernel_memleak.py index 1ecced84692..5da5b8b07df 100644 --- a/examples/undocumented/python/tests_check_commwordkernel_memleak.py +++ b/examples/undocumented/python/tests_check_commwordkernel_memleak.py @@ -3,9 +3,9 @@ def tests_check_commwordkernel_memleak (num, order, gap, reverse): import gc - from modshogun import Alphabet,StringCharFeatures,StringWordFeatures,DNA - from modshogun import SortWordString, MSG_DEBUG - from modshogun import CommWordStringKernel, IdentityKernelNormalizer + from shogun import Alphabet,StringCharFeatures,StringWordFeatures,DNA + from shogun import SortWordString, MSG_DEBUG + from shogun import CommWordStringKernel, IdentityKernelNormalizer from numpy import mat POS=[num*'ACGT', num*'ACGT', num*'ACGT',num*'ACGT', num*'ACGT', diff --git a/examples/undocumented/python/transfer_multitask_clustered_logistic_regression.py b/examples/undocumented/python/transfer_multitask_clustered_logistic_regression.py index 87ac204ab44..e3dc8b2a64b 100644 --- a/examples/undocumented/python/transfer_multitask_clustered_logistic_regression.py +++ b/examples/undocumented/python/transfer_multitask_clustered_logistic_regression.py @@ -11,9 +11,9 @@ parameter_list = [[traindat,testdat,label_traindat]] def transfer_multitask_clustered_logistic_regression (fm_train=traindat,fm_test=testdat,label_train=label_traindat): - from modshogun import BinaryLabels, RealFeatures, Task, TaskGroup, MSG_DEBUG + from shogun import BinaryLabels, RealFeatures, Task, TaskGroup, MSG_DEBUG try: - from modshogun import MultitaskClusteredLogisticRegression + from shogun import MultitaskClusteredLogisticRegression except ImportError: print("MultitaskClusteredLogisticRegression not available") exit() diff --git a/examples/undocumented/python/transfer_multitask_l12_logistic_regression.py b/examples/undocumented/python/transfer_multitask_l12_logistic_regression.py index 56c7c84e57b..22c47c0c2f8 100644 --- a/examples/undocumented/python/transfer_multitask_l12_logistic_regression.py +++ b/examples/undocumented/python/transfer_multitask_l12_logistic_regression.py @@ -11,9 +11,9 @@ parameter_list = [[traindat,testdat,label_traindat]] def transfer_multitask_l12_logistic_regression (fm_train=traindat,fm_test=testdat,label_train=label_traindat): - from modshogun import BinaryLabels, RealFeatures, Task, TaskGroup + from shogun import BinaryLabels, RealFeatures, Task, TaskGroup try: - from modshogun import MultitaskL12LogisticRegression + from shogun import MultitaskL12LogisticRegression except ImportError: print("MultitaskL12LogisticRegression not available") exit(0) diff --git a/examples/undocumented/python/transfer_multitask_leastsquares_regression.py b/examples/undocumented/python/transfer_multitask_leastsquares_regression.py index 8ec07e61d5c..1b1357d96a5 100644 --- a/examples/undocumented/python/transfer_multitask_leastsquares_regression.py +++ b/examples/undocumented/python/transfer_multitask_leastsquares_regression.py @@ -11,9 +11,9 @@ parameter_list = [[traindat,testdat,label_traindat]] def transfer_multitask_leastsquares_regression (fm_train=traindat,fm_test=testdat,label_train=label_traindat): - from modshogun import RegressionLabels, RealFeatures, Task, TaskGroup + from shogun import RegressionLabels, RealFeatures, Task, TaskGroup try: - from modshogun import MultitaskLeastSquaresRegression + from shogun import MultitaskLeastSquaresRegression except ImportError: print("MultitaskLeastSquaresRegression not available") exit(0) diff --git a/examples/undocumented/python/transfer_multitask_logistic_regression.py b/examples/undocumented/python/transfer_multitask_logistic_regression.py index d475cb7757f..5c97b6f6a2d 100644 --- a/examples/undocumented/python/transfer_multitask_logistic_regression.py +++ b/examples/undocumented/python/transfer_multitask_logistic_regression.py @@ -11,9 +11,9 @@ parameter_list = [[traindat,testdat,label_traindat]] def transfer_multitask_logistic_regression (fm_train=traindat,fm_test=testdat,label_train=label_traindat): - from modshogun import BinaryLabels, RealFeatures, Task, TaskGroup + from shogun import BinaryLabels, RealFeatures, Task, TaskGroup try: - from modshogun import MultitaskLogisticRegression + from shogun import MultitaskLogisticRegression except ImportError: print("MultitaskLogisticRegression not available") exit() diff --git a/examples/undocumented/python/transfer_multitask_trace_logistic_regression.py b/examples/undocumented/python/transfer_multitask_trace_logistic_regression.py index a128a969cbf..c72912dd63a 100644 --- a/examples/undocumented/python/transfer_multitask_trace_logistic_regression.py +++ b/examples/undocumented/python/transfer_multitask_trace_logistic_regression.py @@ -11,9 +11,9 @@ parameter_list = [[traindat,testdat,label_traindat]] def transfer_multitask_trace_logistic_regression (fm_train=traindat,fm_test=testdat,label_train=label_traindat): - from modshogun import BinaryLabels, RealFeatures, Task, TaskGroup + from shogun import BinaryLabels, RealFeatures, Task, TaskGroup try: - from modshogun import MultitaskTraceLogisticRegression + from shogun import MultitaskTraceLogisticRegression except ImportError: print("MultitaskTraceLogisticRegression not available") exit(0) diff --git a/examples/undocumented/python/variational_classifier.py b/examples/undocumented/python/variational_classifier.py index c7a6dc327f8..7461d660b24 100644 --- a/examples/undocumented/python/variational_classifier.py +++ b/examples/undocumented/python/variational_classifier.py @@ -37,12 +37,12 @@ label_binary_traindat = '%s/label_train_twoclass.dat'%path try: - from modshogun import GaussianProcessClassification + from shogun import GaussianProcessClassification except ImportError: print("GaussianProcessClassification is not available") exit(0) -from modshogun import * +from shogun import * parameter_list=[ [KLCholeskyInferenceMethod,traindat,testdat,label_binary_traindat,0,0,1e-5,1e-2,0], [KLCovarianceInferenceMethod,traindat,testdat,label_binary_traindat,0,0,1e-5,1e-2,0], diff --git a/setup.py b/setup.py index 3739e4df857..389f78e3f64 100644 --- a/setup.py +++ b/setup.py @@ -243,12 +243,12 @@ def shogun_package_directories(): def shogun_data_files(): data_files = list() libshogun_files = glob.glob(os.path.join(shogun_generated_install, 'lib/libshogun*')) - modshogun_so_destination = os.path.join('lib', python_package_path(shogun_python_packages_location)) - modshogun_so_file = glob.glob(os.path.join(shogun_python_packages_location, '_modshogun.so'))[0] + shogun_so_destination = os.path.join('lib', python_package_path(shogun_python_packages_location)) + shogun_so_file = glob.glob(os.path.join(shogun_python_packages_location, '_shogun.so'))[0] # appending data files data_files.append(('lib', libshogun_files)) - data_files.append((modshogun_so_destination, [modshogun_so_file])) + data_files.append((shogun_so_destination, [shogun_so_file])) if show_debug_information: print('Shogun Python package data files:') @@ -335,7 +335,7 @@ def run(self): # Shogun package content packages = shogun_packages(), package_dir = shogun_package_directories(), - py_modules =['modshogun'], + py_modules =['shogun'], data_files = shogun_data_files(), # Shogun dependencies diff --git a/src/.r-install.sh b/src/.r-install.sh index 2c3f97912bf..887deb61fcd 100755 --- a/src/.r-install.sh +++ b/src/.r-install.sh @@ -129,7 +129,7 @@ else echo "Installing modular shogun interface for R" cat >"$1/$2/NAMESPACE" <"$1/$2/R/$2" <