diff --git a/__pycache__/__init__.cpython-36.pyc b/__pycache__/__init__.cpython-36.pyc index 14812de..5135db6 100644 Binary files a/__pycache__/__init__.cpython-36.pyc and b/__pycache__/__init__.cpython-36.pyc differ diff --git a/q02_fit/__pycache__/__init__.cpython-36.pyc b/q02_fit/__pycache__/__init__.cpython-36.pyc index 7d3ab26..1436037 100644 Binary files a/q02_fit/__pycache__/__init__.cpython-36.pyc and b/q02_fit/__pycache__/__init__.cpython-36.pyc differ diff --git a/q02_fit/__pycache__/build.cpython-36.pyc b/q02_fit/__pycache__/build.cpython-36.pyc index 87b2785..13bd11f 100644 Binary files a/q02_fit/__pycache__/build.cpython-36.pyc and b/q02_fit/__pycache__/build.cpython-36.pyc differ diff --git a/q02_fit/build.py b/q02_fit/build.py index fbafb1a..2ea040c 100644 --- a/q02_fit/build.py +++ b/q02_fit/build.py @@ -1,3 +1,4 @@ +# %load q02_fit/build.py # Default imports import pandas as pd @@ -13,15 +14,21 @@ X_train, X_test, y_train, y_test = train_test_split(X_bal, y_bal, test_size=0.33, random_state=9) rfc = RandomForestClassifier(oob_score=True, random_state=9) -param_grid = {"max_features": ['sqrt', 4, "log2"], - "n_estimators": [10, 50, 120], - "max_depth": [40, 20, 10], - "max_leaf_nodes": [5, 10, 2]} +param_grid = {'max_features': ['sqrt', 4, 'log2'], + 'n_estimators': [10, 50, 120], + 'max_depth': [40, 20, 10], + 'max_leaf_nodes': [5, 10, 2]} grid, grid_param, grid_score = grid_search(X_train, y_train, rfc, param_grid, cv=3) # Write your solution here : +def fit(X_test,y_test): + predicted=grid.predict(X_test) + cf=confusion_matrix(y_test,predicted) + cr=classification_report(y_test,predicted) + acc=accuracy_score(y_test,predicted) + return cf,cr,acc diff --git a/q02_fit/tests/__pycache__/__init__.cpython-36.pyc b/q02_fit/tests/__pycache__/__init__.cpython-36.pyc index 5b1da02..87925f4 100644 Binary files a/q02_fit/tests/__pycache__/__init__.cpython-36.pyc and b/q02_fit/tests/__pycache__/__init__.cpython-36.pyc differ diff --git a/q02_fit/tests/__pycache__/test_q02_fit.cpython-36.pyc b/q02_fit/tests/__pycache__/test_q02_fit.cpython-36.pyc index 3d64856..15c32cc 100644 Binary files a/q02_fit/tests/__pycache__/test_q02_fit.cpython-36.pyc and b/q02_fit/tests/__pycache__/test_q02_fit.cpython-36.pyc differ