Skip to content

Commit

Permalink
Example/kernel oligo string (#5081)
Browse files Browse the repository at this point in the history
* Add oligo string kernel meta example.
  • Loading branch information
Hephaestus12 authored Jun 26, 2020
1 parent 8c83d7e commit a075792
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 27 deletions.
2 changes: 1 addition & 1 deletion data
18 changes: 18 additions & 0 deletions examples/meta/src/kernel/oligo_string.sg.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
File traindat = read_csv("@SHOGUN_DATA@/fm_train_dna.dat")
File testdat = read_csv("@SHOGUN_DATA@/fm_test_dna.dat")

#![create_features]
Features feats_train = create_char_string_features(traindat, enum EAlphabet.DNA)
Features feats_test = create_char_string_features(testdat, enum EAlphabet.DNA)
#![create_features]

#![create_kernel]
Kernel kernel = create_kernel("OligoStringKernel",cache_size=10, k=3, width=1.2)
kernel.init(feats_train, feats_train)
#![create_kernel]

#![get_kernel_features]
RealMatrix km_train = kernel.get_kernel_matrix()
kernel.init(feats_train, feats_test)
RealMatrix km_test = kernel.get_kernel_matrix()
#![get_kernel_features]
26 changes: 0 additions & 26 deletions examples/undocumented/python/kernel_oligo_string.py

This file was deleted.

0 comments on commit a075792

Please sign in to comment.