MCPcopy
hub / github.com/TheAlgorithms/Python / main

Function main

machine_learning/linear_regression.py:128–140  ·  view source on GitHub ↗

Driver function

()

Source from the content-addressed store, hash-verified

126
127
128def main():
129 """Driver function"""
130 data = collect_dataset()
131
132 len_data = data.shape[0]
133 data_x = np.c_[np.ones(len_data), data[:, :-1]].astype(float)
134 data_y = data[:, -1].astype(float)
135
136 theta = run_linear_regression(data_x, data_y)
137 len_result = theta.shape[1]
138 print("Resultant Feature vector : ")
139 for i in range(len_result):
140 print(f"{theta[0, i]:.5f}")
141
142
143if __name__ == "__main__":

Callers 1

Calls 2

run_linear_regressionFunction · 0.85
collect_datasetFunction · 0.70

Tested by

no test coverage detected