def test_opf_pre_compute_distances(): txt = loader.load_txt('data/boat.txt') X, Y = parser.parse_loader(txt) X_train, _, _, _ = splitter.split(X, Y, 0.5, 1) general.pre_compute_distance(X_train, 'boat_split_distances.txt', 'log_squared_euclidean')
import opfython.math.general as g import opfython.stream.loader as l import opfython.stream.parser as p import opfython.stream.splitter as s # Loading a .txt file to a numpy array txt = l.load_txt('data/boat.txt') # Parsing a pre-loaded numpy array X, Y = p.parse_loader(txt) # Creating a file of pre-computed distances g.pre_compute_distance(X, 'boat_split_distances.txt', distance='log_squared_euclidean')