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)
You can check out some of our resources directly, see below:
Always search first. It is the best way to quickly find your answer. Check out the icon for that.
Clicking the options button will let you set more specific topic search filters, i.e. only the ones with a solution.
Topic that contains most common solutions with example project files can be found here.
Read our official documentation where you can find a lot of information and instructions about each of our products:
Hopefully this will let you easily find the solution/information you need. Once you have it, we would be happy if you could share your findings here and mark it as a solution. This will help other users find it in the future.
Thank you for helping us build our UiPath Community!