-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix links for model in report (#714)
- Loading branch information
Showing
2 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import os | ||
import shutil | ||
import unittest | ||
from pathlib import Path | ||
|
||
import numpy as np | ||
import pandas as pd | ||
import pytest | ||
from sklearn import datasets | ||
from sklearn.decomposition import PCA | ||
from sklearn.pipeline import make_pipeline | ||
|
||
from supervised import AutoML | ||
from supervised.exceptions import AutoMLException | ||
|
||
iris = datasets.load_iris() | ||
|
||
class AutoMLReportTest(unittest.TestCase): | ||
automl_dir = "AutoMLTest" | ||
|
||
def tearDown(self): | ||
shutil.rmtree(self.automl_dir, ignore_errors=True) | ||
|
||
def setUp(self): | ||
shutil.rmtree(self.automl_dir, ignore_errors=True) | ||
|
||
def test_report(self): | ||
"""Tests AutoML in the iris dataset (Multiclass classification)""" | ||
model = AutoML( | ||
algorithms=["Baseline"], | ||
explain_level=0, verbose=0, random_state=1, results_path=self.automl_dir | ||
) | ||
model.fit(iris.data, iris.target) | ||
model.report() | ||
|
||
report_path = os.path.join(self.automl_dir, "README.html") | ||
self.assertTrue(os.path.exists(report_path)) | ||
|
||
content = None | ||
with open(report_path, "r") as fin: | ||
content = fin.read() | ||
|
||
|
||
#print(content) | ||
link = '<a href="1_Baseline/README.html">' | ||
self.assertFalse(link in content) | ||
|
||
|
||
|