text: document.write('<link rel="stylesheet" href="https://github.githubassets.com/assets/gist-embed-52b3348036dbd45f4ab76e44de42ebc4.css">')
  document.write('<div id=\"gist103993148\" class=\"gist\">\n    <div class=\"gist-file\">\n      <div class=\"gist-data\">\n        <div class=\"js-gist-file-update-container js-task-list-container file-box\">\n  <div id=\"file-tune-sklearn-3-py\" class=\"file\">\n    \n\n  <div itemprop=\"text\" class=\"Box-body p-0 blob-wrapper data type-python \">\n      \n<table class=\"highlight tab-size js-file-line-container\" data-tab-size=\"8\" data-paste-markdown-skip>\n      <tr>\n        <td id=\"file-tune-sklearn-3-py-L1\" class=\"blob-num js-line-number\" data-line-number=\"1\"><\/td>\n        <td id=\"file-tune-sklearn-3-py-LC1\" class=\"blob-code blob-code-inner js-file-line\"><span class=pl-s1>tune_search<\/span> <span class=pl-c1>=<\/span> <span class=pl-v>TuneGridSearchCV<\/span>(<\/td>\n      <\/tr>\n      <tr>\n        <td id=\"file-tune-sklearn-3-py-L2\" class=\"blob-num js-line-number\" data-line-number=\"2\"><\/td>\n        <td id=\"file-tune-sklearn-3-py-LC2\" class=\"blob-code blob-code-inner js-file-line\">    <span class=pl-v>SGDClassifier<\/span>(),<\/td>\n      <\/tr>\n      <tr>\n        <td id=\"file-tune-sklearn-3-py-L3\" class=\"blob-num js-line-number\" data-line-number=\"3\"><\/td>\n        <td id=\"file-tune-sklearn-3-py-LC3\" class=\"blob-code blob-code-inner js-file-line\">    <span class=pl-s1>parameters<\/span>,<\/td>\n      <\/tr>\n      <tr>\n        <td id=\"file-tune-sklearn-3-py-L4\" class=\"blob-num js-line-number\" data-line-number=\"4\"><\/td>\n        <td id=\"file-tune-sklearn-3-py-LC4\" class=\"blob-code blob-code-inner js-file-line\">    <span class=pl-s1>early_stopping<\/span><span class=pl-c1>=<\/span><span class=pl-c1>True<\/span>,<\/td>\n      <\/tr>\n      <tr>\n        <td id=\"file-tune-sklearn-3-py-L5\" class=\"blob-num js-line-number\" data-line-number=\"5\"><\/td>\n        <td id=\"file-tune-sklearn-3-py-LC5\" class=\"blob-code blob-code-inner js-file-line\">    <span class=pl-s1>max_iters<\/span><span class=pl-c1>=<\/span><span class=pl-c1>10<\/span><\/td>\n      <\/tr>\n      <tr>\n        <td id=\"file-tune-sklearn-3-py-L6\" class=\"blob-num js-line-number\" data-line-number=\"6\"><\/td>\n        <td id=\"file-tune-sklearn-3-py-LC6\" class=\"blob-code blob-code-inner js-file-line\">)<\/td>\n      <\/tr>\n      <tr>\n        <td id=\"file-tune-sklearn-3-py-L7\" class=\"blob-num js-line-number\" data-line-number=\"7\"><\/td>\n        <td id=\"file-tune-sklearn-3-py-LC7\" class=\"blob-code blob-code-inner js-file-line\"><span class=pl-k>import<\/span> <span class=pl-s1>time<\/span> <span class=pl-c># Just to compare fit times<\/span><\/td>\n      <\/tr>\n      <tr>\n        <td id=\"file-tune-sklearn-3-py-L8\" class=\"blob-num js-line-number\" data-line-number=\"8\"><\/td>\n        <td id=\"file-tune-sklearn-3-py-LC8\" class=\"blob-code blob-code-inner js-file-line\"><span class=pl-s1>start<\/span> <span class=pl-c1>=<\/span> <span class=pl-s1>time<\/span>.<span class=pl-en>time<\/span>()<\/td>\n      <\/tr>\n      <tr>\n        <td id=\"file-tune-sklearn-3-py-L9\" class=\"blob-num js-line-number\" data-line-number=\"9\"><\/td>\n        <td id=\"file-tune-sklearn-3-py-LC9\" class=\"blob-code blob-code-inner js-file-line\"><span class=pl-s1>tune_search<\/span>.<span class=pl-en>fit<\/span>(<span class=pl-v>X_train<\/span>, <span class=pl-s1>y_train<\/span>)<\/td>\n      <\/tr>\n      <tr>\n        <td id=\"file-tune-sklearn-3-py-L10\" class=\"blob-num js-line-number\" data-line-number=\"10\"><\/td>\n        <td id=\"file-tune-sklearn-3-py-LC10\" class=\"blob-code blob-code-inner js-file-line\"><span class=pl-s1>end<\/span> <span class=pl-c1>=<\/span> <span class=pl-s1>time<\/span>.<span class=pl-en>time<\/span>()<\/td>\n      <\/tr>\n      <tr>\n        <td id=\"file-tune-sklearn-3-py-L11\" class=\"blob-num js-line-number\" data-line-number=\"11\"><\/td>\n        <td id=\"file-tune-sklearn-3-py-LC11\" class=\"blob-code blob-code-inner js-file-line\"><span class=pl-en>print<\/span>(<span class=pl-s>&quot;Tune Fit Time:&quot;<\/span>, <span class=pl-s1>end<\/span> <span class=pl-c1>-<\/span> <span class=pl-s1>start<\/span>)<\/td>\n      <\/tr>\n      <tr>\n        <td id=\"file-tune-sklearn-3-py-L12\" class=\"blob-num js-line-number\" data-line-number=\"12\"><\/td>\n        <td id=\"file-tune-sklearn-3-py-LC12\" class=\"blob-code blob-code-inner js-file-line\"><span class=pl-s1>pred<\/span> <span class=pl-c1>=<\/span> <span class=pl-s1>tune_search<\/span>.<span class=pl-en>predict<\/span>(<span class=pl-v>X_test<\/span>)<\/td>\n      <\/tr>\n      <tr>\n        <td id=\"file-tune-sklearn-3-py-L13\" class=\"blob-num js-line-number\" data-line-number=\"13\"><\/td>\n        <td id=\"file-tune-sklearn-3-py-LC13\" class=\"blob-code blob-code-inner js-file-line\"><span class=pl-s1>accuracy<\/span> <span class=pl-c1>=<\/span> <span class=pl-s1>np<\/span>.<span class=pl-en>count_nonzero<\/span>(<span class=pl-s1>np<\/span>.<span class=pl-en>array<\/span>(<span class=pl-s1>pred<\/span>) <span class=pl-c1>==<\/span> <span class=pl-s1>np<\/span>.<span class=pl-en>array<\/span>(<span class=pl-s1>y_test<\/span>)) <span class=pl-c1>/<\/span> <span class=pl-en>len<\/span>(<span class=pl-s1>pred<\/span>)<\/td>\n      <\/tr>\n      <tr>\n        <td id=\"file-tune-sklearn-3-py-L14\" class=\"blob-num js-line-number\" data-line-number=\"14\"><\/td>\n        <td id=\"file-tune-sklearn-3-py-LC14\" class=\"blob-code blob-code-inner js-file-line\"><span class=pl-en>print<\/span>(<span class=pl-s>&quot;Tune Accuracy:&quot;<\/span>, <span class=pl-s1>accuracy<\/span>)<\/td>\n      <\/tr>\n<\/table>\n\n\n  <\/div>\n\n  <\/div>\n<\/div>\n\n      <\/div>\n      <div class=\"gist-meta\">\n        <a href=\"https://gist.github.com/inventormc/0937969a2c724284b33219668eb77b7b/raw/a399d552ab452659f63c65f6812f09ce480677fb/tune-sklearn-3.py\" style=\"float:right\">view raw<\/a>\n        <a href=\"https://gist.github.com/inventormc/0937969a2c724284b33219668eb77b7b#file-tune-sklearn-3-py\">tune-sklearn-3.py<\/a>\n        hosted with &#10084; by <a href=\"https://github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n')
  