Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'loglizer.models' My issue is this #71

Open
Nisar-1234 opened this issue Mar 13, 2020 · 1 comment

Comments

@Nisar-1234
Copy link

import sys
sys.path.append('../')
import pandas as pd
import loglizer
from loglizer.models import *
from loglizer import dataloader, preprocessing

run_models = ['PCA', 'InvariantsMiner', 'LogClustering']
struct_log = r'‪C:\Users\privus\Downloads\HDFS.npz' # The benchmark dataset

if name == 'main':
(x_tr, y_train), (x_te, y_test) = dataloader.load_HDFS(struct_log,
window='session',
train_ratio=0.5,
split_type='uniform')
benchmark_results = []
for _model in run_models:
print('Evaluating {} on HDFS:'.format(_model))
if _model == 'PCA':
feature_extractor = preprocessing.FeatureExtractor()
x_train = feature_extractor.fit_transform(x_tr, term_weighting='tf-idf',
normalization='zero-mean')
model = PCA()
model.fit(x_train)

    elif _model == 'InvariantsMiner':
        feature_extractor = preprocessing.FeatureExtractor()
        x_train = feature_extractor.fit_transform(x_tr)
        model = InvariantsMiner(epsilon=0.5)
        model.fit(x_train)

    elif _model == 'LogClustering':
        feature_extractor = preprocessing.FeatureExtractor()
        x_train = feature_extractor.fit_transform(x_tr, term_weighting='tf-idf')
        model = LogClustering(max_dist=0.3, anomaly_threshold=0.3)
        model.fit(x_train[y_train == 0, :]) # Use only normal samples for training
@zhujiem
Copy link
Member

zhujiem commented Apr 10, 2020

It is probably caused by Python version mismatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants