Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
C
covid_analysis
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
COMPARA
covid_analysis
Commits
36f7dbc8
Commit
36f7dbc8
authored
May 04, 2024
by
Joaquin Torres
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed SMOTE by SMOTETomek
parent
cc7ff8ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
gen_train_data/gen_train_data.ipynb
gen_train_data/gen_train_data.ipynb
+15
-15
No files found.
gen_train_data/gen_train_data.ipynb
View file @
36f7dbc8
...
...
@@ -17,7 +17,7 @@
},
{
"cell_type": "code",
"execution_count": 1
9
,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -25,13 +25,13 @@
"import pandas as pd\n",
"import numpy as np\n",
"from sklearn.model_selection import train_test_split\n",
"from imblearn.
over_sampling import SMOTE
\n",
"from imblearn.
combine import SMOTETomek
\n",
"from imblearn.under_sampling import TomekLinks"
]
},
{
"cell_type": "code",
"execution_count":
11
,
"execution_count":
2
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -42,7 +42,7 @@
},
{
"cell_type": "code",
"execution_count":
12
,
"execution_count":
3
,
"metadata": {},
"outputs": [
{
...
...
@@ -79,7 +79,7 @@
},
{
"cell_type": "code",
"execution_count":
8
,
"execution_count":
4
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -90,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count":
14
,
"execution_count":
5
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -103,7 +103,7 @@
},
{
"cell_type": "code",
"execution_count":
null
,
"execution_count":
6
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -116,19 +116,19 @@
},
{
"cell_type": "code",
"execution_count":
21
,
"execution_count":
7
,
"metadata": {},
"outputs": [],
"source": [
"# OVERSAMPL
ING: SMOTE
\n",
"smote
= SMOTE
()\n",
"X_train_over_pre, y_train_over_pre = smote.fit_resample(X_train_pre, y_train_pre)\n",
"X_train_over_post, y_train_over_post = smote.fit_resample(X_train_post, y_train_post)"
"# OVERSAMPL
ED training data
\n",
"smote
_tomek = SMOTETomek
()\n",
"X_train_over_pre, y_train_over_pre = smote
_tomek
.fit_resample(X_train_pre, y_train_pre)\n",
"X_train_over_post, y_train_over_post = smote
_tomek
.fit_resample(X_train_post, y_train_post)"
]
},
{
"cell_type": "code",
"execution_count":
22
,
"execution_count":
9
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -141,7 +141,7 @@
},
{
"cell_type": "code",
"execution_count":
23
,
"execution_count":
10
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -153,7 +153,7 @@
},
{
"cell_type": "code",
"execution_count":
2
4,
"execution_count":
1
4,
"metadata": {},
"outputs": [],
"source": [
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment