how to drow an exponontiel plot of this situation with python
$begingroup$
I have a dataset with binary output (Y) and I have a column (Duration) contains the duration of each task stored by "days" and varied from 1day to 350days.
when I think logically in our situation, I can deduce that the probability of getting a positive output value (Y = 1) require to have small duration task.
But I need to justify my opinion with some plots
I have tried the following source code but It doesn't represent correctly my assumption.
#LoadData
min_duration = plot_data['Duration'].min()
max_duration = plot_data['Duration'].max()
xr_ = list(range(min_duration, max_duration, 5))
y_ =
for i in range(0,(len(xr_)-1)):
a_ = np.logical_and(plot_data['Duration'].values >= xr_[i], plot_data['Duration'].values < xr_[i+1])
b_ = np.logical_and(np.logical_and(plot_data['Duration'].values >= xr_[i], plot_data['Duration'].values < xr_[i+1]), plot_data['output'].values==1)
y_.append(sum(b_)/sum(a_))
import matplotlib
matplotlib.pyplot.plot(xr_[1:len(xr_)], y_, 'o')
Based on my previous assumption I must get a plot which contains an exponential form like :

But I have got contrary the following plot:

I want to know where I have a mistake and If there is any other method to justify my assumption
python dataset matplotlib
$endgroup$
add a comment |
$begingroup$
I have a dataset with binary output (Y) and I have a column (Duration) contains the duration of each task stored by "days" and varied from 1day to 350days.
when I think logically in our situation, I can deduce that the probability of getting a positive output value (Y = 1) require to have small duration task.
But I need to justify my opinion with some plots
I have tried the following source code but It doesn't represent correctly my assumption.
#LoadData
min_duration = plot_data['Duration'].min()
max_duration = plot_data['Duration'].max()
xr_ = list(range(min_duration, max_duration, 5))
y_ =
for i in range(0,(len(xr_)-1)):
a_ = np.logical_and(plot_data['Duration'].values >= xr_[i], plot_data['Duration'].values < xr_[i+1])
b_ = np.logical_and(np.logical_and(plot_data['Duration'].values >= xr_[i], plot_data['Duration'].values < xr_[i+1]), plot_data['output'].values==1)
y_.append(sum(b_)/sum(a_))
import matplotlib
matplotlib.pyplot.plot(xr_[1:len(xr_)], y_, 'o')
Based on my previous assumption I must get a plot which contains an exponential form like :

But I have got contrary the following plot:

I want to know where I have a mistake and If there is any other method to justify my assumption
python dataset matplotlib
$endgroup$
add a comment |
$begingroup$
I have a dataset with binary output (Y) and I have a column (Duration) contains the duration of each task stored by "days" and varied from 1day to 350days.
when I think logically in our situation, I can deduce that the probability of getting a positive output value (Y = 1) require to have small duration task.
But I need to justify my opinion with some plots
I have tried the following source code but It doesn't represent correctly my assumption.
#LoadData
min_duration = plot_data['Duration'].min()
max_duration = plot_data['Duration'].max()
xr_ = list(range(min_duration, max_duration, 5))
y_ =
for i in range(0,(len(xr_)-1)):
a_ = np.logical_and(plot_data['Duration'].values >= xr_[i], plot_data['Duration'].values < xr_[i+1])
b_ = np.logical_and(np.logical_and(plot_data['Duration'].values >= xr_[i], plot_data['Duration'].values < xr_[i+1]), plot_data['output'].values==1)
y_.append(sum(b_)/sum(a_))
import matplotlib
matplotlib.pyplot.plot(xr_[1:len(xr_)], y_, 'o')
Based on my previous assumption I must get a plot which contains an exponential form like :

But I have got contrary the following plot:

I want to know where I have a mistake and If there is any other method to justify my assumption
python dataset matplotlib
$endgroup$
I have a dataset with binary output (Y) and I have a column (Duration) contains the duration of each task stored by "days" and varied from 1day to 350days.
when I think logically in our situation, I can deduce that the probability of getting a positive output value (Y = 1) require to have small duration task.
But I need to justify my opinion with some plots
I have tried the following source code but It doesn't represent correctly my assumption.
#LoadData
min_duration = plot_data['Duration'].min()
max_duration = plot_data['Duration'].max()
xr_ = list(range(min_duration, max_duration, 5))
y_ =
for i in range(0,(len(xr_)-1)):
a_ = np.logical_and(plot_data['Duration'].values >= xr_[i], plot_data['Duration'].values < xr_[i+1])
b_ = np.logical_and(np.logical_and(plot_data['Duration'].values >= xr_[i], plot_data['Duration'].values < xr_[i+1]), plot_data['output'].values==1)
y_.append(sum(b_)/sum(a_))
import matplotlib
matplotlib.pyplot.plot(xr_[1:len(xr_)], y_, 'o')
Based on my previous assumption I must get a plot which contains an exponential form like :

But I have got contrary the following plot:

I want to know where I have a mistake and If there is any other method to justify my assumption
python dataset matplotlib
python dataset matplotlib
asked 7 mins ago
NirmineNirmine
537
537
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "557"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f51038%2fhow-to-drow-an-exponontiel-plot-of-this-situation-with-python%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Data Science Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f51038%2fhow-to-drow-an-exponontiel-plot-of-this-situation-with-python%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown