<jupyter_start><jupyter_text>**Installing PLM package**<jupyter_code>!pip install PLM<jupyter_output><empty_output><jupyter_text>**Process Dataset***   Target should be output column followed by the label*   Target is preceeded by Input features<jupyter_code>import pandas as pd
import numpy as np

df = pd.read_csv('equ23_data.csv', header=None)
target = np.array(df[df.columns[[-2, -1]]])
data = np.array(df.iloc[:, :-2])<jupyter_output><empty_output><jupyter_text>---*   pelm() is the wrapper function with calls train and test methods internally.*   The number of epochs can be specified as a parameter, the default is epochs=20.<jupyter_code>from PLM.pelm import pelm

n = 10;
parameter1 = 10;
parameter2 = 10;
model_number = 3;

pelm(data, target, model_number, n=n, p=parameter1, s=parameter2)<jupyter_output>Execution time:  43.6878502368927  secs
Min error:  0.013624696718351184
Mean error:  0.14071896365248865<jupyter_text>---*   plm_train() & plm_train() methods can be called seperately from the module*   Dataset should rightly processed for calling the specific functions*   plm_train() & plm_test() methods used BELM(Bi-directional ELM) package internally<jupyter_code>X_train, X_test, Y_train, Y_test = train_test_split(data, target, test_size=0.3)
L_train = Y_train[:, -1].reshape(-1, 1)
L_test = Y_test[:, -1].reshape(-1, 1)

Y_test = Y_test[:, 0].reshape(-1, 1)
Y_train = Y_train[:, 0].reshape(-1, 1)
from PLM.pelm import pelm, plm_train, plm_test

n = 10;
parameter1 = 10;
parameter2 = 10;
model_number = 3;

d, t, l, rl, net = plm_train(X_train, Y_train, L_train, n=n, s1=parameter1, s2=parameter2, c=model_number);
e, svm_acc = plm_test(d, l, X_test, Y_test, L_test, net, c=model_number)
print("Error(rmse): ",e)<jupyter_output>Error(rmse):  0.06363327438862462<jupyter_text>**Bi-directional Extreme Learning Machine***   Last column should be the  output column *   Output column is preceeded by the input features<jupyter_code>import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split

df = pd.read_csv('sample_data.csv', header=None)
output = np.array(df[df.columns[-1]])
data = np.array(df.iloc[:, :-1])

X_train, X_test, Y_train, Y_test = train_test_split(data, output, test_size=0.3)
Y_train = Y_train.reshape(-1, 1)
Y_test = Y_test.reshape(-1, 1)
from BELM.belm import BELM

belm = BELM(X_train.shape[1], Y_train.shape[1], precision="single")
belm.add_neurons(2, 'sigm')
belm.train(X_train, Y_train)
yhat = belm.predict(X_test)
e = belm.error(Y_test, yhat)
print("Error(rmse):",e)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13359223300970874, 'fraction_numerical': 0.04893203883495146, 'mean_word_length': 6.076923076923077, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '666472', 'license': 'BSD-2-Clause-FreeBSD', 'n_tokens_mistral': 1068, 'n_tokens_neox': 995, 'n_words': 244, 'path': 'PLM_example.ipynb', 'repo_name': 'charliedondapati/PLM', 'size': '2575'}