New answers tagged


As you've mentioned you can use the function by sklearn, I don't see the problem using it (perhaps I'm missing something) import pandas as pd from sklearn.datasets import dump_svmlight_file def df_to_libsvm(df: pd.DataFrame): x = df.drop('label', axis=1) y = df['label'] dump_svmlight_file(X=x, y=y, f='libsvm.dat', zero_based=True) Regarding the ...

Top 50 recent answers are included