Open glogowski-wojciech opened 2 years ago
Wrong variable referenced in code example in docs in "Interpretability - Explanation Dashboard" wrapper class In https://microsoft.github.io/SynapseML/docs/features/responsible_ai/Interpretability%20-%20Explanation%20Dashboard/ in the class wrapper there is:
wrapper
class wrapper(object): [...] def predict(self, data): [...] return model.transform(sparkdata).select('prediction').toPandas().values.flatten().tolist() def predict_proba(self, data): [...] prediction = model.transform(sparkdata).select('probability').toPandas().values.flatten().tolist() [...]
which I believe should refer to self.model instead of just model:
self.model
model
class wrapper(object): [...] def predict(self, data): [...] return self.model.transform(sparkdata).select('prediction').toPandas().values.flatten().tolist() def predict_proba(self, data): [...] prediction = self.model.transform(sparkdata).select('probability').toPandas().values.flatten().tolist() [...]
Full body of the snippet for context:
class wrapper(object): def __init__(self, model): self.model = model def predict(self, data): sparkdata = spark.createDataFrame(data) return model.transform(sparkdata).select('prediction').toPandas().values.flatten().tolist() def predict_proba(self, data): sparkdata = spark.createDataFrame(data) prediction = model.transform(sparkdata).select('probability').toPandas().values.flatten().tolist() proba_list = [vector.values.tolist() for vector in prediction] return proba_list
I found the same issue in wrapper classes in the following files:
AB#1864607
@glogowski-wojciech great catch. Yes, that needs to be changed to self.model instead of model. I'll send a PR for the fix.
@imatiach-msft I would love to fix that. Can I work on it?
Wrong variable referenced in code example in docs in "Interpretability - Explanation Dashboard" wrapper class In https://microsoft.github.io/SynapseML/docs/features/responsible_ai/Interpretability%20-%20Explanation%20Dashboard/ in the class
wrapper
there is:which I believe should refer to
self.model
instead of justmodel
:Full body of the snippet for context:
I found the same issue in
wrapper
classes in the following files:AB#1864607