Config proposal (API Simplification)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- api, developer-experience
Research direction
Start by reviewing issue #83 and the current SDK configuration/API entry points; this proposal introduces Feature, Category, Text, Number, and Schema. Compare the existing API with the shown JSON output and clarify the intended simplification with maintainers. Done means the design is agreed and its implementation scope is defined.
Written by the indexing model from the issue text.
Description
This is number 3 from #83 , @mhaas , what do you think?
import json
class Feature:
def __init__(self,columns:list=[]):
self.columns = columns
self.repr = self._get_def()
@property
def featuretype(self):
pass
def _get_def(self):
cols = []
for col in self.columns:
cols.append({"label": col, "type": self.featuretype})
return cols
def __add__(self,other):
self.repr=self.repr+other.repr
return self
def __repr__(self):
return str(self.repr)
class Category(Feature):
def __init__(self,columns:list=[]):
super(Category,self).__init__(columns)
@property
def featuretype(self):
return "CATEGORY"
class Text(Feature):
def __init__(self,columns:list=[]):
super(Text,self).__init__(columns)
@property
def featuretype(self):
return "TEXT"
class Number(Feature):
def __init__(self,columns:list=[]):
super(Number,self).__init__(columns)
@property
def featuretype(self):
return "NUMBER"
class Schema:
def __init__(self,features=None,labels=None,name=None):
self.features = features
self.labels = labels
self.name = name
self.repr = self._get_def()
def _get_def(self):
return json.dumps({
"features": self.features.repr,
"labels": self.labels.repr,
"name": self.name,
},indent=2)
def __repr__(self):
return str(self.repr)
features = Text(['MYTEXT'])+Number(['ANumeric'])+Category(['Manufacturee','description'])
labels = Category(['Label1','Label2'])+Number(['Label3'])
schema = Schema(features,labels,"bestbuy-category-prediction")
print(schema)
result:
{
"features": [
{
"label": "MYTEXT",
"type": "TEXT"
},
{
"label": "ANumeric",
"type": "NUMBER"
},
{
"label": "Manufacturee",
"type": "CATEGORY"
},
{
"label": "description",
"type": "CATEGORY"
}
],
"labels": [
{
"label": "Label1",
"type": "CATEGORY"
},
{
"label": "Label2",
"type": "CATEGORY"
}
],
"name": "bestbuy-category-prediction"
}
- Dominant language
- Jupyter Notebook
- Stars
- 20
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SAP/data-attribute-recommendation-python-sdk
-
Update Dependencies Open
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Ensure thread safety Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in SAP/data-attribute-recommendation-python-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3312 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
needs-acceptance wg/data-plane-networking
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/semantic-router#4024 · 1 comment ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
amponce/archive-movie-browser#165 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100