<jupyter_start><jupyter_text>Pandas is a Python library for 'manipulating numerical tables and time series' -> https://en.wikipedia.org/wiki/Pandas_(software)<jupyter_code>import pandas
data = pandas.read_csv("./sample_x_y.csv")
print (data.shape)
x= data['x']
y= data['y']
import matplotlib.pyplot as plt
plt.figure(figsize=(5, 5))
plt.plot(x, y, 'o')<jupyter_output><empty_output><jupyter_text>We need to split the input x and output y into socalled numpy arrays, in order to be able to use the classifiers in the science kit learn (scikit) learn or short sklearn library.Numpy: https://en.wikipedia.org/wiki/NumPy<jupyter_code>import pandas as pd
import numpy as np
data = pd.read_csv("./sample_x_y.csv")

# Separate the features (x) and the labels (y) into arrays called X and y
X = np.array(data[['x']])   # with two variables it would be: data[['x1', 'x2']]
y = np.array(data['y'])
# try one of several classifiers provided by scikit learn (sklearn)
from sklearn.linear_model import LinearRegression
regressor = LinearRegression()
regressor.fit(X,y)
regressor.score(X, y)<jupyter_output><empty_output><jupyter_text>sklearn documentation: The best possible score is 1.0 and it can be negative (because the model can be arbitrarily worse). A constant model that always predicts the expected value of y, disregarding the input features, would get a R^2 score of 0.0.<jupyter_code>regressor.predict(5)
regressor.predict(6)
regressor.predict(1.5)
x_test= [0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8]
y_pred= []
for coordinate, val in np.ndenumerate(x_test):
    predX= regressor.predict(val)
    print (str(val) + "    " + str(predX))
    y_pred.append(predX[0])  #np.append(y_pred, np.array([predX]))    # y_pred.append(classifier.predict(x))
print (x_test)
print (y_pred)
plt.figure(figsize=(5, 5))
plt.plot(x_test, y_pred, color='red', linewidth=3)
plt.plot(x, y, 'o')<jupyter_output>0.0    [2.01980198]
0.5    [2.59405941]
1.0    [3.16831683]
1.5    [3.74257426]
2.0    [4.31683168]
2.5    [4.89108911]
3.0    [5.46534653]
3.5    [6.03960396]
4.0    [6.61386139]
4.5    [7.18811881]
5.0    [7.76237624]
5.5    [8.33663366]
6.0    [8.91089109]
6.5    [9.48514851]
7.0    [10.05940594]
7.5    [10.63366337]
8.0    [11.20792079]
[0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8]
[2.0198019801980207, 2.5940594059405946, 3.168316831683169, 3.7425742574257432, 4.316831683168317, 4.891089108910891, 5.465346534653465, 6.03960396039604, 6.6138613861386135, 7.188118811881187, 7.762376237623761, 8.336633663366335, 8.91089108910891, 9.485148514851485, 10.059405940594058, 10.63366336633663, 11.207920792079207]
{'fraction_non_alphanumeric': 0.14798036995092487, 'fraction_numerical': 0.20120800302000755, 'mean_word_length': 4.532359081419624, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '254293', 'license': 'MIT', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1128, 'n_words': 275, 'path': 'notebooks/linear regression with one variable.ipynb', 'repo_name': 'FrieAT/MD_CompressedWavelet', 'size': '2649'}