text_html_output_1.png
from sklearn.decomposition import PCA

from sklearn.decomposition import PCA

from sklearn.preprocessing import StandardScaler

from statsmodels.stats.outliers_influence import variance_inflation_factor

import pandas as pd

import pandas as pd

import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

final_data = pd.read_csv('/kaggle/input/new-01-05-2023-update-1/new_final_updated_dataset.csv')
final_data.columns

import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score
final_data.drop('Unnamed: 0', axis=1, inplace=True)
final_data

final_copy = final_data.copy(deep=True)
final_copy

final_copy.drop(['lncRNA', 'miRNA'], axis=1, inplace=True)
final_copy

X = final_copy.drop('label', axis=1)
vif_data = pd.DataFrame()
vif_data['feature'] = X.columns
vif_data['VIF'] = [variance_inflation_factor(X.values, i) for i in range(len(X.columns))]
vif_data

X.drop(list(vif_data[vif_data['VIF'] > vif_data['VIF'].mean()]['feature']), axis=1, inplace=True)
X

vif_data = pd.DataFrame()
vif_data['feature'] = X.columns
vif_data['VIF'] = [variance_inflation_factor(X.values, i) for i in range(len(X.columns))]
vif_data

sc = StandardScaler()
X = sc.fit_transform(X)
pca = PCA(n_components=182)
X_pca = pca.fit_transform(X)
explained_variance = pca.explained_variance_ratio_
explained_variance