public StreamingWordFeatures(WordFeatures simple_features) : this(modshogunPINVOKE.new_StreamingWordFeatures__SWIG_3(WordFeatures.getCPtr(simple_features)), true) { if (modshogunPINVOKE.SWIGPendingException.Pending) { throw modshogunPINVOKE.SWIGPendingException.Retrieve(); } }
public WordFeatures(WordFeatures orig) : this(modshogunPINVOKE.new_WordFeatures__SWIG_2(WordFeatures.getCPtr(orig)), true) { if (modshogunPINVOKE.SWIGPendingException.Pending) { throw modshogunPINVOKE.SWIGPendingException.Retrieve(); } }
public StreamingWordFeatures(WordFeatures simple_features, SWIGTYPE_p_double lab) : this(modshogunPINVOKE.new_StreamingWordFeatures__SWIG_2(WordFeatures.getCPtr(simple_features), SWIGTYPE_p_double.getCPtr(lab)), true) { if (modshogunPINVOKE.SWIGPendingException.Pending) { throw modshogunPINVOKE.SWIGPendingException.Retrieve(); } }
public void set_motif_positions(WordFeatures positions_lhs, WordFeatures positions_rhs) { modshogunPINVOKE.RegulatoryModulesStringKernel_set_motif_positions(swigCPtr, WordFeatures.getCPtr(positions_lhs), WordFeatures.getCPtr(positions_rhs)); if (modshogunPINVOKE.SWIGPendingException.Pending) { throw modshogunPINVOKE.SWIGPendingException.Retrieve(); } }
public bool obtain_from_simple(WordFeatures sf) { bool ret = modshogunPINVOKE.SparseWordFeatures_obtain_from_simple(swigCPtr, WordFeatures.getCPtr(sf)); if (modshogunPINVOKE.SWIGPendingException.Pending) { throw modshogunPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public WordFeatures get_transposed() { IntPtr cPtr = modshogunPINVOKE.WordFeatures_get_transposed(swigCPtr); WordFeatures ret = (cPtr == IntPtr.Zero) ? null : new WordFeatures(cPtr, true); if (modshogunPINVOKE.SWIGPendingException.Pending) { throw modshogunPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public static void Main() { modshogun.init_shogun_with_defaults(); double scale = 1.2; double[,] traindata_real = Load.load_numbers("../data/fm_train_word.dat"); double[,] testdata_real = Load.load_numbers("../data/fm_test_word.dat"); short[,] traindata_word = new short[traindata_real.GetLength(0), traindata_real.GetLength(1)]; for (int i = 0; i < traindata_real.GetLength(0); i++) { for (int j = 0; j < traindata_real.GetLength(1); j++) { traindata_word[i, j] = (short)traindata_real[i, j]; } } short[,] testdata_word = new short[testdata_real.GetLength(0), testdata_real.GetLength(1)]; for (int i = 0; i < testdata_real.GetLength(0); i++) { for (int j = 0; j < testdata_real.GetLength(1); j++) { testdata_word[i, j] = (short)testdata_real[i, j]; } } WordFeatures feats_train = new WordFeatures(traindata_word); WordFeatures feats_test = new WordFeatures(testdata_word); LinearKernel kernel = new LinearKernel(feats_train, feats_test); kernel.set_normalizer(new AvgDiagKernelNormalizer(scale)); kernel.init(feats_train, feats_train); double[,] km_train = kernel.get_kernel_matrix(); kernel.init(feats_train, feats_test); double[,] km_test = kernel.get_kernel_matrix(); foreach (double item in km_train) { Console.Write(item); } foreach (double item in km_test) { Console.Write(item); } modshogun.exit_shogun(); }
public static void Main() { modshogun.init_shogun_with_defaults(); double scale = 1.2; double[,] traindata_real = Load.load_numbers("../data/fm_train_word.dat"); double[,] testdata_real = Load.load_numbers("../data/fm_test_word.dat"); short[,] traindata_word = new short[traindata_real.GetLength(0), traindata_real.GetLength(1)]; for (int i = 0; i < traindata_real.GetLength(0); i++){ for (int j = 0; j < traindata_real.GetLength(1); j++) traindata_word[i, j] = (short)traindata_real[i, j]; } short[,] testdata_word = new short[testdata_real.GetLength(0), testdata_real.GetLength(1)]; for (int i = 0; i < testdata_real.GetLength(0); i++){ for (int j = 0; j < testdata_real.GetLength(1); j++) testdata_word[i, j] = (short)testdata_real[i, j]; } WordFeatures feats_train = new WordFeatures(traindata_word); WordFeatures feats_test = new WordFeatures(testdata_word); LinearKernel kernel = new LinearKernel(feats_train, feats_test); kernel.set_normalizer(new AvgDiagKernelNormalizer(scale)); kernel.init(feats_train, feats_train); double[,] km_train = kernel.get_kernel_matrix(); kernel.init(feats_train, feats_test); double[,] km_test = kernel.get_kernel_matrix(); foreach(double item in km_train) { Console.Write(item); } foreach(double item in km_test) { Console.Write(item); } modshogun.exit_shogun(); }
static void Main(string[] argv) { modshogun.init_shogun_with_defaults(); double scale = 1.2; DoubleMatrix traindata_real = Load.load_numbers("../data/fm_train_word.dat"); DoubleMatrix testdata_real = Load.load_numbers("../data/fm_test_word.dat"); WordFeatures feats_train = new WordFeatures(traindata_real); WordFeatures feats_test = new WordFeatures(testdata_real); LinearKernel kernel = new LinearKernel(feats_train, feats_test); kernel.set_normalizer(new AvgDiagKernelNormalizer(scale)); kernel.init(feats_train, feats_train); DoubleMatrix km_train = kernel.get_kernel_matrix(); kernel.init(feats_train, feats_test); DoubleMatrix km_test = kernel.get_kernel_matrix(); Console.WriteLine(km_train.ToString()); Console.WriteLine(km_test.ToString()); modshogun.exit_shogun(); }
public void set_motif_positions(WordFeatures positions_lhs, WordFeatures positions_rhs) { modshogunPINVOKE.RegulatoryModulesStringKernel_set_motif_positions(swigCPtr, WordFeatures.getCPtr(positions_lhs), WordFeatures.getCPtr(positions_rhs)); if (modshogunPINVOKE.SWIGPendingException.Pending) throw modshogunPINVOKE.SWIGPendingException.Retrieve(); }
public WordFeatures(WordFeatures orig) : this(modshogunPINVOKE.new_WordFeatures__SWIG_2(WordFeatures.getCPtr(orig)), true) { if (modshogunPINVOKE.SWIGPendingException.Pending) throw modshogunPINVOKE.SWIGPendingException.Retrieve(); }
internal static HandleRef getCPtr(WordFeatures obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
public StreamingWordFeatures(WordFeatures simple_features, SWIGTYPE_p_double lab) : this(modshogunPINVOKE.new_StreamingWordFeatures__SWIG_2(WordFeatures.getCPtr(simple_features), SWIGTYPE_p_double.getCPtr(lab)), true) { if (modshogunPINVOKE.SWIGPendingException.Pending) throw modshogunPINVOKE.SWIGPendingException.Retrieve(); }
public StreamingWordFeatures(WordFeatures simple_features) : this(modshogunPINVOKE.new_StreamingWordFeatures__SWIG_3(WordFeatures.getCPtr(simple_features)), true) { if (modshogunPINVOKE.SWIGPendingException.Pending) throw modshogunPINVOKE.SWIGPendingException.Retrieve(); }
internal static HandleRef getCPtr(WordFeatures obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }
public RegulatoryModulesStringKernel(StringCharFeatures lstr, StringCharFeatures rstr, WordFeatures lpos, WordFeatures rpos, double width, int degree, int shift, int window) : this(modshogunPINVOKE.new_RegulatoryModulesStringKernel__SWIG_3(StringCharFeatures.getCPtr(lstr), StringCharFeatures.getCPtr(rstr), WordFeatures.getCPtr(lpos), WordFeatures.getCPtr(rpos), width, degree, shift, window), true) { if (modshogunPINVOKE.SWIGPendingException.Pending) { throw modshogunPINVOKE.SWIGPendingException.Retrieve(); } }
public RegulatoryModulesStringKernel(StringCharFeatures lstr, StringCharFeatures rstr, WordFeatures lpos, WordFeatures rpos, double width, int degree, int shift, int window) : this(modshogunPINVOKE.new_RegulatoryModulesStringKernel__SWIG_3(StringCharFeatures.getCPtr(lstr), StringCharFeatures.getCPtr(rstr), WordFeatures.getCPtr(lpos), WordFeatures.getCPtr(rpos), width, degree, shift, window), true) { if (modshogunPINVOKE.SWIGPendingException.Pending) throw modshogunPINVOKE.SWIGPendingException.Retrieve(); }