Last active
January 1, 2024 19:58
-
-
Save karamanbk/2741fc0e0bd22c8edcc9e4d0a20fda2b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "execution_count": 48, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "from datetime import datetime, timedelta,date\n", | |
| "import pandas as pd\n", | |
| "%matplotlib inline\n", | |
| "from sklearn.metrics import classification_report,confusion_matrix\n", | |
| "import matplotlib.pyplot as plt\n", | |
| "import numpy as np\n", | |
| "import seaborn as sns\n", | |
| "from __future__ import division\n", | |
| "from sklearn.cluster import KMeans\n" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 49, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "import plotly.plotly as py\n", | |
| "import plotly.offline as pyoff\n", | |
| "import plotly.graph_objs as go" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 50, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "import sklearn\n", | |
| "import xgboost as xgb\n", | |
| "from sklearn.model_selection import KFold, cross_val_score, train_test_split" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 51, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/html": [ | |
| " <script type=\"text/javascript\">\n", | |
| " window.PlotlyConfig = {MathJaxConfig: 'local'};\n", | |
| " if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n", | |
| " if (typeof require !== 'undefined') {\n", | |
| " require.undef(\"plotly\");\n", | |
| " define('plotly', function(require, exports, module) {\n", | |
| " /**\n", | |
| "* plotly.js v1.47.3\n", | |
| "* Copyright 2012-2019, Plotly, Inc.\n", | |
| "* All rights reserved.\n", | |
| "* Licensed under the MIT license\n", | |
| "*/\n", |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's strange, I used the same dataset, everything quite identical to the numbers here, but the output is different!? Do we need to set a random_seed for XGBClassifier?
Mine was:
Real Discount Uptick - Order: 608, Revenue: 15200
Predicted Discount Uptick - Order: 558, Revenue: 13950