Skip to content

Commit

Permalink
Add meta example for chi_square
Browse files Browse the repository at this point in the history
Add data file
  • Loading branch information
syashakash committed Apr 14, 2018
1 parent 8ca2ee4 commit e0b915e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion data
20 changes: 20 additions & 0 deletions examples/meta/src/distance/chi_square.sg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
CSVFile f_feats_a("../../data/fm_train_real.dat")
CSVFile f_feats_b("../../data/fm_test_real.dat")

#![create_features]
RealFeatures features_a(f_feats_a)
RealFeatures features_b(f_feats_b)
#![create_features]

#![create_instance]
ChiSquareDistance distance(features_a, features_a)
#![create_instance]

#![extract_distance]
RealMatrix distance_matrix_aa = distance.get_distance_matrix()
#![extract_distance]

#![refresh_distance]
distance.init(features_a, features_b)
RealMatrix distance_matrix_ab = distance.get_distance_matrix()
#![refresh_distance]

0 comments on commit e0b915e

Please sign in to comment.