Module Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str ImportFrom alias Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad If CompareGt NameLoad NameLoad body Print Str orelse If CompareEq NameLoad NameLoad body Print Str orelse Print Str Print BinOpMod Str NameLoad Print BinOpMod Str NameLoad Return TupleLoad NameLoad NameLoad decorator_list If CompareEq NameLoad Str body Import alias Import alias identifier Import alias ImportFrom alias ImportFrom alias Import alias Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str keyword Str Assign SubscriptStore NameLoad ExtSlice Slice Index Num BinOpSub SubscriptLoad NameLoad ExtSlice Slice Index Num Num Assign SubscriptStore NameLoad ExtSlice Slice Index Num BinOpSub SubscriptLoad NameLoad ExtSlice Slice Index Num Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call NameLoad keyword Str Assign SubscriptStore NameLoad Index Str Num Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Print BinOpMod Str TupleLoad NameLoad NameLoad
N/A N/A TestEfficacy.py

Test the efficacy of your learned metric on a set of data

The algorithm should learn a matrix A suxh that A^(1/2) * X

The result should have a better silhouette score than X.
 test_efficacy N/A N/A X y M N/A N/A N/A 
    M is the factor matix such that A = M * M'
     sklearn.metrics silhouette_score N/A Xt N/A N/A N/A np dot X M real N/A S N/A silhouette_score X y N/A St N/A silhouette_score Xt y N/A N/A S St N/A N/A Bad idea to use this N/A N/A N/A S St N/A N/A Nothing to gain from using this N/A N/A This works N/A N/A S = %f S N/A N/A St = %f St N/A N/A S St N/A N/A N/A __name__ __main__ N/A N/A os N/A numpy np N/A scipy.linalg metric_learn.set_default_params set_default_params metric_learn.itml.itml_alg itml_alg N/A itertools N/A X N/A N/A np genfromtxt N/A N/A N/A os path join data test_X.csv delimiter , N/A y N/A N/A np genfromtxt N/A N/A N/A os path join data test_y.csv delimiter , N/A C N/A N/A np genfromtxt N/A N/A N/A os path join data test_C.csv delimiter , N/A N/A C N/A N/A N/A 0 N/A N/A C N/A N/A N/A 0 1.0 N/A N/A C N/A N/A N/A 1 N/A N/A C N/A N/A N/A 1 1.0 N/A A0 N/A N/A np eye N/A N/A X shape N/A 1 N/A params N/A set_default_params method itml N/A N/A params N/A thresh 0.01 N/A A N/A itml_alg C X A0 params N/A M N/A N/A N/A scipy linalg sqrtm A N/A N/A old_score new_score N/A test_efficacy X y M N/A N/A %f ~> %f N/A old_score new_score