Created
August 3, 2020 16:27
-
-
Save abhishek-shrm/127c5a5b747edb7595eaf28a30f850c6 to your computer and use it in GitHub Desktop.
This file contains 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
# Labelling Top 10 as 1 and last 10 as 0 | |
rel=list(range(1,11)) | |
nonrel=list(range(91,101)) | |
training_ranked100['rel']=training_ranked100['rank'].apply(lambda x: 1 if x in rel else ( 0 if x in nonrel else np.nan)) | |
testing_ranked100['rel']=testing_ranked100['rank'].apply(lambda x: 1 if x in rel else ( 0 if x in nonrel else np.nan)) | |
# Result set for Training | |
training_result=training_ranked100.dropna() | |
training_result['rel']=training_result['rel'].astype(int) | |
print('Shape=>',training_result.shape) | |
training_result.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment