question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Singeleton pattern for the task API

See original GitHub issue

Currently, in AutoGluon, we will do the following, in which TabularPrediction is used as a singeleton.

from autogluon import TabularPrediction as task
predictor = task.fit(...)

A more natural design choice is to create a new class object and call fit as a method.

from autogluon import TabularPrediction
task = TabularPrediction(SOME_ARGS)
predictor = task.fit()

@Jerryzcn

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sxjsciencecommented, Mar 26, 2020

@Innixma I think .fit() will still take the data as the input parameter. The difference is that we can pass some specific requirements like time budget and inference latency when constructing the task, e.g.

from autogluon import TabularPrediction
task = TabularPrediction(time_limit=1000, latency='low')
predictor = task.fit(train_data, label='...')

Then, we will automatically learn a predictor that obeys the budget constraint.

0reactions
Innixmacommented, Feb 14, 2021

Closing as resolved, we have implemented the singleton pattern for v0.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java Singleton Design Pattern Best Practices with Examples
Singleton pattern restricts the instantiation of a class and ensures that only one instance of the class exists in the Java Virtual Machine....
Read more >
C# Design Patterns - Singleton - Code Maze
The Singleton is a creational design pattern that allows us to create a single instance of an object and to share that instance...
Read more >
Is it a good idea to use Singleton pattern for an API manager?
I am trying to find a good design pattern for this purpose, it seems Singleton Design Pattern is the only choice here. Without...
Read more >
Android Design Patterns: The Singleton Pattern - Code
The Singleton Pattern is a software design pattern that guarantees a class has one instance only and a global point of access to...
Read more >
Singleton Design Pattern | Introduction - GeeksforGeeks
Singleton pattern is a design pattern which restricts a class to instantiate its multiple objects. It is nothing but a way of defining...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found