Comments (5)
dffml/model/tensorflow/dffml_model_tensorflow/model/dnn.py
Lines 149 to 187 in b6e45e8
@pdxjohnny I was implementing applicable features and found it leaded to the following functions. Do they need to be re-implemented or can I pick them up from dnn and change the conditions (for starters the feature length should be 2 and so on)
from dffml.
And can you suggest me how to debug my code like how can I go about testing (for now checking that whether I have received data successfully or not)?
from dffml.
Here's an outline for 2.a.iv and 2.a.v from https://docs.google.com/document/d/16u9Tev3O0CcUDe2nfikHmrO3Xnd4ASJ45myFgQLpvzM/edit#heading=h.s3lkoesyhz9v
Is this what you're talking about?
class SimpleLinearRegression(Model):
async def applicable_features(self, features):
if len(features) != 1:
raise ValueError("simple LR only supports a single feature")
if features[0].dtype() != int and features[0].dtype() != float:
raise ValueError("simple LR only supports int or float feature")
if features[0].length() != 1:
raise ValueError("simple LR only supports single values (non-matrix / array)")
features_we_care_about = [features[0].NAME]
return features_we_care_about
async def train(self, sources, features):
features_we_care_about = self.applicable_features(features)
async for repo in sources.with_features(features_we_care_about):
# Grab a subset of the feature data being stored within the repo
# The subset is the feature_we_care_about and the feature we are want to predict
feature_data = repo.features(features_we_care_about + [self.parent.config.predict])
xData.append(feature_data[features_we_care_about[0]])
yData.append(feature_data[self.parent.config.predict])
from dffml.
Here's an outline for 2.a.iv and 2.a.v from https://docs.google.com/document/d/16u9Tev3O0CcUDe2nfikHmrO3Xnd4ASJ45myFgQLpvzM/edit#heading=h.s3lkoesyhz9v
Is this what you're talking about?
class SimpleLinearRegression(Model): async def applicable_features(self, features): if len(features) != 1: raise ValueError("simple LR only supports a single feature") if features[0].dtype() != int and features[0].dtype() != float: raise ValueError("simple LR only supports int or float feature") if features[0].length() != 1: raise ValueError("simple LR only supports single values (non-matrix / array)") features_we_care_about = [features[0].NAME] return features_we_care_about async def train(self, sources, features): features_we_care_about = self.applicable_features(features) async for repo in sources.with_features(features_we_care_about): # Grab a subset of the feature data being stored within the repo # The subset is the feature_we_care_about and the feature we are want to predict feature_data = repo.features(features_we_care_about + [self.parent.config.predict]) xData.append(feature_data[features_we_care_about[0]]) yData.append(feature_data[self.parent.config.predict])
well, this is pretty simple and understandable, I was using dnn as my reference wherein applicable features lead to self.features which in turn lead to feature_feature_column (which ultimately checked the types).
from dffml.
ya dnn is complicated by tensorflow APIs :)
from dffml.
Related Issues (20)
- docs: there is a mistake in the official documentation website
- ## 2023-01-31 @pdxjohnny Engineering Logs HOT 1
- docs: contributing: editors: vscode: Explain how to venv HOT 5
- operations: innersource: npm-groovy-lint: Only parse groovy files
- tests: mnist tests failing due to images missing? HOT 3
- operations: innersource: npm groovy lint: Use groovylintrc if present
- alice: docs: shouldi: contribute: overlay: please: log: todos: Example of application via dffml service overlay install command
- plugin: new: dffml-model-transformers
- plugin: new: dffml-model-transformers
- plugin: new: dffml-model-transformers HOT 1
- plugin: new: dffml-model-transformers
- plugin: new: dffml-model-transformers
- plugin: new: dffml-model-transformers
- alice: shouldi: contribute: Look for hardcoded paths and other values in groovy functions
- dffml: service: dev: overlay: disable: Add command to disable overlays
- style: Update black to 23.3.0
- scripts: images containers manifest: Debug
- Personal identity HOT 1
- Automate the training process (with auto-sklearn) HOT 2
- question: How do I contribute?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dffml.