# Python code for linear regression  provided by Analytics Vidhya

print '-' * 85
print """
Linear Regression

Code provided by Analytics Vidhya article:

    #Import Library

    #Import other necessary libraries like pandas, numpy...
    from sklearn import linear_model

    #Load Train and Test datasets


    #Identify feature and response variable(s) and values must be numeric and numpy arrays
    x_train=input_variables_values_training_datasets
    y_train=target_variables_values_training_datasets
    x_test=input_variables_values_test_datasets

    # Create linear regression object
    linear = linear_model.LinearRegression()

    # Train the model using the training sets and check score
    linear.fit(x_train, y_train)
    linear.score(x_train, y_train)

    #Equation coefficient and Intercept
    print('Coefficient: \\n', linear.coef_)
    print('Intercept: \\n', linear.intercept_)

    #Predict Output
    predicted= linear.predict(x_test)
"""
print '-' * 85
