You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to run the code of tests.py so that I can confirm that no issues in the class.
so how can I solve it?
Traceback (most recent call last):
File "/Users/dpashraful/PycharmProjects/Dpml_ex1/dpmlex1/ml/tests.py", line 34, in test_registry
self.assertEqual(len(registry.endpoints), 0)
^^^^^^^^^^^^^^^^^^
AttributeError: 'MLRegistry' object has no attribute 'endpoints'
Here are the tests.py code files code:
import inspect
from django.test import TestCase
from .income_classifier.random_forest import RandomForestClassifier
from .registry import MLRegistry
I am trying to run the code of tests.py so that I can confirm that no issues in the class.
so how can I solve it?
Traceback (most recent call last):
File "/Users/dpashraful/PycharmProjects/Dpml_ex1/dpmlex1/ml/tests.py", line 34, in test_registry
self.assertEqual(len(registry.endpoints), 0)
^^^^^^^^^^^^^^^^^^
AttributeError: 'MLRegistry' object has no attribute 'endpoints'
Here are the tests.py code files code:
import inspect
from django.test import TestCase
from .income_classifier.random_forest import RandomForestClassifier
from .registry import MLRegistry
class MLTests(TestCase):
def test_rf_algorithm(self):
input_data = {
"age": 37,
"workclass": "Private",
"fnlwgt": 34146,
"education": "HS-grad",
"education-num": 9,
"marital-status": "Married-civ-spouse",
"occupation": "Craft-repair",
"relationship": "Husband",
"race": "White",
"sex": "Male",
"capital-gain": 0,
"capital-loss": 0,
"hours-per-week": 68,
"native-country": "United-States"
}
my_alg = RandomForestClassifier()
response = my_alg.compute_prediction(input_data)
self.assertEqual('OK', response['status'])
self.assertTrue('label' in response)
self.assertEqual('<=50K', response['label'])
The text was updated successfully, but these errors were encountered: