Skip to content

Commit

Permalink
Major update: KGE & unused paramters are removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Demirrr committed Feb 16, 2022
1 parent e7d53cd commit 48d7526
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 136 deletions.
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
install_requires=['scikit-learn>=0.22.1',
'pytest',
'rdflib',
'pandas>=1.0.3',
'torch'],
'pandas>=1.0.3'],
author='Caglar Demir',
author_email='caglardemir8@gmail.com',
classifiers=[
Expand Down
17 changes: 5 additions & 12 deletions tests/test_QCUT.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,12 @@

class TestDefault:
def test_default_QCUT(self):

X, y = datasets.fetch_california_housing(return_X_y=True)
n, m = X.shape
X_transformed = QCUT(min_unique_val_per_column=2, num_quantile=5).transform(pd.DataFrame(X))
X_transformed = QCUT(min_unique_val_per_column=6, num_quantile=5).transform(pd.DataFrame(X))
# Add prefix
X_transformed.index = 'Event_' + X_transformed.index.astype(str)
kg = GraphGenerator().transform(X_transformed)

gg = GraphGenerator()
kg = gg.transform(X_transformed)
assert len(kg) == (n * m)
new_kg = []
with open(gg.path, 'r') as read:
for i in read:
s, p, o, = i.split()
new_kg.append((s, p, o))

assert kg == new_kg
for s, p, o in kg:
pass #print(s, p, o)
71 changes: 0 additions & 71 deletions vectograph/helper_classes.py

This file was deleted.

4 changes: 0 additions & 4 deletions vectograph/helper_funcs.py

This file was deleted.

33 changes: 0 additions & 33 deletions vectograph/kge_models.py

This file was deleted.

15 changes: 1 addition & 14 deletions vectograph/transformers.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
from sklearn.base import BaseEstimator, TransformerMixin
from rdflib import Graph, URIRef, Namespace # basic RDF handling
from .kge_models import *
from collections import Counter, defaultdict
from .helper_classes import Data
import torch
import numpy as np
import pandas as pd
from typing import Dict, Tuple, List
import math
import random
from scipy.spatial.distance import cosine
from sklearn.neighbors import NearestNeighbors
import os
import itertools
from .utils import ignore_columns, create_experiment_folder, create_logger

from typing import List

class RDFGraphCreator(BaseEstimator, TransformerMixin):
"""
Expand Down

0 comments on commit 48d7526

Please sign in to comment.