Esempio n. 1
0
def plot_hypothesis_without_predicted_value(x_data, function):
    graph = Plot(x_values=x_data,
                 function=function,
                 title="Predicted Profit vs. Population Size",
                 x_label="Population",
                 y_label="Profit")
    graph.scatter(data.Population, data.Profit, label="Traning Data")
    graph.show()
Esempio n. 2
0
def plot_initial_data():
    graph = Plot(x_values=None,
                 function=None,
                 title="Predicted Profit vs. Population Size",
                 x_label="Population",
                 y_label="Profit")
    graph.scatter(data.Population, data.Profit, label="Traning Data")
    graph.show()
Esempio n. 3
0
def plot_hypothesis_with_predicted_value(x_data, function, value,
                                         predicted_value):
    graph = Plot(x_values=x_data,
                 function=function,
                 title="Predicted Profit vs. Population Size",
                 x_label="Population",
                 y_label="Profit")
    graph.scatter(data.Population, data.Profit, label="Traning Data")
    graph.scatter(value, predicted_value, label="Predicted Value", c="g")
    graph.text(value - 0.55, predicted_value + 1, str(predicted_value)[0:6])
    graph.show()