I am trying to upload an ML package written in Python, but I am new to python and I have no prior experience.
when I checked UIPath documentation in the link, it is written that the requirements for this package:
- In this file, a class called Main that implements at least two functions:
a. init(self): takes no argument and loads your model and/or local data for the model (e.g. word embeddings).
b. predict(self, input): a function to be called at model serving time.
- A file named requirements.txt with dependencies needed to run the model.
can anyone please help me how to transform my code below in order to comply with these requirements? and if there are any suggestions about the model ?
from sklearn.svm import OneClassSVM import pandas as pd from sklearn import preprocessing input_file = "training.csv" training_data = pd.read_csv(input_file) X = training_data[['h1', 'h2', 'h3']].values le = preprocessing.LabelEncoder() for i in range(len(X)): X[:, i] =le.fit_transform(X[:,i]) model = OneClassSVM(gamma='auto').fit(X) predection = model.predict(X) print(predection)