Package: autogonai
AutogonAI Python Library ReadmeOverviewThe AutogonAI Python library is a tool for interacting with AutogonAI's AI automation platform. It enables you to build and manage machine learning projects using a variety of functions and APIs provided by AutogonAI. With this library, you can streamline your machine learning workflow and take advantage of AutogonAI's automation capabilities.InstallationYou can install the AutogonAI Python library using pip:pipinstallautogonaiGetting StartedTo begin using the AutogonAI Python library, you need an API key, which you can obtain from AutogonAI. Once you have your API key, you can set it as an environment variable or pass it directly to the Client object.importosfromdotenvimportload_dotenvfromautogonai.constantsimportfunction_codesasfcfromautogonai.coreimportClientload_dotenv()API_KEY=os.environ.get("API_KEY")client=Client(api_key=API_KEY)Example UsageHere's an example of how to use the AutogonAI Python library to create a machine learning project and perform various data preprocessing and training tasks:# Create a new projectproject=client.Projects.create("Test Name","Test Description")# Data Inputdata_input=client.Blocks.new(function_code=fc.DataInput,project_id=project["id"],id=1)data_input.set_params(file_type="csv",dburl="https://raw.githubusercontent.com/The-Vheed/polygon-datasets/main/mobile_price_prediction.csv",)response=data_input.run()# Drop Columnscolumn_dropping=client.Blocks.new(fc.DropColumns,project_id=project["id"],id=data_input+1,parent=data_input,)column_dropping.set_params(d_columns=[0,1,3,8])response=column_dropping.run()# Handle Missing Datamissing_data_handler=client.Blocks.new(function_code=fc.HandleMissingData,project_id=project["id"],id=column_dropping+1,parent=column_dropping,)missing_data_handler.set_params(strategy_value="mean",boundaries=":, 2:")response=missing_data_handler.run()# Encode Datadata_encoder=client.Blocks.new(function_code=fc.DataEncoding,project_id=project["id"],id=missing_data_handler+1,parent=missing_data_handler,)data_encoder.set_params(dataset={"encode":True,"encoding_type":"label","remainder":"passthrough","index":1,})response=data_encoder.run()# ... Continue with other data processing tasks# Train an Artificial Neural Network (ANN)ann_train=client.Blocks.new(function_code=fc.ArtificialNeuralNetworkTrain,project_id=project["id"],id=data_encoder+1,parent=data_encoder,)ann_train.set_params(model_name="titanic model",hyp_params={"optimizer":"adam","loss":"binary_crossentropy","metrics":["accuracy"],"batch_size":12,"epochs":5,},)response=ann_train.run()# ... Continue with evaluation and predictionThis is just a basic example to demonstrate how to use the AutogonAI Python library. You can customize it to suit your specific machine learning project requirements.Production PipelinesYou can also use the AutogonAI Python library to make pipeline predictions in production. Here's an example of how to call a production machine learning predict pipeline:response=client.Production.run_pipeline(flow_id="fl-sy3bgqa5tdtestestestestestestest",data="https://github.com/autogoninc/autogon-public-datasets/raw/main/credit-risk/sample_pred.csv",)Additional AutogonAI APIsAutogonAI also provides additional APIs like 'Qore' APIs for image functions like 'Image generation' and others.
Here's an example on image generation:response=client.Qore.VisionAI.image_generation("A dad and his son walking down the street towards a park","512x512")image=Image.open(response["image"])image.show()Output:DocumentationFor detailed documentation and usage instructions, please refer toAutogonAI's official API documentation.SupportIf you encounter any issues or have questions about the AutogonAI Python library or AutogonAI's platform, pleasecontact usdirectly, or raise the issue up on ourdiscord server